@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.
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +29 -9
- package/dist/angular/index.js.map +3 -3
- package/dist/angular/server.js +29 -9
- package/dist/angular/server.js.map +3 -3
- package/dist/index.js +30 -22
- package/dist/index.js.map +4 -4
- package/dist/react/index.js +29 -9
- package/dist/react/index.js.map +3 -3
- package/dist/react/server.js +29 -9
- package/dist/react/server.js.map +3 -3
- package/dist/src/core/devRouteRegistrationCallsite.d.ts +1 -0
- package/dist/svelte/index.js +29 -9
- package/dist/svelte/index.js.map +3 -3
- package/dist/svelte/server.js +29 -9
- package/dist/svelte/server.js.map +3 -3
- package/dist/vue/index.js +29 -9
- package/dist/vue/index.js.map +3 -3
- package/dist/vue/server.js +29 -9
- package/dist/vue/server.js.map +3 -3
- package/package.json +1 -1
package/dist/svelte/server.js
CHANGED
|
@@ -1066,11 +1066,22 @@ var init_svelteServerModule = __esm(() => {
|
|
|
1066
1066
|
var exports_devRouteRegistrationCallsite = {};
|
|
1067
1067
|
__export(exports_devRouteRegistrationCallsite, {
|
|
1068
1068
|
patchElysiaRouteRegistrationCallsites: () => patchElysiaRouteRegistrationCallsites,
|
|
1069
|
+
isPageHandler: () => isPageHandler,
|
|
1069
1070
|
getCurrentRouteRegistrationCallsite: () => getCurrentRouteRegistrationCallsite
|
|
1070
1071
|
});
|
|
1071
1072
|
import { AsyncLocalStorage } from "async_hooks";
|
|
1072
1073
|
import { Elysia } from "elysia";
|
|
1073
|
-
var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
|
|
1074
|
+
var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES, PAGE_HANDLER_NAMES, pageHandlerWrappers, handlerSourceMentionsPageHelper = (handler) => {
|
|
1075
|
+
const source = handler.toString();
|
|
1076
|
+
return PAGE_HANDLER_NAMES.some((name) => source.includes(name));
|
|
1077
|
+
}, isPageHandler = (handler) => {
|
|
1078
|
+
if (typeof handler !== "function")
|
|
1079
|
+
return false;
|
|
1080
|
+
const fn = handler;
|
|
1081
|
+
if (pageHandlerWrappers.has(fn))
|
|
1082
|
+
return true;
|
|
1083
|
+
return handlerSourceMentionsPageHelper(fn);
|
|
1084
|
+
}, 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 = () => {
|
|
1074
1085
|
const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
|
|
1075
1086
|
if (value === null || typeof value === "undefined") {
|
|
1076
1087
|
return;
|
|
@@ -1103,13 +1114,13 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
|
|
|
1103
1114
|
return function wrappedRouteHandler(...args) {
|
|
1104
1115
|
return storage.run({ callsite }, () => Reflect.apply(routeHandler, this, args));
|
|
1105
1116
|
};
|
|
1106
|
-
}, createPatchedRouteMethod = (originalMethod) => function patchedRouteMethod(path, handler, ...rest) {
|
|
1117
|
+
}, createPatchedRouteMethod = (originalMethod, methodName) => function patchedRouteMethod(path, handler, ...rest) {
|
|
1107
1118
|
const callsite = captureRouteRegistrationCallsite();
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
]);
|
|
1119
|
+
const wrapped = wrapRouteHandlerWithCallsite(handler, callsite);
|
|
1120
|
+
if (methodName === "get" && typeof handler === "function" && typeof wrapped === "function" && handlerSourceMentionsPageHelper(handler)) {
|
|
1121
|
+
pageHandlerWrappers.add(wrapped);
|
|
1122
|
+
}
|
|
1123
|
+
return Reflect.apply(originalMethod, this, [path, wrapped, ...rest]);
|
|
1113
1124
|
}, getCurrentRouteRegistrationCallsite = () => getRouteCallsiteStorage()?.getStore()?.callsite, patchElysiaRouteRegistrationCallsites = () => {
|
|
1114
1125
|
if (false) {}
|
|
1115
1126
|
if (Reflect.get(globalThis, ROUTE_CALLSITE_PATCHED_KEY) === true) {
|
|
@@ -1120,7 +1131,7 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
|
|
|
1120
1131
|
const originalMethod = Reflect.get(prototype, methodName);
|
|
1121
1132
|
if (!isRouteMethod(originalMethod))
|
|
1122
1133
|
return;
|
|
1123
|
-
Reflect.set(prototype, methodName, createPatchedRouteMethod(originalMethod));
|
|
1134
|
+
Reflect.set(prototype, methodName, createPatchedRouteMethod(originalMethod, methodName));
|
|
1124
1135
|
});
|
|
1125
1136
|
Reflect.set(globalThis, ROUTE_CALLSITE_PATCHED_KEY, true);
|
|
1126
1137
|
};
|
|
@@ -1137,6 +1148,15 @@ var init_devRouteRegistrationCallsite = __esm(() => {
|
|
|
1137
1148
|
"post",
|
|
1138
1149
|
"put"
|
|
1139
1150
|
];
|
|
1151
|
+
PAGE_HANDLER_NAMES = [
|
|
1152
|
+
"handleReactPageRequest",
|
|
1153
|
+
"handleSveltePageRequest",
|
|
1154
|
+
"handleVuePageRequest",
|
|
1155
|
+
"handleAngularPageRequest",
|
|
1156
|
+
"handleHTMLPageRequest",
|
|
1157
|
+
"handleHTMXPageRequest"
|
|
1158
|
+
];
|
|
1159
|
+
pageHandlerWrappers = new WeakSet;
|
|
1140
1160
|
});
|
|
1141
1161
|
|
|
1142
1162
|
// src/client/streamSwap.ts
|
|
@@ -2925,5 +2945,5 @@ export {
|
|
|
2925
2945
|
handleSveltePageRequest
|
|
2926
2946
|
};
|
|
2927
2947
|
|
|
2928
|
-
//# debugId=
|
|
2948
|
+
//# debugId=01E383F10C97E15164756E2164756E21
|
|
2929
2949
|
//# sourceMappingURL=server.js.map
|