react-router 0.0.0-experimental-567b27f71 → 0.0.0-experimental-58b44aa83
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 +52 -0
- package/dist/development/{browser-Bfn3xw9E.d.ts → browser-C9Ar1yxG.d.ts} +13 -10
- package/dist/development/{browser-BUb__T3u.d.mts → browser-vtIR1Kpe.d.mts} +14 -11
- package/dist/development/{chunk-MFSTD5J4.mjs → chunk-5AVCKGCU.mjs} +64 -19
- package/dist/development/{chunk-T2TDL4ZI.mjs → chunk-6TM67YJ5.mjs} +21 -7
- package/dist/{production/chunk-ONKPUZLV.js → development/chunk-KHCIEBEF.js} +7 -7
- package/dist/{production/chunk-Y4BW72NR.js → development/chunk-SVGRUSZL.js} +99 -99
- package/dist/development/{chunk-XLC5DWBP.js → chunk-WV6HWEIS.js} +64 -19
- package/dist/{production/context-kw54iBKW.d.mts → development/context-phCt_zmH.d.mts} +1 -1
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +1 -1
- package/dist/development/dom-export.js +78 -53
- package/dist/development/dom-export.mjs +48 -23
- package/dist/development/{index-react-server-client-CtQKvWuW.d.ts → index-react-server-client-C41e-M56.d.ts} +4 -4
- package/dist/{production/index-react-server-client-CmqQRyrG.d.mts → development/index-react-server-client-DB0NZKUQ.d.mts} +4 -4
- package/dist/development/index-react-server-client.d.mts +2 -2
- 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 +82 -40
- package/dist/development/index-react-server.mjs +82 -40
- package/dist/development/index.d.mts +10 -10
- package/dist/development/index.d.ts +8 -8
- 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-BUb__T3u.d.mts → browser-vtIR1Kpe.d.mts} +14 -11
- package/dist/production/{chunk-7CRO7VK3.js → chunk-AFBUA5Y5.js} +64 -19
- package/dist/production/{chunk-JCFT2HBB.mjs → chunk-B53VLDMB.mjs} +64 -19
- package/dist/{development/chunk-3KQWMVH5.js → production/chunk-PZICA6SF.js} +99 -99
- package/dist/production/{chunk-OZOQN5MO.mjs → chunk-RPK2B53V.mjs} +21 -7
- package/dist/{development/chunk-FITK2GBN.js → production/chunk-TN7VWBEQ.js} +7 -7
- package/dist/{development/context-kw54iBKW.d.mts → production/context-phCt_zmH.d.mts} +1 -1
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +1 -1
- package/dist/production/dom-export.js +78 -53
- package/dist/production/dom-export.mjs +48 -23
- package/dist/production/{index-react-server-client-CtQKvWuW.d.ts → index-react-server-client-C41e-M56.d.ts} +4 -4
- package/dist/{development/index-react-server-client-CmqQRyrG.d.mts → production/index-react-server-client-DB0NZKUQ.d.mts} +4 -4
- package/dist/production/index-react-server-client.d.mts +2 -2
- 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 +82 -40
- package/dist/production/index-react-server.mjs +82 -40
- package/dist/production/index.d.mts +10 -10
- package/dist/production/index.d.ts +8 -8
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
+
## 7.13.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix clientLoader.hydrate when an ancestor route is also hydrating a clientLoader ([#14835](https://github.com/remix-run/react-router/pull/14835))
|
|
8
|
+
|
|
9
|
+
- Fix type error when passing Framework Mode route components using `Route.ComponentProps` to `createRoutesStub` ([#14892](https://github.com/remix-run/react-router/pull/14892))
|
|
10
|
+
|
|
11
|
+
- Fix percent encoding in relative path navigation ([#14786](https://github.com/remix-run/react-router/pull/14786))
|
|
12
|
+
|
|
13
|
+
- Add `future.unstable_passThroughRequests` flag ([#14775](https://github.com/remix-run/react-router/pull/14775))
|
|
14
|
+
|
|
15
|
+
By default, React Router normalizes the `request.url` passed to your `loader`, `action`, and `middleware` functions by removing React Router's internal implementation details (`.data` suffixes, `index` + `_routes` query params).
|
|
16
|
+
|
|
17
|
+
Enabling this flag removes that normalization and passes the raw HTTP `request` instance to your handlers. This provides a few benefits:
|
|
18
|
+
- Reduces server-side overhead by eliminating multiple `new Request()` calls on the critical path
|
|
19
|
+
- Allows you to distinguish document from data requests in your handlers base don the presence of a `.data` suffix (useful for observability purposes)
|
|
20
|
+
|
|
21
|
+
If you were previously relying on the normalization of `request.url`, you can switch to use the new sibling `unstable_url` parameter which contains a `URL` instance representing the normalized location:
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
// ❌ Before: you could assume there was no `.data` suffix in `request.url`
|
|
25
|
+
export async function loader({ request }: Route.LoaderArgs) {
|
|
26
|
+
let url = new URL(request.url);
|
|
27
|
+
if (url.pathname === "/path") {
|
|
28
|
+
// This check will fail with the flag enabled because the `.data` suffix will
|
|
29
|
+
// exist on data requests
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ✅ After: use `unstable_url` for normalized routing logic and `request.url`
|
|
34
|
+
// for raw routing logic
|
|
35
|
+
export async function loader({ request, unstable_url }: Route.LoaderArgs) {
|
|
36
|
+
if (unstable_url.pathname === "/path") {
|
|
37
|
+
// This will always have the `.data` suffix stripped
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// And now you can distinguish between document versus data requests
|
|
41
|
+
let isDataRequest = new URL(request.url).pathname.endsWith(".data");
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- Internal refactor to consolidate framework-agnostic/React-specific route type layers - no public API changes ([#14765](https://github.com/remix-run/react-router/pull/14765))
|
|
46
|
+
|
|
47
|
+
- Sync protocol validation to rsc flows ([#14882](https://github.com/remix-run/react-router/pull/14882))
|
|
48
|
+
|
|
49
|
+
- Add a new `unstable_url: URL` parameter to route handler methods (`loader`, `action`, `middleware`, etc.) representing the normalized URL the application is navigating to or fetching, with React Router implementation details removed (`.data`suffix, `index`/`_routes` query params) ([#14775](https://github.com/remix-run/react-router/pull/14775))
|
|
50
|
+
|
|
51
|
+
This is being added alongside the new `future.unstable_passthroughRequests` future flag so that users still have a way to access the normalized URL when that flag is enabled and non-normalized `request`'s are being passed to your handlers. When adopting this flag, you will only need to start leveraging this new parameter if you are relying on the normalization of `request.url` in your application code.
|
|
52
|
+
|
|
53
|
+
If you don't have the flag enabled, then `unstable_url` will match `request.url`.
|
|
54
|
+
|
|
3
55
|
## 7.13.1
|
|
4
56
|
|
|
5
57
|
### Patch Changes
|
|
@@ -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
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterInit } from './context-
|
|
2
|
+
import { R as RouterInit } from './context-phCt_zmH.mjs';
|
|
3
3
|
import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction } from './routeModules-BRrCYrSL.mjs';
|
|
4
4
|
|
|
5
5
|
declare function getRequest(): Request;
|
|
@@ -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
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-58b44aa83
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -5000,20 +5000,20 @@ function normalizeRelativeRoutingRedirectResponse(response, request, routeId, ma
|
|
|
5000
5000
|
}
|
|
5001
5001
|
return response;
|
|
5002
5002
|
}
|
|
5003
|
+
var invalidProtocols = [
|
|
5004
|
+
"about:",
|
|
5005
|
+
"blob:",
|
|
5006
|
+
"chrome:",
|
|
5007
|
+
"chrome-untrusted:",
|
|
5008
|
+
"content:",
|
|
5009
|
+
"data:",
|
|
5010
|
+
"devtools:",
|
|
5011
|
+
"file:",
|
|
5012
|
+
"filesystem:",
|
|
5013
|
+
// eslint-disable-next-line no-script-url
|
|
5014
|
+
"javascript:"
|
|
5015
|
+
];
|
|
5003
5016
|
function normalizeRedirectLocation(location, currentUrl, basename, historyInstance) {
|
|
5004
|
-
let invalidProtocols = [
|
|
5005
|
-
"about:",
|
|
5006
|
-
"blob:",
|
|
5007
|
-
"chrome:",
|
|
5008
|
-
"chrome-untrusted:",
|
|
5009
|
-
"content:",
|
|
5010
|
-
"data:",
|
|
5011
|
-
"devtools:",
|
|
5012
|
-
"file:",
|
|
5013
|
-
"filesystem:",
|
|
5014
|
-
// eslint-disable-next-line no-script-url
|
|
5015
|
-
"javascript:"
|
|
5016
|
-
];
|
|
5017
5017
|
if (isAbsoluteUrl(location)) {
|
|
5018
5018
|
let normalizedLocation = location;
|
|
5019
5019
|
let url = normalizedLocation.startsWith("//") ? new URL(currentUrl.protocol + normalizedLocation) : new URL(normalizedLocation);
|
|
@@ -5812,21 +5812,21 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
5812
5812
|
pathname: joinPaths([
|
|
5813
5813
|
parentPathnameBase,
|
|
5814
5814
|
// Re-encode pathnames that were decoded inside matchRoutes.
|
|
5815
|
-
// Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
|
|
5815
|
+
// Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
|
|
5816
5816
|
// `new URL()` internally and we need to prevent it from treating
|
|
5817
5817
|
// them as separators
|
|
5818
5818
|
navigator.encodeLocation ? navigator.encodeLocation(
|
|
5819
|
-
match.pathname.replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
5819
|
+
match.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
5820
5820
|
).pathname : match.pathname
|
|
5821
5821
|
]),
|
|
5822
5822
|
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([
|
|
5823
5823
|
parentPathnameBase,
|
|
5824
5824
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
5825
|
-
// Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
|
|
5825
|
+
// Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
|
|
5826
5826
|
// `new URL()` internally and we need to prevent it from treating
|
|
5827
5827
|
// them as separators
|
|
5828
5828
|
navigator.encodeLocation ? navigator.encodeLocation(
|
|
5829
|
-
match.pathnameBase.replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
5829
|
+
match.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
5830
5830
|
).pathname : match.pathnameBase
|
|
5831
5831
|
])
|
|
5832
5832
|
})
|
|
@@ -9420,6 +9420,7 @@ function Links({ nonce, crossOrigin }) {
|
|
|
9420
9420
|
));
|
|
9421
9421
|
}
|
|
9422
9422
|
function PrefetchPageLinks({ page, ...linkProps }) {
|
|
9423
|
+
let rsc = useIsRSCRouterContext();
|
|
9423
9424
|
let { router } = useDataRouterContext2();
|
|
9424
9425
|
let matches = React8.useMemo(
|
|
9425
9426
|
() => matchRoutes(router.routes, page, router.basename),
|
|
@@ -9428,6 +9429,9 @@ function PrefetchPageLinks({ page, ...linkProps }) {
|
|
|
9428
9429
|
if (!matches) {
|
|
9429
9430
|
return null;
|
|
9430
9431
|
}
|
|
9432
|
+
if (rsc) {
|
|
9433
|
+
return /* @__PURE__ */ React8.createElement(RSCPrefetchPageLinksImpl, { page, matches, ...linkProps });
|
|
9434
|
+
}
|
|
9431
9435
|
return /* @__PURE__ */ React8.createElement(PrefetchPageLinksImpl, { page, matches, ...linkProps });
|
|
9432
9436
|
}
|
|
9433
9437
|
function useKeyedPrefetchLinks(matches) {
|
|
@@ -9448,6 +9452,46 @@ function useKeyedPrefetchLinks(matches) {
|
|
|
9448
9452
|
}, [matches, manifest, routeModules]);
|
|
9449
9453
|
return keyedPrefetchLinks;
|
|
9450
9454
|
}
|
|
9455
|
+
function RSCPrefetchPageLinksImpl({
|
|
9456
|
+
page,
|
|
9457
|
+
matches: nextMatches,
|
|
9458
|
+
...linkProps
|
|
9459
|
+
}) {
|
|
9460
|
+
let location = useLocation();
|
|
9461
|
+
let { future } = useFrameworkContext();
|
|
9462
|
+
let { basename } = useDataRouterContext2();
|
|
9463
|
+
let dataHrefs = React8.useMemo(() => {
|
|
9464
|
+
if (page === location.pathname + location.search + location.hash) {
|
|
9465
|
+
return [];
|
|
9466
|
+
}
|
|
9467
|
+
let url = singleFetchUrl(
|
|
9468
|
+
page,
|
|
9469
|
+
basename,
|
|
9470
|
+
future.unstable_trailingSlashAwareDataRequests,
|
|
9471
|
+
"rsc"
|
|
9472
|
+
);
|
|
9473
|
+
let hasSomeRoutesWithShouldRevalidate = false;
|
|
9474
|
+
let targetRoutes = [];
|
|
9475
|
+
for (let match of nextMatches) {
|
|
9476
|
+
if (typeof match.route.shouldRevalidate === "function") {
|
|
9477
|
+
hasSomeRoutesWithShouldRevalidate = true;
|
|
9478
|
+
} else {
|
|
9479
|
+
targetRoutes.push(match.route.id);
|
|
9480
|
+
}
|
|
9481
|
+
}
|
|
9482
|
+
if (hasSomeRoutesWithShouldRevalidate && targetRoutes.length > 0) {
|
|
9483
|
+
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
9484
|
+
}
|
|
9485
|
+
return [url.pathname + url.search];
|
|
9486
|
+
}, [
|
|
9487
|
+
basename,
|
|
9488
|
+
future.unstable_trailingSlashAwareDataRequests,
|
|
9489
|
+
page,
|
|
9490
|
+
location,
|
|
9491
|
+
nextMatches
|
|
9492
|
+
]);
|
|
9493
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, dataHrefs.map((href) => /* @__PURE__ */ React8.createElement("link", { key: href, rel: "prefetch", as: "fetch", href, ...linkProps })));
|
|
9494
|
+
}
|
|
9451
9495
|
function PrefetchPageLinksImpl({
|
|
9452
9496
|
page,
|
|
9453
9497
|
matches: nextMatches,
|
|
@@ -9926,7 +9970,7 @@ var isBrowser2 = typeof window !== "undefined" && typeof window.document !== "un
|
|
|
9926
9970
|
try {
|
|
9927
9971
|
if (isBrowser2) {
|
|
9928
9972
|
window.__reactRouterVersion = // @ts-expect-error
|
|
9929
|
-
"0.0.0-experimental-
|
|
9973
|
+
"0.0.0-experimental-58b44aa83";
|
|
9930
9974
|
}
|
|
9931
9975
|
} catch (e) {
|
|
9932
9976
|
}
|
|
@@ -11092,6 +11136,7 @@ export {
|
|
|
11092
11136
|
createRouter,
|
|
11093
11137
|
createStaticHandler,
|
|
11094
11138
|
getStaticContextFromError,
|
|
11139
|
+
invalidProtocols,
|
|
11095
11140
|
isDataWithResponseInit,
|
|
11096
11141
|
isResponse,
|
|
11097
11142
|
isRedirectStatusCode,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-58b44aa83
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
withComponentProps,
|
|
52
52
|
withErrorBoundaryProps,
|
|
53
53
|
withHydrateFallbackProps
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-5AVCKGCU.mjs";
|
|
55
55
|
|
|
56
56
|
// lib/dom/ssr/server.tsx
|
|
57
57
|
import * as React from "react";
|
|
@@ -1096,14 +1096,24 @@ function getSingleFetchRedirect(status, headers, basename) {
|
|
|
1096
1096
|
function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
|
|
1097
1097
|
let controller = new AbortController();
|
|
1098
1098
|
let timeoutId = setTimeout(
|
|
1099
|
-
() =>
|
|
1099
|
+
() => {
|
|
1100
|
+
controller.abort(new Error("Server Timeout"));
|
|
1101
|
+
cleanupCallbacks();
|
|
1102
|
+
},
|
|
1100
1103
|
typeof streamTimeout === "number" ? streamTimeout : 4950
|
|
1101
1104
|
);
|
|
1102
|
-
let
|
|
1103
|
-
|
|
1105
|
+
let abortControllerOnRequestAbort = () => {
|
|
1106
|
+
controller.abort(requestSignal.reason);
|
|
1107
|
+
cleanupCallbacks();
|
|
1108
|
+
};
|
|
1109
|
+
requestSignal.addEventListener("abort", abortControllerOnRequestAbort);
|
|
1110
|
+
let cleanupCallbacks = () => {
|
|
1111
|
+
clearTimeout(timeoutId);
|
|
1112
|
+
requestSignal.removeEventListener("abort", abortControllerOnRequestAbort);
|
|
1113
|
+
};
|
|
1104
1114
|
return encode(data2, {
|
|
1105
1115
|
signal: controller.signal,
|
|
1106
|
-
onComplete:
|
|
1116
|
+
onComplete: cleanupCallbacks,
|
|
1107
1117
|
plugins: [
|
|
1108
1118
|
(value) => {
|
|
1109
1119
|
if (value instanceof Error) {
|
|
@@ -2057,6 +2067,7 @@ function populateRSCRouteModules(routeModules, matches) {
|
|
|
2057
2067
|
var noopComponent = () => null;
|
|
2058
2068
|
|
|
2059
2069
|
// lib/rsc/server.ssr.tsx
|
|
2070
|
+
var defaultManifestPath = "/__manifest";
|
|
2060
2071
|
var REACT_USE = "use";
|
|
2061
2072
|
var useImpl = React4[REACT_USE];
|
|
2062
2073
|
function useSafe(promise) {
|
|
@@ -2437,7 +2448,10 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2437
2448
|
imports: []
|
|
2438
2449
|
}
|
|
2439
2450
|
},
|
|
2440
|
-
routeDiscovery: { mode: "
|
|
2451
|
+
routeDiscovery: payload.routeDiscovery.mode === "initial" ? { mode: "initial", manifestPath: defaultManifestPath } : {
|
|
2452
|
+
mode: "lazy",
|
|
2453
|
+
manifestPath: payload.routeDiscovery.manifestPath || defaultManifestPath
|
|
2454
|
+
},
|
|
2441
2455
|
routeModules: createRSCRouteModules(payload)
|
|
2442
2456
|
};
|
|
2443
2457
|
return /* @__PURE__ */ React4.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React4.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(
|
|
@@ -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 v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-58b44aa83
|
|
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 _chunkWV6HWEISjs = require('./chunk-WV6HWEIS.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 = _chunkWV6HWEISjs.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 (_chunkWV6HWEISjs.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 (_chunkWV6HWEISjs.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
|
+
_chunkWV6HWEISjs.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 = _chunkWV6HWEISjs.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|