@absolutejs/absolute 0.19.0-beta.703 → 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.
- package/dist/angular/components/constants.js +21 -0
- package/dist/angular/index.js +53 -73
- package/dist/angular/index.js.map +9 -9
- package/dist/angular/server.js +52 -72
- package/dist/angular/server.js.map +9 -9
- package/dist/build.js +8 -7
- package/dist/build.js.map +7 -7
- package/dist/cli/index.js +320 -284
- package/dist/client/index.js +4 -3
- package/dist/client/index.js.map +3 -3
- package/dist/index.js +96 -63
- package/dist/index.js.map +15 -15
- package/dist/islands/index.js +5 -4
- package/dist/islands/index.js.map +5 -5
- package/dist/react/index.js +49 -69
- package/dist/react/index.js.map +9 -9
- package/dist/react/jsxDevRuntimeCompat.js +1 -6
- package/dist/react/jsxDevRuntimeCompat.js.map +3 -3
- package/dist/react/server.js +43 -64
- package/dist/react/server.js.map +7 -7
- package/dist/src/angular/components/constants.d.ts +21 -0
- package/dist/src/angular/pageHandler.d.ts +6 -1
- package/dist/src/angular/ssrRender.d.ts +1 -1
- 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/loadConfig.d.ts +38 -2
- package/dist/src/vue/components/Image.d.ts +2 -2
- 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 +34 -49
- package/dist/svelte/index.js.map +9 -9
- package/dist/svelte/server.js +31 -47
- package/dist/svelte/server.js.map +8 -8
- 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 +119 -133
- package/dist/vue/index.js.map +12 -12
- package/dist/vue/server.js +40 -70
- package/dist/vue/server.js.map +7 -7
- package/package.json +48 -48
package/dist/src/constants.d.ts
CHANGED
|
@@ -51,3 +51,24 @@ export declare const TIME_PRECISION = 2;
|
|
|
51
51
|
export declare const TWO_THIRDS: number;
|
|
52
52
|
export declare const UNFOUND_INDEX = -1;
|
|
53
53
|
export declare const WEBSOCKET_NORMAL_CLOSURE = 1000;
|
|
54
|
+
export declare const WORKSPACE_COMMAND_ARGS_OFFSET = 3;
|
|
55
|
+
export declare const WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30;
|
|
56
|
+
export declare const WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60;
|
|
57
|
+
export declare const WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000;
|
|
58
|
+
export declare const WORKSPACE_READY_PROBE_INTERVAL_MS = 250;
|
|
59
|
+
export declare const WORKSPACE_READY_TIMEOUT_MS = 30000;
|
|
60
|
+
export declare const WORKSPACE_SHUTDOWN_TIMEOUT_MS = 10000;
|
|
61
|
+
export declare const WORKSPACE_TUI_DEFAULT_HEIGHT = 28;
|
|
62
|
+
export declare const WORKSPACE_TUI_DEFAULT_WIDTH = 100;
|
|
63
|
+
export declare const WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30;
|
|
64
|
+
export declare const WORKSPACE_TUI_FOOTER_LINE_COUNT = 3;
|
|
65
|
+
export declare const WORKSPACE_TUI_MIN_LOG_HEIGHT = 3;
|
|
66
|
+
export declare const WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7;
|
|
67
|
+
export declare const WORKSPACE_TUI_MIN_TARGET_WIDTH = 8;
|
|
68
|
+
export declare const WORKSPACE_TUI_MIN_WRAP_WIDTH = 12;
|
|
69
|
+
export declare const WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3;
|
|
70
|
+
export declare const WORKSPACE_TUI_RECENT_LOG_LIMIT = 40;
|
|
71
|
+
export declare const WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16;
|
|
72
|
+
export declare const WORKSPACE_TUI_STATUS_WIDTH = 10;
|
|
73
|
+
export declare const WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6;
|
|
74
|
+
export declare const WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IslandFramework } from '../../types/island';
|
|
2
|
-
export declare const markSsrCacheDirty: (framework: IslandFramework) => void;
|
|
3
2
|
export declare const isSsrCacheDirty: (framework: IslandFramework) => boolean;
|
|
3
|
+
export declare const markSsrCacheDirty: (framework: IslandFramework) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { withRegisteredStreamingSlots } from './responseEnhancers';
|
|
2
|
-
export declare const wrapPageHandlerWithStreamingSlots: <T extends (...args: unknown[]) => Response | Promise<Response>>(handler: T, options?: Parameters<typeof withRegisteredStreamingSlots>[1]) => T
|
|
2
|
+
export declare const wrapPageHandlerWithStreamingSlots: <T extends (...args: unknown[]) => Response | Promise<Response>>(handler: T, options?: Parameters<typeof withRegisteredStreamingSlots>[1]) => (...args: Parameters<T>) => Promise<Response>;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
type JSXType = Parameters<typeof jsx>[0];
|
|
3
3
|
type JSXKey = Parameters<typeof jsx>[2];
|
|
4
|
-
type JSXProps =
|
|
4
|
+
type JSXProps = Parameters<typeof jsx>[1] & {
|
|
5
|
+
children?: unknown;
|
|
6
|
+
};
|
|
5
7
|
export { Fragment };
|
|
6
8
|
export declare const jsxDEV: (type: JSXType, props: JSXProps, key?: JSXKey, _isStaticChildren?: boolean, _source?: unknown, _self?: unknown) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
7
|
-
declare const _default: {
|
|
8
|
-
Fragment: import("react").ExoticComponent<import("react").FragmentProps>;
|
|
9
|
-
jsxDEV: (type: JSXType, props: JSXProps, key?: JSXKey, _isStaticChildren?: boolean, _source?: unknown, _self?: unknown) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
10
|
-
};
|
|
11
|
-
export default _default;
|
|
@@ -16,6 +16,7 @@ export type HandleReactPageRequest = {
|
|
|
16
16
|
<Props extends Record<string, unknown> = Record<never, never>>(PageComponent: ReactComponent<Props>, index: string, ...args: ReactPageHandlerArgs<Props>): Promise<Response>;
|
|
17
17
|
};
|
|
18
18
|
type ReactPageHandlerArgs<Props extends Record<string, unknown>> = keyof Props extends never ? [props?: NoInfer<Props>, options?: ReactPageRenderOptions] : [props: NoInfer<Props>, options?: ReactPageRenderOptions];
|
|
19
|
-
export declare
|
|
19
|
+
export declare function handleReactPageRequest<Props extends Record<string, unknown> = Record<never, never>>(input: ReactPageRequestInput<Props>): Promise<Response>;
|
|
20
|
+
export declare function handleReactPageRequest<Props extends Record<string, unknown> = Record<never, never>>(PageComponent: ReactComponent<Props>, index: string, ...args: ReactPageHandlerArgs<Props>): Promise<Response>;
|
|
20
21
|
export declare const invalidateReactSsrCache: () => void;
|
|
21
22
|
export {};
|
|
@@ -6,7 +6,7 @@ export type SveltePageRenderOptions = {
|
|
|
6
6
|
bodyContent?: string;
|
|
7
7
|
headContent?: string;
|
|
8
8
|
} & StreamingSlotEnhancerOptions;
|
|
9
|
-
export type SveltePageRequestInput<Component extends SvelteComponent<
|
|
9
|
+
export type SveltePageRequestInput<Component extends SvelteComponent<never> = SvelteComponent<Record<never, never>>> = SveltePageRenderOptions & {
|
|
10
10
|
indexPath: string;
|
|
11
11
|
pagePath: string;
|
|
12
12
|
} & (keyof SveltePropsOf<Component> extends never ? {
|
|
@@ -15,7 +15,7 @@ export type SveltePageRequestInput<Component extends SvelteComponent<any> = Svel
|
|
|
15
15
|
props: NoInfer<SveltePropsOf<Component>>;
|
|
16
16
|
});
|
|
17
17
|
export type HandleSveltePageRequest = {
|
|
18
|
-
<Component extends SvelteComponent<
|
|
18
|
+
<Component extends SvelteComponent<never>>(input: SveltePageRequestInput<Component>): Promise<Response>;
|
|
19
19
|
(PageComponent: SvelteComponent<Record<string, never>>, pagePath: string, indexPath: string): Promise<Response>;
|
|
20
20
|
<P extends Record<string, unknown>>(PageComponent: SvelteComponent<P>, pagePath: string, indexPath: string, props: NoInfer<P>, options?: SveltePageRenderOptions): Promise<Response>;
|
|
21
21
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AbsoluteServiceConfig, CommandServiceConfig,
|
|
1
|
+
import type { AbsoluteServiceConfig, CommandServiceConfig, ReservedConfigKey } from '../../types/build';
|
|
2
2
|
type ServiceName<TConfig> = Extract<keyof TConfig, string>;
|
|
3
3
|
type HasReservedConfigKeys<TConfig> = Extract<ServiceName<TConfig>, ReservedConfigKey> extends never ? false : true;
|
|
4
4
|
type ServiceDependsOn<TConfig, TSelf extends string> = readonly Exclude<ServiceName<TConfig>, TSelf>[];
|
|
@@ -12,5 +12,5 @@ type TypedWorkspaceConfig<TConfig extends Record<string, unknown>> = {
|
|
|
12
12
|
[K in keyof TConfig]: K extends string ? TypedAbsoluteServiceConfig<TConfig, K> | TypedCommandServiceConfig<TConfig, K> : never;
|
|
13
13
|
};
|
|
14
14
|
type ValidateConfig<TConfig extends Record<string, unknown>> = HasReservedConfigKeys<TConfig> extends true ? AbsoluteServiceConfig : TypedWorkspaceConfig<TConfig>;
|
|
15
|
-
export declare const defineConfig: <const TConfig extends Record<string, unknown>>(config: TConfig & ValidateConfig<TConfig>) => TConfig &
|
|
15
|
+
export declare const defineConfig: <const TConfig extends Record<string, unknown>>(config: TConfig & ValidateConfig<TConfig>) => TConfig & ValidateConfig<TConfig>;
|
|
16
16
|
export {};
|
|
@@ -1,6 +1,42 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ConfigInput, WorkspaceConfig } from '../../types/build';
|
|
2
2
|
declare const isWorkspaceConfig: (config: ConfigInput) => config is WorkspaceConfig;
|
|
3
3
|
declare const getWorkspaceServices: (config: ConfigInput) => WorkspaceConfig;
|
|
4
|
+
export declare const loadConfig: (configPath?: string) => Promise<{
|
|
5
|
+
buildDirectory?: string;
|
|
6
|
+
assetsDirectory?: string;
|
|
7
|
+
publicDirectory?: string;
|
|
8
|
+
islands?: {
|
|
9
|
+
registry: string;
|
|
10
|
+
bootstrap?: string;
|
|
11
|
+
};
|
|
12
|
+
reactDirectory?: string;
|
|
13
|
+
vueDirectory?: string;
|
|
14
|
+
angularDirectory?: string;
|
|
15
|
+
astroDirectory?: string;
|
|
16
|
+
svelteDirectory?: string;
|
|
17
|
+
htmlDirectory?: string;
|
|
18
|
+
htmxDirectory?: string;
|
|
19
|
+
stylesConfig?: string | import("..").StylesConfig;
|
|
20
|
+
stylePreprocessors?: import("..").StylePreprocessorConfig;
|
|
21
|
+
postcss?: import("..").PostCSSConfig;
|
|
22
|
+
tailwind?: import("..").TailwindConfig;
|
|
23
|
+
options?: import("..").BuildOptions;
|
|
24
|
+
incrementalFiles?: string[];
|
|
25
|
+
mode?: "production" | "development";
|
|
26
|
+
dev?: {
|
|
27
|
+
https?: boolean;
|
|
28
|
+
devtools?: {
|
|
29
|
+
projectRoot?: string;
|
|
30
|
+
uuid?: string;
|
|
31
|
+
uuidCachePath?: string;
|
|
32
|
+
normalizeForWindowsContainer?: boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
static?: import("..").StaticConfig;
|
|
36
|
+
images?: import("..").ImageConfig;
|
|
37
|
+
sitemap?: import("..").SitemapConfig;
|
|
38
|
+
entry?: string;
|
|
39
|
+
shutdown?: import("..").ServiceShutdownConfig;
|
|
40
|
+
}>;
|
|
4
41
|
export declare const loadRawConfig: (configPath?: string) => Promise<ConfigInput>;
|
|
5
|
-
export declare const loadConfig: (configPath?: string) => Promise<BuildConfig>;
|
|
6
42
|
export { getWorkspaceServices, isWorkspaceConfig };
|
|
@@ -4,7 +4,7 @@ type ImageLoader = (params: {
|
|
|
4
4
|
quality: number;
|
|
5
5
|
}) => string;
|
|
6
6
|
type ImageStyle = Record<string, string | number>;
|
|
7
|
-
declare const
|
|
7
|
+
export declare const Image: import("vue").DefineComponent<{
|
|
8
8
|
src: string;
|
|
9
9
|
alt: string;
|
|
10
10
|
width?: number | undefined;
|
|
@@ -71,4 +71,4 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
71
71
|
fetchPriority: string;
|
|
72
72
|
referrerPolicy: string;
|
|
73
73
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
74
|
-
export
|
|
74
|
+
export {};
|
package/dist/src/vue/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export { handleVuePageRequest } from './pageHandler';
|
|
|
2
2
|
export { Island } from './Island';
|
|
3
3
|
export { createTypedIsland } from './createIsland';
|
|
4
4
|
export { useIslandStore } from './useIslandStore';
|
|
5
|
-
export {
|
|
5
|
+
export { Image } from './components/Image';
|
|
6
6
|
export { StreamSlot, SuspenseSlot } from './components';
|
|
@@ -24,6 +24,7 @@ type VuePageHandlerArgs<Component extends VueComponent> = keyof VuePropsOf<Compo
|
|
|
24
24
|
props: NoInfer<VuePropsOf<Component>>,
|
|
25
25
|
options?: VuePageRenderOptions
|
|
26
26
|
];
|
|
27
|
-
export declare
|
|
27
|
+
export declare function handleVuePageRequest<Component extends VueComponent>(input: VuePageRequestInput<Component>): Promise<Response>;
|
|
28
|
+
export declare function handleVuePageRequest<Component extends VueComponent>(PageComponent: Component, pagePath: string, indexPath: string, headTag: `<head>${string}</head>` | undefined, ...args: VuePageHandlerArgs<Component>): Promise<Response>;
|
|
28
29
|
export declare const invalidateVueSsrCache: () => void;
|
|
29
30
|
export {};
|
package/dist/svelte/index.js
CHANGED
|
@@ -134,7 +134,7 @@ var resolveExportPath = (entry, conditions) => {
|
|
|
134
134
|
var init_resolvePackageImport = () => {};
|
|
135
135
|
|
|
136
136
|
// src/constants.ts
|
|
137
|
-
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;
|
|
137
|
+
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;
|
|
138
138
|
var init_constants = __esm(() => {
|
|
139
139
|
MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
|
|
140
140
|
MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
|
|
@@ -903,7 +903,7 @@ __export(exports_devRouteRegistrationCallsite, {
|
|
|
903
903
|
});
|
|
904
904
|
import { AsyncLocalStorage } from "async_hooks";
|
|
905
905
|
import { Elysia } from "elysia";
|
|
906
|
-
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 = () => {
|
|
906
|
+
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 = () => {
|
|
907
907
|
const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
|
|
908
908
|
if (value === null || typeof value === "undefined") {
|
|
909
909
|
return;
|
|
@@ -917,19 +917,10 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
|
|
|
917
917
|
const storage = new AsyncLocalStorage;
|
|
918
918
|
Reflect.set(globalThis, ROUTE_CALLSITE_STORAGE_KEY, storage);
|
|
919
919
|
return storage;
|
|
920
|
-
}, normalizeCallsitePath = (value) => value.replace(`${process.cwd()}/`, "").replace(process.cwd(), "").replace(/^\.\/+/, ""), extractRouteRegistrationCallsite = (stack) => {
|
|
921
|
-
const
|
|
922
|
-
`).slice(1).map((line) => line.trim());
|
|
923
|
-
|
|
924
|
-
if (frame.includes("/node_modules/") || frame.includes("/dist/") || frame.includes("/src/core/devRouteRegistrationCallsite.")) {
|
|
925
|
-
continue;
|
|
926
|
-
}
|
|
927
|
-
const locationMatch = frame.match(/\((\/[^)]+:\d+:\d+)\)$/) ?? frame.match(/at (\/[^ ]+:\d+:\d+)$/);
|
|
928
|
-
if (locationMatch?.[1]) {
|
|
929
|
-
return normalizeCallsitePath(locationMatch[1]);
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
return;
|
|
920
|
+
}, 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) => {
|
|
921
|
+
const location = stack.split(`
|
|
922
|
+
`).slice(1).map((line) => line.trim()).filter((frame) => !shouldIgnoreRouteCallsiteFrame(frame)).map((frame) => getRouteCallsiteLocation(frame)).find((frameLocation) => frameLocation !== undefined);
|
|
923
|
+
return location ? normalizeCallsitePath(location) : undefined;
|
|
933
924
|
}, captureRouteRegistrationCallsite = () => {
|
|
934
925
|
const { stack } = new Error;
|
|
935
926
|
if (!stack) {
|
|
@@ -941,29 +932,29 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
|
|
|
941
932
|
return handler;
|
|
942
933
|
}
|
|
943
934
|
const storage = ensureRouteCallsiteStorage();
|
|
935
|
+
const routeHandler = handler;
|
|
944
936
|
return function wrappedRouteHandler(...args) {
|
|
945
|
-
return storage.run({ callsite }, () => Reflect.apply(
|
|
937
|
+
return storage.run({ callsite }, () => Reflect.apply(routeHandler, this, args));
|
|
946
938
|
};
|
|
939
|
+
}, createPatchedRouteMethod = (originalMethod) => function patchedRouteMethod(path, handler, ...rest) {
|
|
940
|
+
const callsite = captureRouteRegistrationCallsite();
|
|
941
|
+
return Reflect.apply(originalMethod, this, [
|
|
942
|
+
path,
|
|
943
|
+
wrapRouteHandlerWithCallsite(handler, callsite),
|
|
944
|
+
...rest
|
|
945
|
+
]);
|
|
947
946
|
}, getCurrentRouteRegistrationCallsite = () => getRouteCallsiteStorage()?.getStore()?.callsite, patchElysiaRouteRegistrationCallsites = () => {
|
|
948
947
|
if (false) {}
|
|
949
948
|
if (Reflect.get(globalThis, ROUTE_CALLSITE_PATCHED_KEY) === true) {
|
|
950
949
|
return;
|
|
951
950
|
}
|
|
952
|
-
const prototype = Elysia
|
|
953
|
-
|
|
954
|
-
const originalMethod = prototype
|
|
955
|
-
if (
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
const callsite = captureRouteRegistrationCallsite();
|
|
960
|
-
return Reflect.apply(originalMethod, this, [
|
|
961
|
-
path,
|
|
962
|
-
wrapRouteHandlerWithCallsite(handler, callsite),
|
|
963
|
-
...rest
|
|
964
|
-
]);
|
|
965
|
-
};
|
|
966
|
-
}
|
|
951
|
+
const { prototype } = Elysia;
|
|
952
|
+
ROUTE_METHOD_NAMES.forEach((methodName) => {
|
|
953
|
+
const originalMethod = Reflect.get(prototype, methodName);
|
|
954
|
+
if (!isRouteMethod(originalMethod))
|
|
955
|
+
return;
|
|
956
|
+
Reflect.set(prototype, methodName, createPatchedRouteMethod(originalMethod));
|
|
957
|
+
});
|
|
967
958
|
Reflect.set(globalThis, ROUTE_CALLSITE_PATCHED_KEY, true);
|
|
968
959
|
};
|
|
969
960
|
var init_devRouteRegistrationCallsite = __esm(() => {
|
|
@@ -1800,9 +1791,9 @@ var init_logger = __esm(() => {
|
|
|
1800
1791
|
});
|
|
1801
1792
|
|
|
1802
1793
|
// src/core/ssrCache.ts
|
|
1803
|
-
var dirtyFrameworks, markSsrCacheDirty = (framework) => {
|
|
1794
|
+
var dirtyFrameworks, isSsrCacheDirty = (framework) => dirtyFrameworks.has(framework), markSsrCacheDirty = (framework) => {
|
|
1804
1795
|
dirtyFrameworks.add(framework);
|
|
1805
|
-
}
|
|
1796
|
+
};
|
|
1806
1797
|
var init_ssrCache = __esm(() => {
|
|
1807
1798
|
dirtyFrameworks = new Set;
|
|
1808
1799
|
});
|
|
@@ -2124,7 +2115,7 @@ var routePropsCache, cacheRouteData = (pagePath, data) => {
|
|
|
2124
2115
|
Sanitizer: core.Sanitizer,
|
|
2125
2116
|
SecurityContext: core.SecurityContext
|
|
2126
2117
|
};
|
|
2127
|
-
}, buildProviders = (deps, sanitizer, maybeProps, tokenMap) => {
|
|
2118
|
+
}, buildProviders = (deps, sanitizer, maybeProps, tokenMap, userProviders = []) => {
|
|
2128
2119
|
const providers = [
|
|
2129
2120
|
deps.provideServerRendering(),
|
|
2130
2121
|
deps.provideClientHydration(),
|
|
@@ -2134,7 +2125,8 @@ var routePropsCache, cacheRouteData = (pagePath, data) => {
|
|
|
2134
2125
|
provide: deps.DomSanitizer,
|
|
2135
2126
|
useValue: sanitizer
|
|
2136
2127
|
},
|
|
2137
|
-
{ provide: deps.Sanitizer, useValue: sanitizer }
|
|
2128
|
+
{ provide: deps.Sanitizer, useValue: sanitizer },
|
|
2129
|
+
...userProviders
|
|
2138
2130
|
];
|
|
2139
2131
|
if (!maybeProps) {
|
|
2140
2132
|
return providers;
|
|
@@ -3016,19 +3008,12 @@ var formatWarningCallsite = (callsite) => {
|
|
|
3016
3008
|
}
|
|
3017
3009
|
return `\x1B[36m${match[1]}\x1B[33m${match[2]}\x1B[0m`;
|
|
3018
3010
|
};
|
|
3011
|
+
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.");
|
|
3012
|
+
var getWarningLocation = (frame) => frame.match(/\((\/[^)]+:\d+:\d+)\)$/)?.[1] ?? frame.match(/at (\/[^ ]+:\d+:\d+)$/)?.[1];
|
|
3019
3013
|
var extractCallsiteFromStack = (stack) => {
|
|
3020
|
-
const
|
|
3021
|
-
`).slice(1).map((line) => line.trim());
|
|
3022
|
-
|
|
3023
|
-
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.")) {
|
|
3024
|
-
continue;
|
|
3025
|
-
}
|
|
3026
|
-
const locationMatch = frame.match(/\((\/[^)]+:\d+:\d+)\)$/) ?? frame.match(/at (\/[^ ]+:\d+:\d+)$/);
|
|
3027
|
-
if (locationMatch?.[1]) {
|
|
3028
|
-
return normalizeCallsitePath2(locationMatch[1]);
|
|
3029
|
-
}
|
|
3030
|
-
}
|
|
3031
|
-
return;
|
|
3014
|
+
const location = stack.split(`
|
|
3015
|
+
`).slice(1).map((line) => line.trim()).filter((frame) => !shouldIgnoreWarningFrame(frame)).map((frame) => getWarningLocation(frame)).find((frameLocation) => frameLocation !== undefined);
|
|
3016
|
+
return location ? normalizeCallsitePath2(location) : undefined;
|
|
3032
3017
|
};
|
|
3033
3018
|
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)}.` : ""}`;
|
|
3034
3019
|
setStreamingSlotWarningController({
|
|
@@ -3343,9 +3328,9 @@ var handleSveltePageRequest = async (PageComponentOrInput, pagePath, indexPath,
|
|
|
3343
3328
|
pagePath: resolvedPagePath,
|
|
3344
3329
|
props: resolvedProps
|
|
3345
3330
|
} = typeof PageComponentOrInput === "object" && PageComponentOrInput !== null && "pagePath" in PageComponentOrInput && "indexPath" in PageComponentOrInput ? {
|
|
3346
|
-
PageComponent: undefined,
|
|
3347
3331
|
indexPath: PageComponentOrInput.indexPath,
|
|
3348
3332
|
options: PageComponentOrInput,
|
|
3333
|
+
PageComponent: undefined,
|
|
3349
3334
|
pagePath: PageComponentOrInput.pagePath,
|
|
3350
3335
|
props: PageComponentOrInput.props
|
|
3351
3336
|
} : {
|
|
@@ -3568,5 +3553,5 @@ export {
|
|
|
3568
3553
|
createTypedIsland
|
|
3569
3554
|
};
|
|
3570
3555
|
|
|
3571
|
-
//# debugId=
|
|
3556
|
+
//# debugId=12FDF82130D4AA7C64756E2164756E21
|
|
3572
3557
|
//# sourceMappingURL=index.js.map
|