react-router 0.0.0-experimental-e0b6ce9 → 0.0.0-experimental-de3b900
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/CHANGELOG.md +105 -0
- package/dist/development/browser-B4aBBnx8.d.ts +310 -0
- package/dist/development/browser-CN2w9Cbu.d.mts +310 -0
- package/dist/development/{chunk-4FI4BC6Y.mjs → chunk-5VDQAMOM.mjs} +181 -873
- package/dist/development/chunk-JEIV2ESS.js +1308 -0
- package/dist/development/{chunk-INO4IHBF.js → chunk-K3XLKYJI.js} +892 -409
- package/dist/development/{chunk-F6CT5MEB.mjs → chunk-OVO62ONG.mjs} +31 -314
- package/dist/development/chunk-UPBUMW2M.js +188 -0
- package/dist/development/dom-export.d.mts +51 -61
- package/dist/development/dom-export.d.ts +51 -60
- package/dist/development/dom-export.js +705 -23
- package/dist/development/dom-export.mjs +689 -14
- package/dist/{production/index-react-server-client-CYIi6gi0.d.mts → development/index-react-server-client-BOJoTiaG.d.ts} +76 -140
- package/dist/development/{index-react-server-client-CYIi6gi0.d.mts → index-react-server-client-CuQLmpku.d.mts} +76 -140
- package/dist/development/index-react-server-client.d.mts +2 -3
- package/dist/development/index-react-server-client.d.ts +2 -3
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +1 -90
- package/dist/development/index-react-server.d.ts +1 -90
- package/dist/development/index-react-server.js +9 -188
- package/dist/development/index-react-server.mjs +9 -188
- package/dist/development/index.d.mts +21 -320
- package/dist/development/index.d.ts +21 -364
- package/dist/development/index.js +131 -977
- package/dist/development/index.mjs +5 -9
- package/dist/development/lib/types/internal.d.mts +2 -3
- package/dist/development/lib/types/internal.d.ts +2 -3
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/{production/register-DiOIlEq5.d.mts → development/register-BblEgJPm.d.mts} +7 -1
- package/dist/development/{register-DiOIlEq5.d.ts → register-D18raRVf.d.ts} +7 -1
- package/dist/development/{router-DWv6Clt-.d.mts → route-data-nQS6GSUI.d.mts} +1265 -932
- package/dist/development/{routeModules-DqotkItD.d.ts → routeModules-9wlxglVk.d.ts} +1047 -74
- package/dist/production/browser-B4aBBnx8.d.ts +310 -0
- package/dist/production/browser-CN2w9Cbu.d.mts +310 -0
- package/dist/production/{chunk-K7VXYOZD.js → chunk-63YB5VLY.js} +892 -409
- package/dist/production/chunk-IE722GR6.js +188 -0
- package/dist/production/{chunk-LKSLGWXX.mjs → chunk-U25H5FTL.mjs} +31 -314
- package/dist/production/chunk-VX4OHTGR.js +1308 -0
- package/dist/production/{chunk-52MYED7O.mjs → chunk-XOCFS75J.mjs} +181 -873
- package/dist/production/dom-export.d.mts +51 -61
- package/dist/production/dom-export.d.ts +51 -60
- package/dist/production/dom-export.js +705 -23
- package/dist/production/dom-export.mjs +689 -14
- package/dist/production/{index-react-server-client-ChBGplLn.d.ts → index-react-server-client-BOJoTiaG.d.ts} +76 -140
- package/dist/{development/index-react-server-client-ChBGplLn.d.ts → production/index-react-server-client-CuQLmpku.d.mts} +76 -140
- package/dist/production/index-react-server-client.d.mts +2 -3
- package/dist/production/index-react-server-client.d.ts +2 -3
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +1 -90
- package/dist/production/index-react-server.d.ts +1 -90
- package/dist/production/index-react-server.js +9 -188
- package/dist/production/index-react-server.mjs +9 -188
- package/dist/production/index.d.mts +21 -320
- package/dist/production/index.d.ts +21 -364
- package/dist/production/index.js +131 -977
- package/dist/production/index.mjs +5 -9
- package/dist/production/lib/types/internal.d.mts +2 -3
- package/dist/production/lib/types/internal.d.ts +2 -3
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/{development/register-DiOIlEq5.d.mts → production/register-BblEgJPm.d.mts} +7 -1
- package/dist/production/{register-DiOIlEq5.d.ts → register-D18raRVf.d.ts} +7 -1
- package/dist/production/{router-DWv6Clt-.d.mts → route-data-nQS6GSUI.d.mts} +1265 -932
- package/dist/production/{routeModules-DqotkItD.d.ts → routeModules-9wlxglVk.d.ts} +1047 -74
- package/package.json +1 -1
- package/dist/development/browser-z32v5KVN.d.mts +0 -46
- package/dist/development/chunk-ITZFCV4J.js +0 -2092
- package/dist/development/instrumentation-BGrNA7uj.d.ts +0 -1122
- package/dist/development/routeModules-Cy4Xsfoi.d.mts +0 -483
- package/dist/production/browser-z32v5KVN.d.mts +0 -46
- package/dist/production/chunk-DASXXYNZ.js +0 -2092
- package/dist/production/instrumentation-BGrNA7uj.d.ts +0 -1122
- package/dist/production/routeModules-Cy4Xsfoi.d.mts +0 -483
|
@@ -1,33 +1,59 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { by as RouteManifest, bz as ServerRouteModule, Y as MiddlewareEnabled, c as RouterContextProvider, X as AppLoadContext, ak as LoaderFunctionArgs, ab as ActionFunctionArgs, o as RouteModules, a4 as StaticHandlerContext, J as HydrationState, a0 as DataRouteObject, a as ClientLoaderFunction, ai as HTMLFormMethod, ag as FormEncType, t as RelativeRoutingType, bb as PageLinkDescriptor, T as To, bA as History, a3 as GetScrollRestorationKeyFunction, e as RouterInit, bB as FutureConfig$1, p as DataStrategyFunction, $ as PatchRoutesOnNavigationFunction, q as NavigateOptions, a5 as Fetcher, E as RouteObject, n as Router, s as SerializeFrom, B as BlockerFunction, L as Location, bC as CreateStaticHandlerOptions$1, a1 as StaticHandler } from './routeModules-9wlxglVk.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { af as RouteManifest, t as MiddlewareEnabled, R as RouterContextProvider, w as LoaderFunctionArgs, v as ActionFunctionArgs, j as unstable_ServerInstrumentation, i as HTMLFormMethod, F as FormEncType, T as To, H as History, u as unstable_ClientInstrumentation, f as DataStrategyFunction, L as Location } from './instrumentation-BGrNA7uj.js';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
parentId?: string;
|
|
10
|
-
path?: string;
|
|
4
|
+
type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
|
|
5
|
+
interface ServerRoute extends Route {
|
|
6
|
+
children: ServerRoute[];
|
|
7
|
+
module: ServerRouteModule;
|
|
11
8
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
|
|
10
|
+
type OptionalCriticalCss = CriticalCss | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The output of the compiler for the server build.
|
|
13
|
+
*/
|
|
14
|
+
interface ServerBuild {
|
|
15
|
+
entry: {
|
|
16
|
+
module: ServerEntryModule;
|
|
17
|
+
};
|
|
18
|
+
routes: ServerRouteManifest;
|
|
19
|
+
assets: AssetsManifest;
|
|
20
|
+
basename?: string;
|
|
21
|
+
publicPath: string;
|
|
22
|
+
assetsBuildDirectory: string;
|
|
23
|
+
future: FutureConfig;
|
|
24
|
+
ssr: boolean;
|
|
25
|
+
unstable_getCriticalCss?: (args: {
|
|
26
|
+
pathname: string;
|
|
27
|
+
}) => OptionalCriticalCss | Promise<OptionalCriticalCss>;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated This is now done via a custom header during prerendering
|
|
30
|
+
*/
|
|
31
|
+
isSpaMode: boolean;
|
|
32
|
+
prerender: string[];
|
|
33
|
+
routeDiscovery: {
|
|
34
|
+
mode: "lazy" | "initial";
|
|
35
|
+
manifestPath: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
interface HandleDocumentRequestFunction {
|
|
39
|
+
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: MiddlewareEnabled extends true ? RouterContextProvider : AppLoadContext): Promise<Response> | Response;
|
|
40
|
+
}
|
|
41
|
+
interface HandleDataRequestFunction {
|
|
42
|
+
(response: Response, args: LoaderFunctionArgs | ActionFunctionArgs): Promise<Response> | Response;
|
|
43
|
+
}
|
|
44
|
+
interface HandleErrorFunction {
|
|
45
|
+
(error: unknown, args: LoaderFunctionArgs | ActionFunctionArgs): void;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A module that serves as the entry point for a Remix app during server
|
|
49
|
+
* rendering.
|
|
50
|
+
*/
|
|
51
|
+
interface ServerEntryModule {
|
|
52
|
+
default: HandleDocumentRequestFunction;
|
|
53
|
+
handleDataRequest?: HandleDataRequestFunction;
|
|
54
|
+
handleError?: HandleErrorFunction;
|
|
55
|
+
streamTimeout?: number;
|
|
27
56
|
}
|
|
28
|
-
declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
|
|
29
|
-
declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
|
|
30
|
-
declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean;
|
|
31
57
|
|
|
32
58
|
type SerializedError = {
|
|
33
59
|
message: string;
|
|
@@ -81,68 +107,32 @@ interface AssetsManifest {
|
|
|
81
107
|
sri?: Record<string, string> | true;
|
|
82
108
|
}
|
|
83
109
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
type OptionalCriticalCss = CriticalCss | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* The output of the compiler for the server build.
|
|
93
|
-
*/
|
|
94
|
-
interface ServerBuild {
|
|
95
|
-
entry: {
|
|
96
|
-
module: ServerEntryModule;
|
|
97
|
-
};
|
|
98
|
-
routes: ServerRouteManifest;
|
|
99
|
-
assets: AssetsManifest;
|
|
100
|
-
basename?: string;
|
|
101
|
-
publicPath: string;
|
|
102
|
-
assetsBuildDirectory: string;
|
|
103
|
-
future: FutureConfig;
|
|
104
|
-
ssr: boolean;
|
|
105
|
-
unstable_getCriticalCss?: (args: {
|
|
106
|
-
pathname: string;
|
|
107
|
-
}) => OptionalCriticalCss | Promise<OptionalCriticalCss>;
|
|
108
|
-
/**
|
|
109
|
-
* @deprecated This is now done via a custom header during prerendering
|
|
110
|
-
*/
|
|
111
|
-
isSpaMode: boolean;
|
|
112
|
-
prerender: string[];
|
|
113
|
-
routeDiscovery: {
|
|
114
|
-
mode: "lazy" | "initial";
|
|
115
|
-
manifestPath: string;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
interface HandleDocumentRequestFunction {
|
|
119
|
-
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: MiddlewareEnabled extends true ? RouterContextProvider : AppLoadContext): Promise<Response> | Response;
|
|
120
|
-
}
|
|
121
|
-
interface HandleDataRequestFunction {
|
|
122
|
-
(response: Response, args: {
|
|
123
|
-
request: LoaderFunctionArgs["request"] | ActionFunctionArgs["request"];
|
|
124
|
-
context: LoaderFunctionArgs["context"] | ActionFunctionArgs["context"];
|
|
125
|
-
params: LoaderFunctionArgs["params"] | ActionFunctionArgs["params"];
|
|
126
|
-
}): Promise<Response> | Response;
|
|
127
|
-
}
|
|
128
|
-
interface HandleErrorFunction {
|
|
129
|
-
(error: unknown, args: {
|
|
130
|
-
request: LoaderFunctionArgs["request"] | ActionFunctionArgs["request"];
|
|
131
|
-
context: LoaderFunctionArgs["context"] | ActionFunctionArgs["context"];
|
|
132
|
-
params: LoaderFunctionArgs["params"] | ActionFunctionArgs["params"];
|
|
133
|
-
}): void;
|
|
110
|
+
interface Route {
|
|
111
|
+
index?: boolean;
|
|
112
|
+
caseSensitive?: boolean;
|
|
113
|
+
id: string;
|
|
114
|
+
parentId?: string;
|
|
115
|
+
path?: string;
|
|
134
116
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
117
|
+
interface EntryRoute extends Route {
|
|
118
|
+
hasAction: boolean;
|
|
119
|
+
hasLoader: boolean;
|
|
120
|
+
hasClientAction: boolean;
|
|
121
|
+
hasClientLoader: boolean;
|
|
122
|
+
hasClientMiddleware: boolean;
|
|
123
|
+
hasErrorBoundary: boolean;
|
|
124
|
+
imports?: string[];
|
|
125
|
+
css?: string[];
|
|
126
|
+
module: string;
|
|
127
|
+
clientActionModule: string | undefined;
|
|
128
|
+
clientLoaderModule: string | undefined;
|
|
129
|
+
clientMiddlewareModule: string | undefined;
|
|
130
|
+
hydrateFallbackModule: string | undefined;
|
|
131
|
+
parentId?: string;
|
|
145
132
|
}
|
|
133
|
+
declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
|
|
134
|
+
declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
|
|
135
|
+
declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean;
|
|
146
136
|
|
|
147
137
|
type ParamKeyValuePair = [string, string];
|
|
148
138
|
type URLSearchParamsInit = string | ParamKeyValuePair[] | Record<string, string | string[]> | URLSearchParams;
|
|
@@ -531,58 +521,6 @@ interface DOMRouterOpts {
|
|
|
531
521
|
* ```
|
|
532
522
|
*/
|
|
533
523
|
hydrationData?: HydrationState;
|
|
534
|
-
/**
|
|
535
|
-
* Array of instrumentation objects allowing you to instrument the router and
|
|
536
|
-
* individual routes prior to router initialization (and on any subsequently
|
|
537
|
-
* added routes via `route.lazy` or `patchRoutesOnNavigation`). This is
|
|
538
|
-
* mostly useful for observability such as wrapping navigations, fetches,
|
|
539
|
-
* as well as route loaders/actions/middlewares with logging and/or performance
|
|
540
|
-
* tracing.
|
|
541
|
-
*
|
|
542
|
-
* ```tsx
|
|
543
|
-
* let router = createBrowserRouter(routes, {
|
|
544
|
-
* unstable_instrumentations: [logging]
|
|
545
|
-
* });
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
* let logging = {
|
|
549
|
-
* router({ instrument }) {
|
|
550
|
-
* instrument({
|
|
551
|
-
* navigate: (impl, info) => logExecution(`navigate ${info.to}`, impl),
|
|
552
|
-
* fetch: (impl, info) => logExecution(`fetch ${info.to}`, impl)
|
|
553
|
-
* });
|
|
554
|
-
* },
|
|
555
|
-
* route({ instrument, id }) {
|
|
556
|
-
* instrument({
|
|
557
|
-
* middleware: (impl, info) => logExecution(
|
|
558
|
-
* `middleware ${info.request.url} (route ${id})`,
|
|
559
|
-
* impl
|
|
560
|
-
* ),
|
|
561
|
-
* loader: (impl, info) => logExecution(
|
|
562
|
-
* `loader ${info.request.url} (route ${id})`,
|
|
563
|
-
* impl
|
|
564
|
-
* ),
|
|
565
|
-
* action: (impl, info) => logExecution(
|
|
566
|
-
* `action ${info.request.url} (route ${id})`,
|
|
567
|
-
* impl
|
|
568
|
-
* ),
|
|
569
|
-
* })
|
|
570
|
-
* }
|
|
571
|
-
* };
|
|
572
|
-
*
|
|
573
|
-
* async function logExecution(label: string, impl: () => Promise<void>) {
|
|
574
|
-
* let start = performance.now();
|
|
575
|
-
* console.log(`start ${label}`);
|
|
576
|
-
* try {
|
|
577
|
-
* await impl();
|
|
578
|
-
* } finally {
|
|
579
|
-
* let end = performance.now();
|
|
580
|
-
* console.log(`end ${label} (${Math.round(end - start)}ms)`);
|
|
581
|
-
* }
|
|
582
|
-
* }
|
|
583
|
-
* ```
|
|
584
|
-
*/
|
|
585
|
-
unstable_instrumentations?: unstable_ClientInstrumentation[];
|
|
586
524
|
/**
|
|
587
525
|
* Override the default data strategy of running loaders in parallel.
|
|
588
526
|
* See {@link DataStrategyFunction}.
|
|
@@ -1088,7 +1026,6 @@ interface DOMRouterOpts {
|
|
|
1088
1026
|
* @param {DOMRouterOpts.future} opts.future n/a
|
|
1089
1027
|
* @param {DOMRouterOpts.getContext} opts.getContext n/a
|
|
1090
1028
|
* @param {DOMRouterOpts.hydrationData} opts.hydrationData n/a
|
|
1091
|
-
* @param {DOMRouterOpts.unstable_instrumentations} opts.unstable_instrumentations n/a
|
|
1092
1029
|
* @param {DOMRouterOpts.patchRoutesOnNavigation} opts.patchRoutesOnNavigation n/a
|
|
1093
1030
|
* @param {DOMRouterOpts.window} opts.window n/a
|
|
1094
1031
|
* @returns An initialized {@link DataRouter| data router} to pass to {@link RouterProvider | `<RouterProvider>`}
|
|
@@ -1107,7 +1044,6 @@ declare function createBrowserRouter(routes: RouteObject[], opts?: DOMRouterOpts
|
|
|
1107
1044
|
* @param {DOMRouterOpts.future} opts.future n/a
|
|
1108
1045
|
* @param {DOMRouterOpts.getContext} opts.getContext n/a
|
|
1109
1046
|
* @param {DOMRouterOpts.hydrationData} opts.hydrationData n/a
|
|
1110
|
-
* @param {DOMRouterOpts.unstable_instrumentations} opts.unstable_instrumentations n/a
|
|
1111
1047
|
* @param {DOMRouterOpts.dataStrategy} opts.dataStrategy n/a
|
|
1112
1048
|
* @param {DOMRouterOpts.patchRoutesOnNavigation} opts.patchRoutesOnNavigation n/a
|
|
1113
1049
|
* @param {DOMRouterOpts.window} opts.window n/a
|
|
@@ -1,33 +1,59 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { by as RouteManifest, bz as ServerRouteModule, _ as MiddlewareEnabled, c as RouterContextProvider, Z as AppLoadContext, am as LoaderFunctionArgs, ad as ActionFunctionArgs, p as RouteModules, a6 as StaticHandlerContext, O as HydrationState, a2 as DataRouteObject, a as ClientLoaderFunction, ak as HTMLFormMethod, ai as FormEncType, v as RelativeRoutingType, bb as PageLinkDescriptor, T as To, bA as History, a5 as GetScrollRestorationKeyFunction, e as RouterInit, bB as FutureConfig$1, q as DataStrategyFunction, a1 as PatchRoutesOnNavigationFunction, r as NavigateOptions, a7 as Fetcher, J as RouteObject, o as Router, t as SerializeFrom, B as BlockerFunction, L as Location, bC as CreateStaticHandlerOptions$1, a3 as StaticHandler } from './route-data-nQS6GSUI.mjs';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { af as RouteManifest, t as MiddlewareEnabled, R as RouterContextProvider, w as LoaderFunctionArgs, v as ActionFunctionArgs, j as unstable_ServerInstrumentation, i as HTMLFormMethod, F as FormEncType, T as To, H as History, u as unstable_ClientInstrumentation, f as DataStrategyFunction, L as Location } from './instrumentation-BGrNA7uj.js';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
parentId?: string;
|
|
10
|
-
path?: string;
|
|
4
|
+
type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
|
|
5
|
+
interface ServerRoute extends Route {
|
|
6
|
+
children: ServerRoute[];
|
|
7
|
+
module: ServerRouteModule;
|
|
11
8
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
|
|
10
|
+
type OptionalCriticalCss = CriticalCss | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The output of the compiler for the server build.
|
|
13
|
+
*/
|
|
14
|
+
interface ServerBuild {
|
|
15
|
+
entry: {
|
|
16
|
+
module: ServerEntryModule;
|
|
17
|
+
};
|
|
18
|
+
routes: ServerRouteManifest;
|
|
19
|
+
assets: AssetsManifest;
|
|
20
|
+
basename?: string;
|
|
21
|
+
publicPath: string;
|
|
22
|
+
assetsBuildDirectory: string;
|
|
23
|
+
future: FutureConfig;
|
|
24
|
+
ssr: boolean;
|
|
25
|
+
unstable_getCriticalCss?: (args: {
|
|
26
|
+
pathname: string;
|
|
27
|
+
}) => OptionalCriticalCss | Promise<OptionalCriticalCss>;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated This is now done via a custom header during prerendering
|
|
30
|
+
*/
|
|
31
|
+
isSpaMode: boolean;
|
|
32
|
+
prerender: string[];
|
|
33
|
+
routeDiscovery: {
|
|
34
|
+
mode: "lazy" | "initial";
|
|
35
|
+
manifestPath: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
interface HandleDocumentRequestFunction {
|
|
39
|
+
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: MiddlewareEnabled extends true ? RouterContextProvider : AppLoadContext): Promise<Response> | Response;
|
|
40
|
+
}
|
|
41
|
+
interface HandleDataRequestFunction {
|
|
42
|
+
(response: Response, args: LoaderFunctionArgs | ActionFunctionArgs): Promise<Response> | Response;
|
|
43
|
+
}
|
|
44
|
+
interface HandleErrorFunction {
|
|
45
|
+
(error: unknown, args: LoaderFunctionArgs | ActionFunctionArgs): void;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A module that serves as the entry point for a Remix app during server
|
|
49
|
+
* rendering.
|
|
50
|
+
*/
|
|
51
|
+
interface ServerEntryModule {
|
|
52
|
+
default: HandleDocumentRequestFunction;
|
|
53
|
+
handleDataRequest?: HandleDataRequestFunction;
|
|
54
|
+
handleError?: HandleErrorFunction;
|
|
55
|
+
streamTimeout?: number;
|
|
27
56
|
}
|
|
28
|
-
declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
|
|
29
|
-
declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
|
|
30
|
-
declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean;
|
|
31
57
|
|
|
32
58
|
type SerializedError = {
|
|
33
59
|
message: string;
|
|
@@ -81,68 +107,32 @@ interface AssetsManifest {
|
|
|
81
107
|
sri?: Record<string, string> | true;
|
|
82
108
|
}
|
|
83
109
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
type OptionalCriticalCss = CriticalCss | undefined;
|
|
91
|
-
/**
|
|
92
|
-
* The output of the compiler for the server build.
|
|
93
|
-
*/
|
|
94
|
-
interface ServerBuild {
|
|
95
|
-
entry: {
|
|
96
|
-
module: ServerEntryModule;
|
|
97
|
-
};
|
|
98
|
-
routes: ServerRouteManifest;
|
|
99
|
-
assets: AssetsManifest;
|
|
100
|
-
basename?: string;
|
|
101
|
-
publicPath: string;
|
|
102
|
-
assetsBuildDirectory: string;
|
|
103
|
-
future: FutureConfig;
|
|
104
|
-
ssr: boolean;
|
|
105
|
-
unstable_getCriticalCss?: (args: {
|
|
106
|
-
pathname: string;
|
|
107
|
-
}) => OptionalCriticalCss | Promise<OptionalCriticalCss>;
|
|
108
|
-
/**
|
|
109
|
-
* @deprecated This is now done via a custom header during prerendering
|
|
110
|
-
*/
|
|
111
|
-
isSpaMode: boolean;
|
|
112
|
-
prerender: string[];
|
|
113
|
-
routeDiscovery: {
|
|
114
|
-
mode: "lazy" | "initial";
|
|
115
|
-
manifestPath: string;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
interface HandleDocumentRequestFunction {
|
|
119
|
-
(request: Request, responseStatusCode: number, responseHeaders: Headers, context: EntryContext, loadContext: MiddlewareEnabled extends true ? RouterContextProvider : AppLoadContext): Promise<Response> | Response;
|
|
120
|
-
}
|
|
121
|
-
interface HandleDataRequestFunction {
|
|
122
|
-
(response: Response, args: {
|
|
123
|
-
request: LoaderFunctionArgs["request"] | ActionFunctionArgs["request"];
|
|
124
|
-
context: LoaderFunctionArgs["context"] | ActionFunctionArgs["context"];
|
|
125
|
-
params: LoaderFunctionArgs["params"] | ActionFunctionArgs["params"];
|
|
126
|
-
}): Promise<Response> | Response;
|
|
127
|
-
}
|
|
128
|
-
interface HandleErrorFunction {
|
|
129
|
-
(error: unknown, args: {
|
|
130
|
-
request: LoaderFunctionArgs["request"] | ActionFunctionArgs["request"];
|
|
131
|
-
context: LoaderFunctionArgs["context"] | ActionFunctionArgs["context"];
|
|
132
|
-
params: LoaderFunctionArgs["params"] | ActionFunctionArgs["params"];
|
|
133
|
-
}): void;
|
|
110
|
+
interface Route {
|
|
111
|
+
index?: boolean;
|
|
112
|
+
caseSensitive?: boolean;
|
|
113
|
+
id: string;
|
|
114
|
+
parentId?: string;
|
|
115
|
+
path?: string;
|
|
134
116
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
117
|
+
interface EntryRoute extends Route {
|
|
118
|
+
hasAction: boolean;
|
|
119
|
+
hasLoader: boolean;
|
|
120
|
+
hasClientAction: boolean;
|
|
121
|
+
hasClientLoader: boolean;
|
|
122
|
+
hasClientMiddleware: boolean;
|
|
123
|
+
hasErrorBoundary: boolean;
|
|
124
|
+
imports?: string[];
|
|
125
|
+
css?: string[];
|
|
126
|
+
module: string;
|
|
127
|
+
clientActionModule: string | undefined;
|
|
128
|
+
clientLoaderModule: string | undefined;
|
|
129
|
+
clientMiddlewareModule: string | undefined;
|
|
130
|
+
hydrateFallbackModule: string | undefined;
|
|
131
|
+
parentId?: string;
|
|
145
132
|
}
|
|
133
|
+
declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
|
|
134
|
+
declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
|
|
135
|
+
declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean;
|
|
146
136
|
|
|
147
137
|
type ParamKeyValuePair = [string, string];
|
|
148
138
|
type URLSearchParamsInit = string | ParamKeyValuePair[] | Record<string, string | string[]> | URLSearchParams;
|
|
@@ -531,58 +521,6 @@ interface DOMRouterOpts {
|
|
|
531
521
|
* ```
|
|
532
522
|
*/
|
|
533
523
|
hydrationData?: HydrationState;
|
|
534
|
-
/**
|
|
535
|
-
* Array of instrumentation objects allowing you to instrument the router and
|
|
536
|
-
* individual routes prior to router initialization (and on any subsequently
|
|
537
|
-
* added routes via `route.lazy` or `patchRoutesOnNavigation`). This is
|
|
538
|
-
* mostly useful for observability such as wrapping navigations, fetches,
|
|
539
|
-
* as well as route loaders/actions/middlewares with logging and/or performance
|
|
540
|
-
* tracing.
|
|
541
|
-
*
|
|
542
|
-
* ```tsx
|
|
543
|
-
* let router = createBrowserRouter(routes, {
|
|
544
|
-
* unstable_instrumentations: [logging]
|
|
545
|
-
* });
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
* let logging = {
|
|
549
|
-
* router({ instrument }) {
|
|
550
|
-
* instrument({
|
|
551
|
-
* navigate: (impl, info) => logExecution(`navigate ${info.to}`, impl),
|
|
552
|
-
* fetch: (impl, info) => logExecution(`fetch ${info.to}`, impl)
|
|
553
|
-
* });
|
|
554
|
-
* },
|
|
555
|
-
* route({ instrument, id }) {
|
|
556
|
-
* instrument({
|
|
557
|
-
* middleware: (impl, info) => logExecution(
|
|
558
|
-
* `middleware ${info.request.url} (route ${id})`,
|
|
559
|
-
* impl
|
|
560
|
-
* ),
|
|
561
|
-
* loader: (impl, info) => logExecution(
|
|
562
|
-
* `loader ${info.request.url} (route ${id})`,
|
|
563
|
-
* impl
|
|
564
|
-
* ),
|
|
565
|
-
* action: (impl, info) => logExecution(
|
|
566
|
-
* `action ${info.request.url} (route ${id})`,
|
|
567
|
-
* impl
|
|
568
|
-
* ),
|
|
569
|
-
* })
|
|
570
|
-
* }
|
|
571
|
-
* };
|
|
572
|
-
*
|
|
573
|
-
* async function logExecution(label: string, impl: () => Promise<void>) {
|
|
574
|
-
* let start = performance.now();
|
|
575
|
-
* console.log(`start ${label}`);
|
|
576
|
-
* try {
|
|
577
|
-
* await impl();
|
|
578
|
-
* } finally {
|
|
579
|
-
* let end = performance.now();
|
|
580
|
-
* console.log(`end ${label} (${Math.round(end - start)}ms)`);
|
|
581
|
-
* }
|
|
582
|
-
* }
|
|
583
|
-
* ```
|
|
584
|
-
*/
|
|
585
|
-
unstable_instrumentations?: unstable_ClientInstrumentation[];
|
|
586
524
|
/**
|
|
587
525
|
* Override the default data strategy of running loaders in parallel.
|
|
588
526
|
* See {@link DataStrategyFunction}.
|
|
@@ -1088,7 +1026,6 @@ interface DOMRouterOpts {
|
|
|
1088
1026
|
* @param {DOMRouterOpts.future} opts.future n/a
|
|
1089
1027
|
* @param {DOMRouterOpts.getContext} opts.getContext n/a
|
|
1090
1028
|
* @param {DOMRouterOpts.hydrationData} opts.hydrationData n/a
|
|
1091
|
-
* @param {DOMRouterOpts.unstable_instrumentations} opts.unstable_instrumentations n/a
|
|
1092
1029
|
* @param {DOMRouterOpts.patchRoutesOnNavigation} opts.patchRoutesOnNavigation n/a
|
|
1093
1030
|
* @param {DOMRouterOpts.window} opts.window n/a
|
|
1094
1031
|
* @returns An initialized {@link DataRouter| data router} to pass to {@link RouterProvider | `<RouterProvider>`}
|
|
@@ -1107,7 +1044,6 @@ declare function createBrowserRouter(routes: RouteObject[], opts?: DOMRouterOpts
|
|
|
1107
1044
|
* @param {DOMRouterOpts.future} opts.future n/a
|
|
1108
1045
|
* @param {DOMRouterOpts.getContext} opts.getContext n/a
|
|
1109
1046
|
* @param {DOMRouterOpts.hydrationData} opts.hydrationData n/a
|
|
1110
|
-
* @param {DOMRouterOpts.unstable_instrumentations} opts.unstable_instrumentations n/a
|
|
1111
1047
|
* @param {DOMRouterOpts.dataStrategy} opts.dataStrategy n/a
|
|
1112
1048
|
* @param {DOMRouterOpts.patchRoutesOnNavigation} opts.patchRoutesOnNavigation n/a
|
|
1113
1049
|
* @param {DOMRouterOpts.window} opts.window n/a
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-
|
|
1
|
+
export { aY as MemoryRouter, aZ as Navigate, a_ as Outlet, a$ as Route, b0 as Router, b1 as RouterProvider, b2 as Routes, aL as UNSAFE_AwaitContextProvider, bs as UNSAFE_WithComponentProps, bw as UNSAFE_WithErrorBoundaryProps, bu as UNSAFE_WithHydrateFallbackProps } from './route-data-nQS6GSUI.mjs';
|
|
2
|
+
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-CuQLmpku.mjs';
|
|
3
3
|
import 'react';
|
|
4
|
-
import './routeModules-Cy4Xsfoi.mjs';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-
|
|
1
|
+
export { aY as MemoryRouter, aZ as Navigate, a_ as Outlet, a$ as Route, b0 as Router, b1 as RouterProvider, b2 as Routes, aJ as UNSAFE_AwaitContextProvider, bs as UNSAFE_WithComponentProps, bw as UNSAFE_WithErrorBoundaryProps, bu as UNSAFE_WithHydrateFallbackProps } from './routeModules-9wlxglVk.js';
|
|
2
|
+
export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-BOJoTiaG.js';
|
|
3
3
|
import 'react';
|
|
4
|
-
import './instrumentation-BGrNA7uj.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-de3b900
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
var _chunkVX4OHTGRjs = require('./chunk-VX4OHTGR.js');
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
|
|
@@ -29,12 +30,11 @@
|
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
|
|
32
|
-
var _chunkDASXXYNZjs = require('./chunk-DASXXYNZ.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunk63YB5VLYjs = require('./chunk-63YB5VLY.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunkK7VXYOZDjs = require('./chunk-K7VXYOZD.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.BrowserRouter =
|
|
61
|
+
exports.BrowserRouter = _chunkVX4OHTGRjs.BrowserRouter; exports.Form = _chunkVX4OHTGRjs.Form; exports.HashRouter = _chunkVX4OHTGRjs.HashRouter; exports.Link = _chunkVX4OHTGRjs.Link; exports.Links = _chunk63YB5VLYjs.Links; exports.MemoryRouter = _chunk63YB5VLYjs.MemoryRouter; exports.Meta = _chunk63YB5VLYjs.Meta; exports.NavLink = _chunkVX4OHTGRjs.NavLink; exports.Navigate = _chunk63YB5VLYjs.Navigate; exports.Outlet = _chunk63YB5VLYjs.Outlet; exports.Route = _chunk63YB5VLYjs.Route; exports.Router = _chunk63YB5VLYjs.Router; exports.RouterProvider = _chunk63YB5VLYjs.RouterProvider; exports.Routes = _chunk63YB5VLYjs.Routes; exports.ScrollRestoration = _chunkVX4OHTGRjs.ScrollRestoration; exports.StaticRouter = _chunkVX4OHTGRjs.StaticRouter; exports.StaticRouterProvider = _chunkVX4OHTGRjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunk63YB5VLYjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunk63YB5VLYjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunk63YB5VLYjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunk63YB5VLYjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkVX4OHTGRjs.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-de3b900
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
WithComponentProps,
|
|
33
33
|
WithErrorBoundaryProps,
|
|
34
34
|
WithHydrateFallbackProps
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-U25H5FTL.mjs";
|
|
36
36
|
export {
|
|
37
37
|
BrowserRouter,
|
|
38
38
|
Form,
|