@absolutejs/absolute 0.19.0-beta.704 → 0.19.0-beta.706
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/browser.js +6 -4
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/index.js +71 -82
- package/dist/angular/index.js.map +10 -10
- package/dist/angular/server.js +70 -81
- package/dist/angular/server.js.map +10 -10
- package/dist/build.js +152 -84
- package/dist/build.js.map +15 -15
- package/dist/cli/index.js +330 -296
- package/dist/client/index.js +7 -4
- package/dist/client/index.js.map +3 -3
- package/dist/index.js +253 -153
- package/dist/index.js.map +24 -24
- package/dist/islands/index.js +9 -6
- package/dist/islands/index.js.map +5 -5
- package/dist/react/browser.js +7 -7
- package/dist/react/browser.js.map +2 -2
- package/dist/react/components/browser/index.js +101 -101
- package/dist/react/components/index.js +104 -104
- package/dist/react/components/index.js.map +2 -2
- package/dist/react/index.js +77 -88
- package/dist/react/index.js.map +10 -10
- package/dist/react/jsxDevRuntimeCompat.js +1 -6
- package/dist/react/jsxDevRuntimeCompat.js.map +3 -3
- package/dist/react/server.js +57 -71
- package/dist/react/server.js.map +8 -8
- package/dist/src/angular/components/defer-slot-templates.directive.d.ts +0 -7
- package/dist/src/angular/components/defer-slot.component.d.ts +2 -5
- package/dist/src/angular/components/image.component.d.ts +2 -5
- package/dist/src/angular/components/index.d.ts +4 -4
- package/dist/src/angular/components/stream-slot.component.d.ts +0 -3
- package/dist/src/angular/pageHandler.d.ts +6 -1
- package/dist/src/angular/ssrRender.d.ts +1 -1
- package/dist/src/build/buildAngularVendor.d.ts +3 -4
- package/dist/src/constants.d.ts +21 -0
- package/dist/src/core/ssrCache.d.ts +1 -1
- package/dist/src/core/wrapPageHandlerWithStreamingSlots.d.ts +1 -1
- package/dist/src/react/jsxDevRuntimeCompat.d.ts +3 -6
- package/dist/src/react/pageHandler.d.ts +2 -1
- package/dist/src/svelte/pageHandler.d.ts +2 -2
- package/dist/src/utils/defineConfig.d.ts +2 -2
- package/dist/src/utils/imageProcessing.d.ts +1 -1
- package/dist/src/utils/loadConfig.d.ts +38 -2
- package/dist/src/vue/components/Image.d.ts +3 -3
- package/dist/src/vue/components/index.d.ts +1 -1
- package/dist/src/vue/index.d.ts +1 -1
- package/dist/src/vue/pageHandler.d.ts +2 -1
- package/dist/svelte/index.js +52 -58
- package/dist/svelte/index.js.map +10 -10
- package/dist/svelte/server.js +46 -55
- package/dist/svelte/server.js.map +9 -9
- package/dist/vue/components/Image.js +18 -18
- package/dist/vue/components/Image.js.map +3 -3
- package/dist/vue/components/index.js +77 -62
- package/dist/vue/components/index.js.map +5 -5
- package/dist/vue/index.js +137 -142
- package/dist/vue/index.js.map +13 -13
- package/dist/vue/server.js +54 -77
- package/dist/vue/server.js.map +8 -8
- package/package.json +42 -42
- package/dist/angular/components/constants.js +0 -56
- package/dist/angular/components/core/streamingSlotRegistrar.js +0 -58
- package/dist/angular/components/core/streamingSlotRegistry.js +0 -114
- package/dist/angular/components/defer-slot-payload.js +0 -6
- package/dist/angular/components/defer-slot-templates.directive.js +0 -44
- package/dist/angular/components/defer-slot.component.js +0 -149
- package/dist/angular/components/image.component.js +0 -202
- package/dist/angular/components/index.js +0 -4
- package/dist/angular/components/stream-slot.component.js +0 -103
- package/dist/dev/client/constants.ts +0 -26
- package/dist/dev/client/cssUtils.ts +0 -307
- package/dist/dev/client/domDiff.ts +0 -226
- package/dist/dev/client/domState.ts +0 -421
- package/dist/dev/client/domTracker.ts +0 -61
- package/dist/dev/client/errorOverlay.ts +0 -184
- package/dist/dev/client/frameworkDetect.ts +0 -63
- package/dist/dev/client/handlers/angular.ts +0 -551
- package/dist/dev/client/handlers/angularRuntime.ts +0 -206
- package/dist/dev/client/handlers/html.ts +0 -363
- package/dist/dev/client/handlers/htmx.ts +0 -272
- package/dist/dev/client/handlers/react.ts +0 -108
- package/dist/dev/client/handlers/rebuild.ts +0 -153
- package/dist/dev/client/handlers/svelte.ts +0 -332
- package/dist/dev/client/handlers/vue.ts +0 -292
- package/dist/dev/client/headPatch.ts +0 -233
- package/dist/dev/client/hmrClient.ts +0 -251
- package/dist/dev/client/hmrState.ts +0 -14
- package/dist/dev/client/moduleVersions.ts +0 -62
- package/dist/dev/client/reactRefreshSetup.ts +0 -33
- package/dist/src/angular/components/constants.d.ts +0 -53
- package/dist/svelte/components/AwaitSlot.svelte +0 -39
- package/dist/svelte/components/AwaitSlot.svelte.d.ts +0 -2
- package/dist/svelte/components/Head.svelte +0 -144
- package/dist/svelte/components/Head.svelte.d.ts +0 -2
- package/dist/svelte/components/Image.svelte +0 -164
- package/dist/svelte/components/Image.svelte.d.ts +0 -5
- package/dist/svelte/components/Island.svelte +0 -71
- package/dist/svelte/components/Island.svelte.d.ts +0 -5
- package/dist/svelte/components/JsonLd.svelte +0 -21
- package/dist/svelte/components/JsonLd.svelte.d.ts +0 -2
- package/dist/svelte/components/StreamSlot.svelte +0 -41
- package/dist/svelte/components/StreamSlot.svelte.d.ts +0 -2
- package/dist/types/globals.d.ts +0 -121
|
@@ -81,15 +81,10 @@ var __require = import.meta.require;
|
|
|
81
81
|
// src/react/jsxDevRuntimeCompat.ts
|
|
82
82
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
83
83
|
var jsxDEV = (type, props, key, _isStaticChildren, _source, _self) => Array.isArray(props?.children) ? jsxs(type, props, key) : jsx(type, props, key);
|
|
84
|
-
var jsxDevRuntimeCompat_default = {
|
|
85
|
-
Fragment,
|
|
86
|
-
jsxDEV
|
|
87
|
-
};
|
|
88
84
|
export {
|
|
89
85
|
jsxDEV,
|
|
90
|
-
jsxDevRuntimeCompat_default as default,
|
|
91
86
|
Fragment
|
|
92
87
|
};
|
|
93
88
|
|
|
94
|
-
//# debugId=
|
|
89
|
+
//# debugId=D6695015FE3A1E9264756E2164756E21
|
|
95
90
|
//# sourceMappingURL=jsxDevRuntimeCompat.js.map
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/react/jsxDevRuntimeCompat.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { Fragment, jsx, jsxs } from 'react/jsx-runtime';\n\ntype JSXType = Parameters<typeof jsx>[0];\ntype JSXKey = Parameters<typeof jsx>[2];\ntype JSXProps =
|
|
5
|
+
"import { Fragment, jsx, jsxs } from 'react/jsx-runtime';\n\ntype JSXType = Parameters<typeof jsx>[0];\ntype JSXKey = Parameters<typeof jsx>[2];\ntype JSXProps = Parameters<typeof jsx>[1] & {\n\tchildren?: unknown;\n};\n\nexport { Fragment };\n\nexport const jsxDEV = (\n\ttype: JSXType,\n\tprops: JSXProps,\n\tkey?: JSXKey,\n\t_isStaticChildren?: boolean,\n\t_source?: unknown,\n\t_self?: unknown\n) =>\n\tArray.isArray(props?.children)\n\t\t? jsxs(type, props, key)\n\t\t: jsx(type, props, key);\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAUO,IAAM,SAAS,CACrB,MACA,OACA,KACA,mBACA,SACA,UAEA,MAAM,QAAQ,OAAO,QAAQ,IAC1B,KAAK,MAAM,OAAO,GAAG,IACrB,IAAI,MAAM,OAAO,GAAG;",
|
|
8
|
+
"debugId": "D6695015FE3A1E9264756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/dist/react/server.js
CHANGED
|
@@ -79,7 +79,7 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
|
79
79
|
var __require = import.meta.require;
|
|
80
80
|
|
|
81
81
|
// src/constants.ts
|
|
82
|
-
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000;
|
|
82
|
+
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
|
|
83
83
|
var init_constants = __esm(() => {
|
|
84
84
|
MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
|
|
85
85
|
MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
|
|
@@ -94,7 +94,7 @@ __export(exports_devRouteRegistrationCallsite, {
|
|
|
94
94
|
});
|
|
95
95
|
import { AsyncLocalStorage } from "async_hooks";
|
|
96
96
|
import { Elysia } from "elysia";
|
|
97
|
-
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", getRouteCallsiteStorage = () => {
|
|
97
|
+
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 = () => {
|
|
98
98
|
const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
|
|
99
99
|
if (value === null || typeof value === "undefined") {
|
|
100
100
|
return;
|
|
@@ -108,19 +108,10 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
|
|
|
108
108
|
const storage = new AsyncLocalStorage;
|
|
109
109
|
Reflect.set(globalThis, ROUTE_CALLSITE_STORAGE_KEY, storage);
|
|
110
110
|
return storage;
|
|
111
|
-
}, normalizeCallsitePath = (value) => value.replace(`${process.cwd()}/`, "").replace(process.cwd(), "").replace(/^\.\/+/, ""), extractRouteRegistrationCallsite = (stack) => {
|
|
112
|
-
const
|
|
113
|
-
`).slice(1).map((line) => line.trim());
|
|
114
|
-
|
|
115
|
-
if (frame.includes("/node_modules/") || frame.includes("/dist/") || frame.includes("/src/core/devRouteRegistrationCallsite.")) {
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
const locationMatch = frame.match(/\((\/[^)]+:\d+:\d+)\)$/) ?? frame.match(/at (\/[^ ]+:\d+:\d+)$/);
|
|
119
|
-
if (locationMatch?.[1]) {
|
|
120
|
-
return normalizeCallsitePath(locationMatch[1]);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return;
|
|
111
|
+
}, normalizeCallsitePath = (value) => value.replace(`${process.cwd()}/`, "").replace(process.cwd(), "").replace(/^\.\/+/, ""), shouldIgnoreRouteCallsiteFrame = (frame) => frame.includes("/node_modules/") || frame.includes("/dist/") || frame.includes("/src/core/devRouteRegistrationCallsite."), getRouteCallsiteLocation = (frame) => frame.match(/\((\/[^)]+:\d+:\d+)\)$/)?.[1] ?? frame.match(/at (\/[^ ]+:\d+:\d+)$/)?.[1], extractRouteRegistrationCallsite = (stack) => {
|
|
112
|
+
const location = stack.split(`
|
|
113
|
+
`).slice(1).map((line) => line.trim()).filter((frame) => !shouldIgnoreRouteCallsiteFrame(frame)).map((frame) => getRouteCallsiteLocation(frame)).find((frameLocation) => frameLocation !== undefined);
|
|
114
|
+
return location ? normalizeCallsitePath(location) : undefined;
|
|
124
115
|
}, captureRouteRegistrationCallsite = () => {
|
|
125
116
|
const { stack } = new Error;
|
|
126
117
|
if (!stack) {
|
|
@@ -132,29 +123,29 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
|
|
|
132
123
|
return handler;
|
|
133
124
|
}
|
|
134
125
|
const storage = ensureRouteCallsiteStorage();
|
|
126
|
+
const routeHandler = handler;
|
|
135
127
|
return function wrappedRouteHandler(...args) {
|
|
136
|
-
return storage.run({ callsite }, () => Reflect.apply(
|
|
128
|
+
return storage.run({ callsite }, () => Reflect.apply(routeHandler, this, args));
|
|
137
129
|
};
|
|
130
|
+
}, createPatchedRouteMethod = (originalMethod) => function patchedRouteMethod(path, handler, ...rest) {
|
|
131
|
+
const callsite = captureRouteRegistrationCallsite();
|
|
132
|
+
return Reflect.apply(originalMethod, this, [
|
|
133
|
+
path,
|
|
134
|
+
wrapRouteHandlerWithCallsite(handler, callsite),
|
|
135
|
+
...rest
|
|
136
|
+
]);
|
|
138
137
|
}, getCurrentRouteRegistrationCallsite = () => getRouteCallsiteStorage()?.getStore()?.callsite, patchElysiaRouteRegistrationCallsites = () => {
|
|
139
138
|
if (false) {}
|
|
140
139
|
if (Reflect.get(globalThis, ROUTE_CALLSITE_PATCHED_KEY) === true) {
|
|
141
140
|
return;
|
|
142
141
|
}
|
|
143
|
-
const prototype = Elysia
|
|
144
|
-
|
|
145
|
-
const originalMethod = prototype
|
|
146
|
-
if (
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const callsite = captureRouteRegistrationCallsite();
|
|
151
|
-
return Reflect.apply(originalMethod, this, [
|
|
152
|
-
path,
|
|
153
|
-
wrapRouteHandlerWithCallsite(handler, callsite),
|
|
154
|
-
...rest
|
|
155
|
-
]);
|
|
156
|
-
};
|
|
157
|
-
}
|
|
142
|
+
const { prototype } = Elysia;
|
|
143
|
+
ROUTE_METHOD_NAMES.forEach((methodName) => {
|
|
144
|
+
const originalMethod = Reflect.get(prototype, methodName);
|
|
145
|
+
if (!isRouteMethod(originalMethod))
|
|
146
|
+
return;
|
|
147
|
+
Reflect.set(prototype, methodName, createPatchedRouteMethod(originalMethod));
|
|
148
|
+
});
|
|
158
149
|
Reflect.set(globalThis, ROUTE_CALLSITE_PATCHED_KEY, true);
|
|
159
150
|
};
|
|
160
151
|
var init_devRouteRegistrationCallsite = __esm(() => {
|
|
@@ -991,9 +982,9 @@ var init_logger = __esm(() => {
|
|
|
991
982
|
});
|
|
992
983
|
|
|
993
984
|
// src/core/ssrCache.ts
|
|
994
|
-
var dirtyFrameworks, markSsrCacheDirty = (framework) => {
|
|
985
|
+
var dirtyFrameworks, isSsrCacheDirty = (framework) => dirtyFrameworks.has(framework), markSsrCacheDirty = (framework) => {
|
|
995
986
|
dirtyFrameworks.add(framework);
|
|
996
|
-
}
|
|
987
|
+
};
|
|
997
988
|
var init_ssrCache = __esm(() => {
|
|
998
989
|
dirtyFrameworks = new Set;
|
|
999
990
|
});
|
|
@@ -1408,19 +1399,12 @@ var formatWarningCallsite = (callsite) => {
|
|
|
1408
1399
|
}
|
|
1409
1400
|
return `\x1B[36m${match[1]}\x1B[33m${match[2]}\x1B[0m`;
|
|
1410
1401
|
};
|
|
1402
|
+
var shouldIgnoreWarningFrame = (frame) => frame.includes("/node_modules/") || frame.includes("/dist/") || frame.includes("/src/react/pageHandler.") || frame.includes("/src/vue/pageHandler.") || frame.includes("/src/svelte/pageHandler.") || frame.includes("/src/angular/pageHandler.") || frame.includes("/src/core/streamingSlotWarningScope.");
|
|
1403
|
+
var getWarningLocation = (frame) => frame.match(/\((\/[^)]+:\d+:\d+)\)$/)?.[1] ?? frame.match(/at (\/[^ ]+:\d+:\d+)$/)?.[1];
|
|
1411
1404
|
var extractCallsiteFromStack = (stack) => {
|
|
1412
|
-
const
|
|
1413
|
-
`).slice(1).map((line) => line.trim());
|
|
1414
|
-
|
|
1415
|
-
if (frame.includes("/node_modules/") || frame.includes("/dist/") || frame.includes("/src/react/pageHandler.") || frame.includes("/src/vue/pageHandler.") || frame.includes("/src/svelte/pageHandler.") || frame.includes("/src/angular/pageHandler.") || frame.includes("/src/core/streamingSlotWarningScope.")) {
|
|
1416
|
-
continue;
|
|
1417
|
-
}
|
|
1418
|
-
const locationMatch = frame.match(/\((\/[^)]+:\d+:\d+)\)$/) ?? frame.match(/at (\/[^ ]+:\d+:\d+)$/);
|
|
1419
|
-
if (locationMatch?.[1]) {
|
|
1420
|
-
return normalizeCallsitePath2(locationMatch[1]);
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
return;
|
|
1405
|
+
const location = stack.split(`
|
|
1406
|
+
`).slice(1).map((line) => line.trim()).filter((frame) => !shouldIgnoreWarningFrame(frame)).map((frame) => getWarningLocation(frame)).find((frameLocation) => frameLocation !== undefined);
|
|
1407
|
+
return location ? normalizeCallsitePath2(location) : undefined;
|
|
1424
1408
|
};
|
|
1425
1409
|
var buildMissingCollectorWarning = (primitiveName, handlerCallsite) => `${primitiveName} rendered during SSR without streaming slot collection enabled. Add { collectStreamingSlots: true } to this page handler to enable out-of-order streaming for this route.${handlerCallsite ? ` Update ${formatWarningCallsite(handlerCallsite)}.` : ""}`;
|
|
1426
1410
|
setStreamingSlotWarningController({
|
|
@@ -1525,7 +1509,7 @@ var resolveNotFoundConventionPath = (framework) => getMap()[framework]?.defaults
|
|
|
1525
1509
|
var setConventions = (map) => {
|
|
1526
1510
|
Reflect.set(globalThis, CONVENTIONS_KEY, map);
|
|
1527
1511
|
};
|
|
1528
|
-
var isDev = () =>
|
|
1512
|
+
var isDev = () => false;
|
|
1529
1513
|
var buildErrorProps = (error) => {
|
|
1530
1514
|
const message = error instanceof Error ? error.message : String(error);
|
|
1531
1515
|
const stack = isDev() && error instanceof Error ? error.stack : undefined;
|
|
@@ -1699,17 +1683,27 @@ var NOT_FOUND_PRIORITY = [
|
|
|
1699
1683
|
"angular"
|
|
1700
1684
|
];
|
|
1701
1685
|
var renderFirstNotFound = async () => {
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1686
|
+
const renderNext = async (frameworks) => {
|
|
1687
|
+
const [framework, ...remaining] = frameworks;
|
|
1688
|
+
if (!framework) {
|
|
1689
|
+
return null;
|
|
1690
|
+
}
|
|
1691
|
+
if (!getMap()[framework]?.defaults?.notFound) {
|
|
1692
|
+
return renderNext(remaining);
|
|
1693
|
+
}
|
|
1705
1694
|
const response = await renderConventionNotFound(framework);
|
|
1706
|
-
if (response)
|
|
1695
|
+
if (response) {
|
|
1707
1696
|
return response;
|
|
1708
|
-
|
|
1709
|
-
|
|
1697
|
+
}
|
|
1698
|
+
return renderNext(remaining);
|
|
1699
|
+
};
|
|
1700
|
+
return renderNext(NOT_FOUND_PRIORITY);
|
|
1710
1701
|
};
|
|
1711
1702
|
|
|
1712
1703
|
// src/react/pageHandler.ts
|
|
1704
|
+
var isRecord2 = (value) => typeof value === "object" && value !== null;
|
|
1705
|
+
var isReactComponent = (value) => typeof value === "function";
|
|
1706
|
+
var isReactPageRequestInput = (value) => isRecord2(value) && isReactComponent(value.Page) && typeof value.index === "string";
|
|
1713
1707
|
var buildRefreshSetup = () => {
|
|
1714
1708
|
if (false) {}
|
|
1715
1709
|
return "window.__REFRESH_BUFFER__=[];" + "window.$RefreshReg$=function(t,i){window.__REFRESH_BUFFER__.push([t,i])};" + "window.$RefreshSig$=function(){return function(t){return t}};";
|
|
@@ -1724,23 +1718,15 @@ var buildDirtyResponse = (index, maybeProps) => {
|
|
|
1724
1718
|
headers: { "Content-Type": "text/html" }
|
|
1725
1719
|
});
|
|
1726
1720
|
};
|
|
1727
|
-
|
|
1728
|
-
const
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
Page: PageComponentOrInput.Page,
|
|
1737
|
-
props: PageComponentOrInput.props
|
|
1738
|
-
} : {
|
|
1739
|
-
index: index ?? "",
|
|
1740
|
-
options: args[1],
|
|
1741
|
-
Page: PageComponentOrInput,
|
|
1742
|
-
props: args[0]
|
|
1743
|
-
};
|
|
1721
|
+
async function handleReactPageRequest(PageComponentOrInput, index, ...args) {
|
|
1722
|
+
const isInput = isReactPageRequestInput(PageComponentOrInput);
|
|
1723
|
+
const Page = isInput ? PageComponentOrInput.Page : PageComponentOrInput;
|
|
1724
|
+
const resolvedIndex = isInput ? PageComponentOrInput.index : index ?? "";
|
|
1725
|
+
const options = isInput ? PageComponentOrInput : args[1];
|
|
1726
|
+
const maybeProps = isInput ? PageComponentOrInput.props : args[0];
|
|
1727
|
+
if (!isReactComponent(Page)) {
|
|
1728
|
+
throw new Error("React page handler requires a React component.");
|
|
1729
|
+
}
|
|
1744
1730
|
if (isSsrCacheDirty("react")) {
|
|
1745
1731
|
return buildDirtyResponse(resolvedIndex, maybeProps);
|
|
1746
1732
|
}
|
|
@@ -1776,10 +1762,10 @@ var handleReactPageRequest = async (PageComponentOrInput, index, ...args) => {
|
|
|
1776
1762
|
status: 500
|
|
1777
1763
|
});
|
|
1778
1764
|
}
|
|
1779
|
-
}
|
|
1765
|
+
}
|
|
1780
1766
|
export {
|
|
1781
1767
|
handleReactPageRequest
|
|
1782
1768
|
};
|
|
1783
1769
|
|
|
1784
|
-
//# debugId=
|
|
1770
|
+
//# debugId=D17168FEDFA551DF64756E2164756E21
|
|
1785
1771
|
//# sourceMappingURL=server.js.map
|