@absolutejs/absolute 0.19.0-beta.951 → 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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-Al0dFI/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-9YK6MU/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-Al0dFI/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-9YK6MU/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-Al0dFI/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-9YK6MU/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
@@ -2052,11 +2052,22 @@ var init_renderIslandMarkup = __esm(() => {
2052
2052
  var exports_devRouteRegistrationCallsite = {};
2053
2053
  __export(exports_devRouteRegistrationCallsite, {
2054
2054
  patchElysiaRouteRegistrationCallsites: () => patchElysiaRouteRegistrationCallsites,
2055
+ isPageHandler: () => isPageHandler,
2055
2056
  getCurrentRouteRegistrationCallsite: () => getCurrentRouteRegistrationCallsite
2056
2057
  });
2057
2058
  import { AsyncLocalStorage } from "async_hooks";
2058
2059
  import { Elysia } from "elysia";
2059
- 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 = () => {
2060
+ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES, PAGE_HANDLER_NAMES, pageHandlerWrappers, handlerSourceMentionsPageHelper = (handler) => {
2061
+ const source = handler.toString();
2062
+ return PAGE_HANDLER_NAMES.some((name) => source.includes(name));
2063
+ }, isPageHandler = (handler) => {
2064
+ if (typeof handler !== "function")
2065
+ return false;
2066
+ const fn = handler;
2067
+ if (pageHandlerWrappers.has(fn))
2068
+ return true;
2069
+ return handlerSourceMentionsPageHelper(fn);
2070
+ }, 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 = () => {
2060
2071
  const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
2061
2072
  if (value === null || typeof value === "undefined") {
2062
2073
  return;
@@ -2089,13 +2100,13 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
2089
2100
  return function wrappedRouteHandler(...args) {
2090
2101
  return storage.run({ callsite }, () => Reflect.apply(routeHandler, this, args));
2091
2102
  };
2092
- }, createPatchedRouteMethod = (originalMethod) => function patchedRouteMethod(path, handler, ...rest) {
2103
+ }, createPatchedRouteMethod = (originalMethod, methodName) => function patchedRouteMethod(path, handler, ...rest) {
2093
2104
  const callsite = captureRouteRegistrationCallsite();
2094
- return Reflect.apply(originalMethod, this, [
2095
- path,
2096
- wrapRouteHandlerWithCallsite(handler, callsite),
2097
- ...rest
2098
- ]);
2105
+ const wrapped = wrapRouteHandlerWithCallsite(handler, callsite);
2106
+ if (methodName === "get" && typeof handler === "function" && typeof wrapped === "function" && handlerSourceMentionsPageHelper(handler)) {
2107
+ pageHandlerWrappers.add(wrapped);
2108
+ }
2109
+ return Reflect.apply(originalMethod, this, [path, wrapped, ...rest]);
2099
2110
  }, getCurrentRouteRegistrationCallsite = () => getRouteCallsiteStorage()?.getStore()?.callsite, patchElysiaRouteRegistrationCallsites = () => {
2100
2111
  if (false) {}
2101
2112
  if (Reflect.get(globalThis, ROUTE_CALLSITE_PATCHED_KEY) === true) {
@@ -2106,7 +2117,7 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
2106
2117
  const originalMethod = Reflect.get(prototype, methodName);
2107
2118
  if (!isRouteMethod(originalMethod))
2108
2119
  return;
2109
- Reflect.set(prototype, methodName, createPatchedRouteMethod(originalMethod));
2120
+ Reflect.set(prototype, methodName, createPatchedRouteMethod(originalMethod, methodName));
2110
2121
  });
2111
2122
  Reflect.set(globalThis, ROUTE_CALLSITE_PATCHED_KEY, true);
2112
2123
  };
@@ -2123,6 +2134,15 @@ var init_devRouteRegistrationCallsite = __esm(() => {
2123
2134
  "post",
2124
2135
  "put"
2125
2136
  ];
2137
+ PAGE_HANDLER_NAMES = [
2138
+ "handleReactPageRequest",
2139
+ "handleSveltePageRequest",
2140
+ "handleVuePageRequest",
2141
+ "handleAngularPageRequest",
2142
+ "handleHTMLPageRequest",
2143
+ "handleHTMXPageRequest"
2144
+ ];
2145
+ pageHandlerWrappers = new WeakSet;
2126
2146
  });
2127
2147
 
2128
2148
  // src/client/streamSwap.ts
@@ -15242,5 +15262,5 @@ export {
15242
15262
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
15243
15263
  };
15244
15264
 
15245
- //# debugId=16411C8C7A929C5D64756E2164756E21
15265
+ //# debugId=14963FAB09D6237364756E2164756E21
15246
15266
  //# sourceMappingURL=index.js.map