@absolutejs/absolute 0.19.0-beta.950 → 0.19.0-beta.952

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  2. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  3. package/dist/angular/index.js +39 -15
  4. package/dist/angular/index.js.map +5 -5
  5. package/dist/angular/server.js +39 -15
  6. package/dist/angular/server.js.map +5 -5
  7. package/dist/build.js +1235 -717
  8. package/dist/build.js.map +21 -19
  9. package/dist/cli/index.js +159 -92
  10. package/dist/index.js +1359 -815
  11. package/dist/index.js.map +28 -26
  12. package/dist/islands/index.js +5 -5
  13. package/dist/islands/index.js.map +3 -3
  14. package/dist/react/components/browser/index.js +17 -2
  15. package/dist/react/components/index.js +19 -3
  16. package/dist/react/components/index.js.map +5 -4
  17. package/dist/react/index.js +37 -13
  18. package/dist/react/index.js.map +4 -4
  19. package/dist/react/server.js +33 -9
  20. package/dist/react/server.js.map +3 -3
  21. package/dist/src/build/chainInlineSourcemaps.d.ts +13 -0
  22. package/dist/src/build/externalAssetPlugin.d.ts +2 -0
  23. package/dist/src/core/devRouteRegistrationCallsite.d.ts +1 -0
  24. package/dist/src/core/prepare.d.ts +11 -2
  25. package/dist/src/dev/clientManager.d.ts +1 -0
  26. package/dist/src/dev/serverEntryWatcher.d.ts +1 -0
  27. package/dist/src/react/components/Head.d.ts +1 -1
  28. package/dist/src/utils/generateHeadElement.d.ts +1 -1
  29. package/dist/src/utils/jsonLd.d.ts +1 -0
  30. package/dist/svelte/index.js +37 -13
  31. package/dist/svelte/index.js.map +4 -4
  32. package/dist/svelte/server.js +37 -13
  33. package/dist/svelte/server.js.map +4 -4
  34. package/dist/types/globals.d.ts +1 -4
  35. package/dist/types/metadata.d.ts +2 -0
  36. package/dist/vue/index.js +37 -13
  37. package/dist/vue/index.js.map +5 -5
  38. package/dist/vue/server.js +33 -9
  39. package/dist/vue/server.js.map +4 -4
  40. package/package.json +17 -1
@@ -101,11 +101,22 @@ var init_constants = __esm(() => {
101
101
  var exports_devRouteRegistrationCallsite = {};
102
102
  __export(exports_devRouteRegistrationCallsite, {
103
103
  patchElysiaRouteRegistrationCallsites: () => patchElysiaRouteRegistrationCallsites,
104
+ isPageHandler: () => isPageHandler,
104
105
  getCurrentRouteRegistrationCallsite: () => getCurrentRouteRegistrationCallsite
105
106
  });
106
107
  import { AsyncLocalStorage } from "async_hooks";
107
108
  import { Elysia } from "elysia";
108
- var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES, isObjectRecord3 = (value) => Boolean(value) && typeof value === "object", isAsyncLocalStorage2 = (value) => isObjectRecord3(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", isRouteMethod = (value) => typeof value === "function", getRouteCallsiteStorage = () => {
109
+ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES, PAGE_HANDLER_NAMES, pageHandlerWrappers, handlerSourceMentionsPageHelper = (handler) => {
110
+ const source = handler.toString();
111
+ return PAGE_HANDLER_NAMES.some((name) => source.includes(name));
112
+ }, isPageHandler = (handler) => {
113
+ if (typeof handler !== "function")
114
+ return false;
115
+ const fn = handler;
116
+ if (pageHandlerWrappers.has(fn))
117
+ return true;
118
+ return handlerSourceMentionsPageHelper(fn);
119
+ }, isObjectRecord3 = (value) => Boolean(value) && typeof value === "object", isAsyncLocalStorage2 = (value) => isObjectRecord3(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", isRouteMethod = (value) => typeof value === "function", getRouteCallsiteStorage = () => {
109
120
  const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
110
121
  if (value === null || typeof value === "undefined") {
111
122
  return;
@@ -138,13 +149,13 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
138
149
  return function wrappedRouteHandler(...args) {
139
150
  return storage.run({ callsite }, () => Reflect.apply(routeHandler, this, args));
140
151
  };
141
- }, createPatchedRouteMethod = (originalMethod) => function patchedRouteMethod(path, handler, ...rest) {
152
+ }, createPatchedRouteMethod = (originalMethod, methodName) => function patchedRouteMethod(path, handler, ...rest) {
142
153
  const callsite = captureRouteRegistrationCallsite();
143
- return Reflect.apply(originalMethod, this, [
144
- path,
145
- wrapRouteHandlerWithCallsite(handler, callsite),
146
- ...rest
147
- ]);
154
+ const wrapped = wrapRouteHandlerWithCallsite(handler, callsite);
155
+ if (methodName === "get" && typeof handler === "function" && typeof wrapped === "function" && handlerSourceMentionsPageHelper(handler)) {
156
+ pageHandlerWrappers.add(wrapped);
157
+ }
158
+ return Reflect.apply(originalMethod, this, [path, wrapped, ...rest]);
148
159
  }, getCurrentRouteRegistrationCallsite = () => getRouteCallsiteStorage()?.getStore()?.callsite, patchElysiaRouteRegistrationCallsites = () => {
149
160
  if (false) {}
150
161
  if (Reflect.get(globalThis, ROUTE_CALLSITE_PATCHED_KEY) === true) {
@@ -155,7 +166,7 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
155
166
  const originalMethod = Reflect.get(prototype, methodName);
156
167
  if (!isRouteMethod(originalMethod))
157
168
  return;
158
- Reflect.set(prototype, methodName, createPatchedRouteMethod(originalMethod));
169
+ Reflect.set(prototype, methodName, createPatchedRouteMethod(originalMethod, methodName));
159
170
  });
160
171
  Reflect.set(globalThis, ROUTE_CALLSITE_PATCHED_KEY, true);
161
172
  };
@@ -172,6 +183,15 @@ var init_devRouteRegistrationCallsite = __esm(() => {
172
183
  "post",
173
184
  "put"
174
185
  ];
186
+ PAGE_HANDLER_NAMES = [
187
+ "handleReactPageRequest",
188
+ "handleSveltePageRequest",
189
+ "handleVuePageRequest",
190
+ "handleAngularPageRequest",
191
+ "handleHTMLPageRequest",
192
+ "handleHTMXPageRequest"
193
+ ];
194
+ pageHandlerWrappers = new WeakSet;
175
195
  });
176
196
 
177
197
  // src/client/streamSwap.ts
@@ -999,6 +1019,10 @@ var init_logger = __esm(() => {
999
1019
  });
1000
1020
 
1001
1021
  // src/utils/ssrErrorPage.ts
1022
+ var exports_ssrErrorPage = {};
1023
+ __export(exports_ssrErrorPage, {
1024
+ ssrErrorPage: () => ssrErrorPage
1025
+ });
1002
1026
  var ssrErrorPage = (framework, error) => {
1003
1027
  const frameworkColors2 = {
1004
1028
  angular: "#dd0031",
@@ -1958,5 +1982,5 @@ export {
1958
1982
  applyVueRouterRedirect
1959
1983
  };
1960
1984
 
1961
- //# debugId=8040708979ED9C0364756E2164756E21
1985
+ //# debugId=916EEAC181FE37EF64756E2164756E21
1962
1986
  //# sourceMappingURL=server.js.map