react-router 7.13.2 → 7.14.0
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 +67 -0
- package/dist/development/{browser-Bfn3xw9E.d.ts → browser-C9Ar1yxG.d.ts} +13 -10
- package/dist/development/{browser-Di6-vSl-.d.mts → browser-vtIR1Kpe.d.mts} +13 -10
- package/dist/development/{chunk-UALY5CBT.mjs → chunk-2UH5WJXA.mjs} +21 -7
- package/dist/development/{chunk-GO74ODU3.js → chunk-IK6APEEG.js} +191 -118
- package/dist/development/{chunk-HPFFRPKK.js → chunk-NXTEWSJO.js} +99 -99
- package/dist/development/{chunk-UVKPFVEO.mjs → chunk-QFMPRPBF.mjs} +192 -119
- package/dist/development/{chunk-LLP6DRWX.js → chunk-WAVMRYR2.js} +7 -7
- package/dist/development/dom-export.d.mts +1 -1
- package/dist/development/dom-export.d.ts +1 -1
- package/dist/development/dom-export.js +65 -54
- package/dist/development/dom-export.mjs +34 -23
- package/dist/{production/index-react-server-client-BcrVT7Dd.d.mts → development/index-react-server-client-BwWaHAr3.d.mts} +7 -5
- package/dist/development/{index-react-server-client-CCwMoQIT.d.ts → index-react-server-client-luDbagNU.d.ts} +7 -5
- package/dist/development/index-react-server-client.d.mts +1 -1
- package/dist/development/index-react-server-client.d.ts +1 -1
- 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 +12 -3
- package/dist/development/index-react-server.d.ts +12 -3
- package/dist/development/index-react-server.js +58 -18
- package/dist/development/index-react-server.mjs +58 -18
- package/dist/development/index.d.mts +4 -4
- package/dist/development/index.d.ts +4 -4
- package/dist/development/index.js +101 -87
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +10 -10
- package/dist/development/lib/types/internal.d.ts +10 -10
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/production/{browser-Bfn3xw9E.d.ts → browser-C9Ar1yxG.d.ts} +13 -10
- package/dist/production/{browser-Di6-vSl-.d.mts → browser-vtIR1Kpe.d.mts} +13 -10
- package/dist/production/{chunk-CAFVLUDY.js → chunk-355DUZMC.js} +7 -7
- package/dist/production/{chunk-LKUVSIBA.js → chunk-4TJ7T2OQ.js} +191 -118
- package/dist/production/{chunk-XAAX7KIK.js → chunk-FPT5DLVJ.js} +99 -99
- package/dist/production/{chunk-2BDJPJTA.mjs → chunk-HZQGQD2X.mjs} +192 -119
- package/dist/production/{chunk-PY35PE22.mjs → chunk-X5LK27NZ.mjs} +21 -7
- package/dist/production/dom-export.d.mts +1 -1
- package/dist/production/dom-export.d.ts +1 -1
- package/dist/production/dom-export.js +65 -54
- package/dist/production/dom-export.mjs +34 -23
- package/dist/{development/index-react-server-client-BcrVT7Dd.d.mts → production/index-react-server-client-BwWaHAr3.d.mts} +7 -5
- package/dist/production/{index-react-server-client-CCwMoQIT.d.ts → index-react-server-client-luDbagNU.d.ts} +7 -5
- package/dist/production/index-react-server-client.d.mts +1 -1
- package/dist/production/index-react-server-client.d.ts +1 -1
- 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 +12 -3
- package/dist/production/index-react-server.d.ts +12 -3
- package/dist/production/index-react-server.js +58 -18
- package/dist/production/index-react-server.mjs +58 -18
- package/dist/production/index.d.mts +4 -4
- package/dist/production/index.d.ts +4 -4
- package/dist/production/index.js +101 -87
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +10 -10
- package/dist/production/lib/types/internal.d.ts +10 -10
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.
|
|
2
|
+
* react-router v7.14.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
isSession,
|
|
29
29
|
routeRSCServerRequest,
|
|
30
30
|
setDevServerHooks
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-2UH5WJXA.mjs";
|
|
32
32
|
import {
|
|
33
33
|
Action,
|
|
34
34
|
Await,
|
|
@@ -141,7 +141,7 @@ import {
|
|
|
141
141
|
withComponentProps,
|
|
142
142
|
withErrorBoundaryProps,
|
|
143
143
|
withHydrateFallbackProps
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-QFMPRPBF.mjs";
|
|
145
145
|
export {
|
|
146
146
|
Await,
|
|
147
147
|
BrowserRouter,
|
|
@@ -68,12 +68,9 @@ type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["par
|
|
|
68
68
|
/** This is an asynchronous function that makes the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server action for this route. */
|
|
69
69
|
serverAction: () => Promise<ServerDataFrom<T["module"]["action"]>>;
|
|
70
70
|
};
|
|
71
|
-
type IsServerFirstRoute<T extends RouteInfo, RSCEnabled extends boolean> = RSCEnabled extends true ? T["module"] extends {
|
|
72
|
-
ServerComponent: Func;
|
|
73
|
-
} ? true : false : false;
|
|
74
71
|
type CreateHydrateFallbackProps<T extends RouteInfo, RSCEnabled extends boolean> = {
|
|
75
72
|
params: T["params"];
|
|
76
|
-
} & (
|
|
73
|
+
} & (RSCEnabled extends true ? {
|
|
77
74
|
/** The data returned from the `loader` */
|
|
78
75
|
loaderData?: ServerDataFrom<T["module"]["loader"]>;
|
|
79
76
|
/** The data returned from the `action` following an action submission. */
|
|
@@ -112,7 +109,7 @@ type CreateComponentProps<T extends RouteInfo, RSCEnabled extends boolean> = {
|
|
|
112
109
|
params: T["params"];
|
|
113
110
|
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react-router.UIMatch.html route matches}, including parent route matches. */
|
|
114
111
|
matches: Matches<T["matches"]>;
|
|
115
|
-
} & (
|
|
112
|
+
} & (RSCEnabled extends true ? {
|
|
116
113
|
/** The data returned from the `loader` */
|
|
117
114
|
loaderData: ServerDataFrom<T["module"]["loader"]>;
|
|
118
115
|
/** The data returned from the `action` following an action submission. */
|
|
@@ -140,7 +137,7 @@ type CreateErrorBoundaryProps<T extends RouteInfo, RSCEnabled extends boolean> =
|
|
|
140
137
|
**/
|
|
141
138
|
params: T["params"];
|
|
142
139
|
error: unknown;
|
|
143
|
-
} & (
|
|
140
|
+
} & (RSCEnabled extends true ? {
|
|
144
141
|
/** The data returned from the `loader` */
|
|
145
142
|
loaderData?: ServerDataFrom<T["module"]["loader"]>;
|
|
146
143
|
/** The data returned from the `action` following an action submission. */
|
|
@@ -151,7 +148,7 @@ type CreateErrorBoundaryProps<T extends RouteInfo, RSCEnabled extends boolean> =
|
|
|
151
148
|
/** The data returned from the `action` or `clientAction` following an action submission. */
|
|
152
149
|
actionData?: T["actionData"];
|
|
153
150
|
});
|
|
154
|
-
type GetAnnotations<Info extends RouteInfo
|
|
151
|
+
type GetAnnotations<Info extends RouteInfo> = {
|
|
155
152
|
LinkDescriptors: LinkDescriptor[];
|
|
156
153
|
LinksFunction: () => LinkDescriptor[];
|
|
157
154
|
MetaArgs: CreateMetaArgs<Info>;
|
|
@@ -165,9 +162,12 @@ type GetAnnotations<Info extends RouteInfo, RSCEnabled extends boolean> = {
|
|
|
165
162
|
ClientLoaderArgs: CreateClientLoaderArgs<Info>;
|
|
166
163
|
ActionArgs: CreateServerActionArgs<Info>;
|
|
167
164
|
ClientActionArgs: CreateClientActionArgs<Info>;
|
|
168
|
-
HydrateFallbackProps: CreateHydrateFallbackProps<Info,
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
HydrateFallbackProps: CreateHydrateFallbackProps<Info, false>;
|
|
166
|
+
ServerHydrateFallbackProps: CreateHydrateFallbackProps<Info, true>;
|
|
167
|
+
ComponentProps: CreateComponentProps<Info, false>;
|
|
168
|
+
ServerComponentProps: CreateComponentProps<Info, true>;
|
|
169
|
+
ErrorBoundaryProps: CreateErrorBoundaryProps<Info, false>;
|
|
170
|
+
ServerErrorBoundaryProps: CreateErrorBoundaryProps<Info, true>;
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
|
|
@@ -68,12 +68,9 @@ type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["par
|
|
|
68
68
|
/** This is an asynchronous function that makes the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server action for this route. */
|
|
69
69
|
serverAction: () => Promise<ServerDataFrom<T["module"]["action"]>>;
|
|
70
70
|
};
|
|
71
|
-
type IsServerFirstRoute<T extends RouteInfo, RSCEnabled extends boolean> = RSCEnabled extends true ? T["module"] extends {
|
|
72
|
-
ServerComponent: Func;
|
|
73
|
-
} ? true : false : false;
|
|
74
71
|
type CreateHydrateFallbackProps<T extends RouteInfo, RSCEnabled extends boolean> = {
|
|
75
72
|
params: T["params"];
|
|
76
|
-
} & (
|
|
73
|
+
} & (RSCEnabled extends true ? {
|
|
77
74
|
/** The data returned from the `loader` */
|
|
78
75
|
loaderData?: ServerDataFrom<T["module"]["loader"]>;
|
|
79
76
|
/** The data returned from the `action` following an action submission. */
|
|
@@ -112,7 +109,7 @@ type CreateComponentProps<T extends RouteInfo, RSCEnabled extends boolean> = {
|
|
|
112
109
|
params: T["params"];
|
|
113
110
|
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react-router.UIMatch.html route matches}, including parent route matches. */
|
|
114
111
|
matches: Matches<T["matches"]>;
|
|
115
|
-
} & (
|
|
112
|
+
} & (RSCEnabled extends true ? {
|
|
116
113
|
/** The data returned from the `loader` */
|
|
117
114
|
loaderData: ServerDataFrom<T["module"]["loader"]>;
|
|
118
115
|
/** The data returned from the `action` following an action submission. */
|
|
@@ -140,7 +137,7 @@ type CreateErrorBoundaryProps<T extends RouteInfo, RSCEnabled extends boolean> =
|
|
|
140
137
|
**/
|
|
141
138
|
params: T["params"];
|
|
142
139
|
error: unknown;
|
|
143
|
-
} & (
|
|
140
|
+
} & (RSCEnabled extends true ? {
|
|
144
141
|
/** The data returned from the `loader` */
|
|
145
142
|
loaderData?: ServerDataFrom<T["module"]["loader"]>;
|
|
146
143
|
/** The data returned from the `action` following an action submission. */
|
|
@@ -151,7 +148,7 @@ type CreateErrorBoundaryProps<T extends RouteInfo, RSCEnabled extends boolean> =
|
|
|
151
148
|
/** The data returned from the `action` or `clientAction` following an action submission. */
|
|
152
149
|
actionData?: T["actionData"];
|
|
153
150
|
});
|
|
154
|
-
type GetAnnotations<Info extends RouteInfo
|
|
151
|
+
type GetAnnotations<Info extends RouteInfo> = {
|
|
155
152
|
LinkDescriptors: LinkDescriptor[];
|
|
156
153
|
LinksFunction: () => LinkDescriptor[];
|
|
157
154
|
MetaArgs: CreateMetaArgs<Info>;
|
|
@@ -165,9 +162,12 @@ type GetAnnotations<Info extends RouteInfo, RSCEnabled extends boolean> = {
|
|
|
165
162
|
ClientLoaderArgs: CreateClientLoaderArgs<Info>;
|
|
166
163
|
ActionArgs: CreateServerActionArgs<Info>;
|
|
167
164
|
ClientActionArgs: CreateClientActionArgs<Info>;
|
|
168
|
-
HydrateFallbackProps: CreateHydrateFallbackProps<Info,
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
HydrateFallbackProps: CreateHydrateFallbackProps<Info, false>;
|
|
166
|
+
ServerHydrateFallbackProps: CreateHydrateFallbackProps<Info, true>;
|
|
167
|
+
ComponentProps: CreateComponentProps<Info, false>;
|
|
168
|
+
ServerComponentProps: CreateComponentProps<Info, true>;
|
|
169
|
+
ErrorBoundaryProps: CreateErrorBoundaryProps<Info, false>;
|
|
170
|
+
ServerErrorBoundaryProps: CreateErrorBoundaryProps<Info, true>;
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
|
|
@@ -65,14 +65,15 @@ type RSCRenderPayload = {
|
|
|
65
65
|
errors: Record<string, any> | null;
|
|
66
66
|
loaderData: Record<string, any>;
|
|
67
67
|
location: Location;
|
|
68
|
+
routeDiscovery: RouteDiscovery;
|
|
68
69
|
matches: RSCRouteMatch[];
|
|
69
|
-
patches?: RSCRouteManifest[]
|
|
70
|
+
patches?: Promise<RSCRouteManifest[]>;
|
|
70
71
|
nonce?: string;
|
|
71
72
|
formState?: unknown;
|
|
72
73
|
};
|
|
73
74
|
type RSCManifestPayload = {
|
|
74
75
|
type: "manifest";
|
|
75
|
-
patches: RSCRouteManifest[]
|
|
76
|
+
patches: Promise<RSCRouteManifest[]>;
|
|
76
77
|
};
|
|
77
78
|
type RSCActionPayload = {
|
|
78
79
|
type: "action";
|
|
@@ -99,6 +100,12 @@ type DecodeReplyFunction = (reply: FormData | string, options: {
|
|
|
99
100
|
temporaryReferences: unknown;
|
|
100
101
|
}) => Promise<unknown[]>;
|
|
101
102
|
type LoadServerActionFunction = (id: string) => Promise<Function>;
|
|
103
|
+
type RouteDiscovery = {
|
|
104
|
+
mode: "lazy";
|
|
105
|
+
manifestPath?: string | undefined;
|
|
106
|
+
} | {
|
|
107
|
+
mode: "initial";
|
|
108
|
+
};
|
|
102
109
|
/**
|
|
103
110
|
* Matches the given routes to a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
|
|
104
111
|
* and returns an [RSC](https://react.dev/reference/rsc/server-components)
|
|
@@ -165,12 +172,13 @@ type LoadServerActionFunction = (id: string) => Promise<Function>;
|
|
|
165
172
|
* @param opts.requestContext An instance of {@link RouterContextProvider}
|
|
166
173
|
* that should be created per request, to be passed to [`action`](../../start/data/route-object#action)s,
|
|
167
174
|
* [`loader`](../../start/data/route-object#loader)s and [middleware](../../how-to/middleware).
|
|
175
|
+
* @param opts.routeDiscovery The route discovery configuration, used to determine how the router should discover new routes during navigations.
|
|
168
176
|
* @param opts.routes Your {@link unstable_RSCRouteConfigEntry | route definitions}.
|
|
169
177
|
* @returns A [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
|
|
170
178
|
* that contains the [RSC](https://react.dev/reference/rsc/server-components)
|
|
171
179
|
* data for hydration.
|
|
172
180
|
*/
|
|
173
|
-
declare function matchRSCServerRequest({ allowedActionOrigins, createTemporaryReferenceSet, basename, decodeReply, requestContext, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
|
|
181
|
+
declare function matchRSCServerRequest({ allowedActionOrigins, createTemporaryReferenceSet, basename, decodeReply, requestContext, routeDiscovery, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
|
|
174
182
|
allowedActionOrigins?: string[];
|
|
175
183
|
createTemporaryReferenceSet: () => unknown;
|
|
176
184
|
basename?: string;
|
|
@@ -182,6 +190,7 @@ declare function matchRSCServerRequest({ allowedActionOrigins, createTemporaryRe
|
|
|
182
190
|
onError?: (error: unknown) => void;
|
|
183
191
|
request: Request;
|
|
184
192
|
routes: RSCRouteConfigEntry[];
|
|
193
|
+
routeDiscovery?: RouteDiscovery;
|
|
185
194
|
generateResponse: (match: RSCMatch, { onError, temporaryReferences, }: {
|
|
186
195
|
onError(error: unknown): string | undefined;
|
|
187
196
|
temporaryReferences: unknown;
|
|
@@ -256,11 +265,6 @@ interface RSCHydratedRouterProps {
|
|
|
256
265
|
* The decoded {@link unstable_RSCPayload} to hydrate.
|
|
257
266
|
*/
|
|
258
267
|
payload: RSCPayload;
|
|
259
|
-
/**
|
|
260
|
-
* `"eager"` or `"lazy"` - Determines if links are eagerly discovered, or
|
|
261
|
-
* delayed until clicked.
|
|
262
|
-
*/
|
|
263
|
-
routeDiscovery?: "eager" | "lazy";
|
|
264
268
|
/**
|
|
265
269
|
* A function that returns an {@link RouterContextProvider} instance
|
|
266
270
|
* which is provided as the `context` argument to client [`action`](../../start/data/route-object#action)s,
|
|
@@ -306,10 +310,9 @@ interface RSCHydratedRouterProps {
|
|
|
306
310
|
* @param {unstable_RSCHydratedRouterProps.fetch} props.fetch n/a
|
|
307
311
|
* @param {unstable_RSCHydratedRouterProps.getContext} props.getContext n/a
|
|
308
312
|
* @param {unstable_RSCHydratedRouterProps.payload} props.payload n/a
|
|
309
|
-
* @param {unstable_RSCHydratedRouterProps.routeDiscovery} props.routeDiscovery n/a
|
|
310
313
|
* @returns A hydrated {@link DataRouter} that can be used to navigate and
|
|
311
314
|
* render routes.
|
|
312
315
|
*/
|
|
313
|
-
declare function RSCHydratedRouter({ createFromReadableStream, fetch: fetchImplementation, payload,
|
|
316
|
+
declare function RSCHydratedRouter({ createFromReadableStream, fetch: fetchImplementation, payload, getContext, }: RSCHydratedRouterProps): React.JSX.Element;
|
|
314
317
|
|
|
315
318
|
export { type BrowserCreateFromReadableStreamFunction as B, type DecodeActionFunction as D, type EncodeReplyFunction as E, type LoadServerActionFunction as L, RSCHydratedRouter as R, type DecodeFormStateFunction as a, type DecodeReplyFunction as b, createCallServer as c, type RSCManifestPayload as d, type RSCPayload as e, type RSCRenderPayload as f, getRequest as g, type RSCHydratedRouterProps as h, type RSCMatch as i, type RSCRouteManifest as j, type RSCRouteMatch as k, type RSCRouteConfigEntry as l, matchRSCServerRequest as m, type RSCRouteConfig as n };
|
|
@@ -65,14 +65,15 @@ type RSCRenderPayload = {
|
|
|
65
65
|
errors: Record<string, any> | null;
|
|
66
66
|
loaderData: Record<string, any>;
|
|
67
67
|
location: Location;
|
|
68
|
+
routeDiscovery: RouteDiscovery;
|
|
68
69
|
matches: RSCRouteMatch[];
|
|
69
|
-
patches?: RSCRouteManifest[]
|
|
70
|
+
patches?: Promise<RSCRouteManifest[]>;
|
|
70
71
|
nonce?: string;
|
|
71
72
|
formState?: unknown;
|
|
72
73
|
};
|
|
73
74
|
type RSCManifestPayload = {
|
|
74
75
|
type: "manifest";
|
|
75
|
-
patches: RSCRouteManifest[]
|
|
76
|
+
patches: Promise<RSCRouteManifest[]>;
|
|
76
77
|
};
|
|
77
78
|
type RSCActionPayload = {
|
|
78
79
|
type: "action";
|
|
@@ -99,6 +100,12 @@ type DecodeReplyFunction = (reply: FormData | string, options: {
|
|
|
99
100
|
temporaryReferences: unknown;
|
|
100
101
|
}) => Promise<unknown[]>;
|
|
101
102
|
type LoadServerActionFunction = (id: string) => Promise<Function>;
|
|
103
|
+
type RouteDiscovery = {
|
|
104
|
+
mode: "lazy";
|
|
105
|
+
manifestPath?: string | undefined;
|
|
106
|
+
} | {
|
|
107
|
+
mode: "initial";
|
|
108
|
+
};
|
|
102
109
|
/**
|
|
103
110
|
* Matches the given routes to a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request)
|
|
104
111
|
* and returns an [RSC](https://react.dev/reference/rsc/server-components)
|
|
@@ -165,12 +172,13 @@ type LoadServerActionFunction = (id: string) => Promise<Function>;
|
|
|
165
172
|
* @param opts.requestContext An instance of {@link RouterContextProvider}
|
|
166
173
|
* that should be created per request, to be passed to [`action`](../../start/data/route-object#action)s,
|
|
167
174
|
* [`loader`](../../start/data/route-object#loader)s and [middleware](../../how-to/middleware).
|
|
175
|
+
* @param opts.routeDiscovery The route discovery configuration, used to determine how the router should discover new routes during navigations.
|
|
168
176
|
* @param opts.routes Your {@link unstable_RSCRouteConfigEntry | route definitions}.
|
|
169
177
|
* @returns A [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
|
|
170
178
|
* that contains the [RSC](https://react.dev/reference/rsc/server-components)
|
|
171
179
|
* data for hydration.
|
|
172
180
|
*/
|
|
173
|
-
declare function matchRSCServerRequest({ allowedActionOrigins, createTemporaryReferenceSet, basename, decodeReply, requestContext, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
|
|
181
|
+
declare function matchRSCServerRequest({ allowedActionOrigins, createTemporaryReferenceSet, basename, decodeReply, requestContext, routeDiscovery, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
|
|
174
182
|
allowedActionOrigins?: string[];
|
|
175
183
|
createTemporaryReferenceSet: () => unknown;
|
|
176
184
|
basename?: string;
|
|
@@ -182,6 +190,7 @@ declare function matchRSCServerRequest({ allowedActionOrigins, createTemporaryRe
|
|
|
182
190
|
onError?: (error: unknown) => void;
|
|
183
191
|
request: Request;
|
|
184
192
|
routes: RSCRouteConfigEntry[];
|
|
193
|
+
routeDiscovery?: RouteDiscovery;
|
|
185
194
|
generateResponse: (match: RSCMatch, { onError, temporaryReferences, }: {
|
|
186
195
|
onError(error: unknown): string | undefined;
|
|
187
196
|
temporaryReferences: unknown;
|
|
@@ -256,11 +265,6 @@ interface RSCHydratedRouterProps {
|
|
|
256
265
|
* The decoded {@link unstable_RSCPayload} to hydrate.
|
|
257
266
|
*/
|
|
258
267
|
payload: RSCPayload;
|
|
259
|
-
/**
|
|
260
|
-
* `"eager"` or `"lazy"` - Determines if links are eagerly discovered, or
|
|
261
|
-
* delayed until clicked.
|
|
262
|
-
*/
|
|
263
|
-
routeDiscovery?: "eager" | "lazy";
|
|
264
268
|
/**
|
|
265
269
|
* A function that returns an {@link RouterContextProvider} instance
|
|
266
270
|
* which is provided as the `context` argument to client [`action`](../../start/data/route-object#action)s,
|
|
@@ -306,10 +310,9 @@ interface RSCHydratedRouterProps {
|
|
|
306
310
|
* @param {unstable_RSCHydratedRouterProps.fetch} props.fetch n/a
|
|
307
311
|
* @param {unstable_RSCHydratedRouterProps.getContext} props.getContext n/a
|
|
308
312
|
* @param {unstable_RSCHydratedRouterProps.payload} props.payload n/a
|
|
309
|
-
* @param {unstable_RSCHydratedRouterProps.routeDiscovery} props.routeDiscovery n/a
|
|
310
313
|
* @returns A hydrated {@link DataRouter} that can be used to navigate and
|
|
311
314
|
* render routes.
|
|
312
315
|
*/
|
|
313
|
-
declare function RSCHydratedRouter({ createFromReadableStream, fetch: fetchImplementation, payload,
|
|
316
|
+
declare function RSCHydratedRouter({ createFromReadableStream, fetch: fetchImplementation, payload, getContext, }: RSCHydratedRouterProps): React.JSX.Element;
|
|
314
317
|
|
|
315
318
|
export { type BrowserCreateFromReadableStreamFunction as B, type DecodeActionFunction as D, type EncodeReplyFunction as E, type LoadServerActionFunction as L, RSCHydratedRouter as R, type DecodeFormStateFunction as a, type DecodeReplyFunction as b, createCallServer as c, type RSCManifestPayload as d, type RSCPayload as e, type RSCRenderPayload as f, getRequest as g, type RSCHydratedRouterProps as h, type RSCMatch as i, type RSCRouteManifest as j, type RSCRouteMatch as k, type RSCRouteConfigEntry as l, matchRSCServerRequest as m, type RSCRouteConfig as n };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
|
|
2
|
-
* react-router v7.
|
|
2
|
+
* react-router v7.14.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk4TJ7T2OQjs = require('./chunk-4TJ7T2OQ.js');
|
|
18
18
|
|
|
19
19
|
// lib/dom/ssr/hydration.tsx
|
|
20
20
|
function getHydrationData({
|
|
@@ -29,12 +29,12 @@ function getHydrationData({
|
|
|
29
29
|
...state,
|
|
30
30
|
loaderData: { ...state.loaderData }
|
|
31
31
|
};
|
|
32
|
-
let initialMatches =
|
|
32
|
+
let initialMatches = _chunk4TJ7T2OQjs.matchRoutes.call(void 0, routes, location, basename);
|
|
33
33
|
if (initialMatches) {
|
|
34
34
|
for (let match of initialMatches) {
|
|
35
35
|
let routeId = match.route.id;
|
|
36
36
|
let routeInfo = getRouteInfo(routeId);
|
|
37
|
-
if (
|
|
37
|
+
if (_chunk4TJ7T2OQjs.shouldHydrateRouteLoader.call(void 0,
|
|
38
38
|
routeId,
|
|
39
39
|
routeInfo.clientLoader,
|
|
40
40
|
routeInfo.hasLoader,
|
|
@@ -112,7 +112,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
|
-
if (
|
|
115
|
+
if (_chunk4TJ7T2OQjs.isRouteErrorResponse.call(void 0, error)) {
|
|
116
116
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
117
117
|
ErrorWrapper,
|
|
118
118
|
{
|
|
@@ -120,7 +120,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
120
120
|
title: "Unhandled Thrown Response!"
|
|
121
121
|
},
|
|
122
122
|
/* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
123
|
-
|
|
123
|
+
_chunk4TJ7T2OQjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
let errorInstance;
|
|
@@ -146,7 +146,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
146
146
|
function RSCDefaultRootErrorBoundary({
|
|
147
147
|
hasRootLayout
|
|
148
148
|
}) {
|
|
149
|
-
let error =
|
|
149
|
+
let error = _chunk4TJ7T2OQjs.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|