@absolutejs/absolute 0.19.0-beta.704 → 0.19.0-beta.705

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 (48) hide show
  1. package/dist/angular/components/constants.js +21 -0
  2. package/dist/angular/index.js +53 -73
  3. package/dist/angular/index.js.map +9 -9
  4. package/dist/angular/server.js +52 -72
  5. package/dist/angular/server.js.map +9 -9
  6. package/dist/build.js +8 -7
  7. package/dist/build.js.map +7 -7
  8. package/dist/cli/index.js +312 -285
  9. package/dist/client/index.js +4 -3
  10. package/dist/client/index.js.map +3 -3
  11. package/dist/index.js +88 -64
  12. package/dist/index.js.map +15 -15
  13. package/dist/islands/index.js +5 -4
  14. package/dist/islands/index.js.map +5 -5
  15. package/dist/react/index.js +49 -69
  16. package/dist/react/index.js.map +9 -9
  17. package/dist/react/jsxDevRuntimeCompat.js +1 -6
  18. package/dist/react/jsxDevRuntimeCompat.js.map +3 -3
  19. package/dist/react/server.js +43 -64
  20. package/dist/react/server.js.map +7 -7
  21. package/dist/src/angular/components/constants.d.ts +21 -0
  22. package/dist/src/angular/pageHandler.d.ts +6 -1
  23. package/dist/src/angular/ssrRender.d.ts +1 -1
  24. package/dist/src/constants.d.ts +21 -0
  25. package/dist/src/core/ssrCache.d.ts +1 -1
  26. package/dist/src/core/wrapPageHandlerWithStreamingSlots.d.ts +1 -1
  27. package/dist/src/react/jsxDevRuntimeCompat.d.ts +3 -6
  28. package/dist/src/react/pageHandler.d.ts +2 -1
  29. package/dist/src/svelte/pageHandler.d.ts +2 -2
  30. package/dist/src/utils/defineConfig.d.ts +2 -2
  31. package/dist/src/utils/loadConfig.d.ts +38 -2
  32. package/dist/src/vue/components/Image.d.ts +2 -2
  33. package/dist/src/vue/components/index.d.ts +1 -1
  34. package/dist/src/vue/index.d.ts +1 -1
  35. package/dist/src/vue/pageHandler.d.ts +2 -1
  36. package/dist/svelte/index.js +34 -49
  37. package/dist/svelte/index.js.map +9 -9
  38. package/dist/svelte/server.js +31 -47
  39. package/dist/svelte/server.js.map +8 -8
  40. package/dist/vue/components/Image.js +18 -18
  41. package/dist/vue/components/Image.js.map +3 -3
  42. package/dist/vue/components/index.js +77 -62
  43. package/dist/vue/components/index.js.map +5 -5
  44. package/dist/vue/index.js +119 -133
  45. package/dist/vue/index.js.map +12 -12
  46. package/dist/vue/server.js +40 -70
  47. package/dist/vue/server.js.map +7 -7
  48. package/package.json +42 -42
@@ -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 frames = stack.split(`
113
- `).slice(1).map((line) => line.trim());
114
- for (const frame of frames) {
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(handler, this, args));
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.prototype;
144
- for (const methodName of ROUTE_METHOD_NAMES) {
145
- const originalMethod = prototype[methodName];
146
- if (typeof originalMethod !== "function") {
147
- continue;
148
- }
149
- prototype[methodName] = function patchedRouteMethod(path, handler, ...rest) {
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
- }, isSsrCacheDirty = (framework) => dirtyFrameworks.has(framework);
987
+ };
997
988
  var init_ssrCache = __esm(() => {
998
989
  dirtyFrameworks = new Set;
999
990
  });
@@ -1043,14 +1034,14 @@ var defineIslandComponent = (component, options) => ({
1043
1034
  component,
1044
1035
  export: options.export,
1045
1036
  source: options.source
1046
- }), defineIslandRegistry = (registry) => registry, isRecord2 = (value) => typeof value === "object" && value !== null, getIslandBuildReference = (component) => {
1037
+ }), defineIslandRegistry = (registry) => registry, isRecord3 = (value) => typeof value === "object" && value !== null, getIslandBuildReference = (component) => {
1047
1038
  if (!isIslandComponentDefinition(component))
1048
1039
  return null;
1049
1040
  return {
1050
1041
  export: component.export,
1051
1042
  source: component.source
1052
1043
  };
1053
- }, isIslandComponentDefinition = (value) => isRecord2(value) && ("component" in value) && ("source" in value) && typeof value.source === "string", parseIslandProps = (rawProps) => {
1044
+ }, isIslandComponentDefinition = (value) => isRecord3(value) && ("component" in value) && ("source" in value) && typeof value.source === "string", parseIslandProps = (rawProps) => {
1054
1045
  if (!rawProps)
1055
1046
  return {};
1056
1047
  return JSON.parse(rawProps);
@@ -1335,7 +1326,7 @@ var routePropsCache, cacheRouteData = (pagePath, data) => {
1335
1326
  Sanitizer: core.Sanitizer,
1336
1327
  SecurityContext: core.SecurityContext
1337
1328
  };
1338
- }, buildProviders = (deps, sanitizer, maybeProps, tokenMap) => {
1329
+ }, buildProviders = (deps, sanitizer, maybeProps, tokenMap, userProviders = []) => {
1339
1330
  const providers = [
1340
1331
  deps.provideServerRendering(),
1341
1332
  deps.provideClientHydration(),
@@ -1345,7 +1336,8 @@ var routePropsCache, cacheRouteData = (pagePath, data) => {
1345
1336
  provide: deps.DomSanitizer,
1346
1337
  useValue: sanitizer
1347
1338
  },
1348
- { provide: deps.Sanitizer, useValue: sanitizer }
1339
+ { provide: deps.Sanitizer, useValue: sanitizer },
1340
+ ...userProviders
1349
1341
  ];
1350
1342
  if (!maybeProps) {
1351
1343
  return providers;
@@ -2426,7 +2418,7 @@ var init_svelteServerModule = __esm(() => {
2426
2418
  var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, nextIslandId = () => {
2427
2419
  islandSequence += 1;
2428
2420
  return `island-${islandSequence}`;
2429
- }, isRecord3 = (value) => typeof value === "object" && value !== null, isReactServerIslandComponent = (value) => typeof value === "function", isSvelteServerIslandComponent = (value) => typeof value === "function", isVueServerIslandComponent = (value) => typeof value === "function" || isRecord3(value), isAngularServerIslandComponent = (value) => typeof value === "function", resolveBuildReferencePath = (source, registryPath) => {
2421
+ }, isRecord4 = (value) => typeof value === "object" && value !== null, isReactServerIslandComponent = (value) => typeof value === "function", isSvelteServerIslandComponent = (value) => typeof value === "function", isVueServerIslandComponent = (value) => typeof value === "function" || isRecord4(value), isAngularServerIslandComponent = (value) => typeof value === "function", resolveBuildReferencePath = (source, registryPath) => {
2430
2422
  if (source.startsWith("file://"))
2431
2423
  return new URL(source).pathname;
2432
2424
  if (source.startsWith("."))
@@ -2958,19 +2950,12 @@ var formatWarningCallsite = (callsite) => {
2958
2950
  }
2959
2951
  return `\x1B[36m${match[1]}\x1B[33m${match[2]}\x1B[0m`;
2960
2952
  };
2953
+ 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.");
2954
+ var getWarningLocation = (frame) => frame.match(/\((\/[^)]+:\d+:\d+)\)$/)?.[1] ?? frame.match(/at (\/[^ ]+:\d+:\d+)$/)?.[1];
2961
2955
  var extractCallsiteFromStack = (stack) => {
2962
- const frames = stack.split(`
2963
- `).slice(1).map((line) => line.trim());
2964
- for (const frame of frames) {
2965
- 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.")) {
2966
- continue;
2967
- }
2968
- const locationMatch = frame.match(/\((\/[^)]+:\d+:\d+)\)$/) ?? frame.match(/at (\/[^ ]+:\d+:\d+)$/);
2969
- if (locationMatch?.[1]) {
2970
- return normalizeCallsitePath2(locationMatch[1]);
2971
- }
2972
- }
2973
- return;
2956
+ const location = stack.split(`
2957
+ `).slice(1).map((line) => line.trim()).filter((frame) => !shouldIgnoreWarningFrame(frame)).map((frame) => getWarningLocation(frame)).find((frameLocation) => frameLocation !== undefined);
2958
+ return location ? normalizeCallsitePath2(location) : undefined;
2974
2959
  };
2975
2960
  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)}.` : ""}`;
2976
2961
  setStreamingSlotWarningController({
@@ -3260,6 +3245,9 @@ var renderFirstNotFound = async () => {
3260
3245
  };
3261
3246
 
3262
3247
  // src/react/pageHandler.ts
3248
+ var isRecord2 = (value) => typeof value === "object" && value !== null;
3249
+ var isReactComponent = (value) => typeof value === "function";
3250
+ var isReactPageRequestInput = (value) => isRecord2(value) && isReactComponent(value.Page) && typeof value.index === "string";
3263
3251
  var buildRefreshSetup = () => {
3264
3252
  if (false) {}
3265
3253
  return "window.__REFRESH_BUFFER__=[];" + "window.$RefreshReg$=function(t,i){window.__REFRESH_BUFFER__.push([t,i])};" + "window.$RefreshSig$=function(){return function(t){return t}};";
@@ -3274,23 +3262,15 @@ var buildDirtyResponse = (index, maybeProps) => {
3274
3262
  headers: { "Content-Type": "text/html" }
3275
3263
  });
3276
3264
  };
3277
- var handleReactPageRequest = async (PageComponentOrInput, index, ...args) => {
3278
- const {
3279
- Page,
3280
- index: resolvedIndex,
3281
- options,
3282
- props: maybeProps
3283
- } = typeof PageComponentOrInput === "object" && PageComponentOrInput !== null && "Page" in PageComponentOrInput ? {
3284
- index: PageComponentOrInput.index,
3285
- options: PageComponentOrInput,
3286
- Page: PageComponentOrInput.Page,
3287
- props: PageComponentOrInput.props
3288
- } : {
3289
- index: index ?? "",
3290
- options: args[1],
3291
- Page: PageComponentOrInput,
3292
- props: args[0]
3293
- };
3265
+ async function handleReactPageRequest(PageComponentOrInput, index, ...args) {
3266
+ const isInput = isReactPageRequestInput(PageComponentOrInput);
3267
+ const Page = isInput ? PageComponentOrInput.Page : PageComponentOrInput;
3268
+ const resolvedIndex = isInput ? PageComponentOrInput.index : index ?? "";
3269
+ const options = isInput ? PageComponentOrInput : args[1];
3270
+ const maybeProps = isInput ? PageComponentOrInput.props : args[0];
3271
+ if (!isReactComponent(Page)) {
3272
+ throw new Error("React page handler requires a React component.");
3273
+ }
3294
3274
  if (isSsrCacheDirty("react")) {
3295
3275
  return buildDirtyResponse(resolvedIndex, maybeProps);
3296
3276
  }
@@ -3326,7 +3306,7 @@ var handleReactPageRequest = async (PageComponentOrInput, index, ...args) => {
3326
3306
  status: 500
3327
3307
  });
3328
3308
  }
3329
- };
3309
+ }
3330
3310
  // src/react/Island.tsx
3331
3311
  init_islandMarkupAttributes();
3332
3312
  init_renderIslandMarkup();
@@ -3491,5 +3471,5 @@ export {
3491
3471
  Island
3492
3472
  };
3493
3473
 
3494
- //# debugId=101CE054DDCC862A64756E2164756E21
3474
+ //# debugId=7882B50BCAD0E62264756E2164756E21
3495
3475
  //# sourceMappingURL=index.js.map