react-router 0.0.0-experimental-567b27f71 → 0.0.0-experimental-cb0fdf114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/development/{browser-Bfn3xw9E.d.ts → browser-C9Ar1yxG.d.ts} +13 -10
  3. package/dist/development/{browser-BUb__T3u.d.mts → browser-vtIR1Kpe.d.mts} +14 -11
  4. package/dist/{production/chunk-ONKPUZLV.js → development/chunk-3UD6OXWZ.js} +7 -7
  5. package/dist/development/{chunk-XLC5DWBP.js → chunk-C2BCPNNB.js} +64 -19
  6. package/dist/development/{chunk-MFSTD5J4.mjs → chunk-L7VOOA4V.mjs} +64 -19
  7. package/dist/development/{chunk-T2TDL4ZI.mjs → chunk-N5N2QD3Q.mjs} +21 -7
  8. package/dist/{production/chunk-Y4BW72NR.js → development/chunk-ZE7HRIRF.js} +99 -99
  9. package/dist/{production/context-kw54iBKW.d.mts → development/context-phCt_zmH.d.mts} +1 -1
  10. package/dist/development/dom-export.d.mts +2 -2
  11. package/dist/development/dom-export.d.ts +1 -1
  12. package/dist/development/dom-export.js +78 -53
  13. package/dist/development/dom-export.mjs +48 -23
  14. package/dist/development/{index-react-server-client-CtQKvWuW.d.ts → index-react-server-client-C41e-M56.d.ts} +4 -4
  15. package/dist/{production/index-react-server-client-CmqQRyrG.d.mts → development/index-react-server-client-DB0NZKUQ.d.mts} +4 -4
  16. package/dist/development/index-react-server-client.d.mts +2 -2
  17. package/dist/development/index-react-server-client.d.ts +1 -1
  18. package/dist/development/index-react-server-client.js +4 -4
  19. package/dist/development/index-react-server-client.mjs +2 -2
  20. package/dist/development/index-react-server.d.mts +12 -3
  21. package/dist/development/index-react-server.d.ts +12 -3
  22. package/dist/development/index-react-server.js +82 -40
  23. package/dist/development/index-react-server.mjs +82 -40
  24. package/dist/development/index.d.mts +10 -10
  25. package/dist/development/index.d.ts +8 -8
  26. package/dist/development/index.js +101 -87
  27. package/dist/development/index.mjs +3 -3
  28. package/dist/development/lib/types/internal.d.mts +10 -10
  29. package/dist/development/lib/types/internal.d.ts +10 -10
  30. package/dist/development/lib/types/internal.js +1 -1
  31. package/dist/development/lib/types/internal.mjs +1 -1
  32. package/dist/production/{browser-Bfn3xw9E.d.ts → browser-C9Ar1yxG.d.ts} +13 -10
  33. package/dist/production/{browser-BUb__T3u.d.mts → browser-vtIR1Kpe.d.mts} +14 -11
  34. package/dist/{development/chunk-3KQWMVH5.js → production/chunk-4OARA26X.js} +99 -99
  35. package/dist/production/{chunk-7CRO7VK3.js → chunk-AS4FL2MB.js} +64 -19
  36. package/dist/production/{chunk-OZOQN5MO.mjs → chunk-BUU6CIKQ.mjs} +21 -7
  37. package/dist/production/{chunk-JCFT2HBB.mjs → chunk-PDPTMKPS.mjs} +64 -19
  38. package/dist/{development/chunk-FITK2GBN.js → production/chunk-TVHB74EG.js} +7 -7
  39. package/dist/{development/context-kw54iBKW.d.mts → production/context-phCt_zmH.d.mts} +1 -1
  40. package/dist/production/dom-export.d.mts +2 -2
  41. package/dist/production/dom-export.d.ts +1 -1
  42. package/dist/production/dom-export.js +78 -53
  43. package/dist/production/dom-export.mjs +48 -23
  44. package/dist/production/{index-react-server-client-CtQKvWuW.d.ts → index-react-server-client-C41e-M56.d.ts} +4 -4
  45. package/dist/{development/index-react-server-client-CmqQRyrG.d.mts → production/index-react-server-client-DB0NZKUQ.d.mts} +4 -4
  46. package/dist/production/index-react-server-client.d.mts +2 -2
  47. package/dist/production/index-react-server-client.d.ts +1 -1
  48. package/dist/production/index-react-server-client.js +4 -4
  49. package/dist/production/index-react-server-client.mjs +2 -2
  50. package/dist/production/index-react-server.d.mts +12 -3
  51. package/dist/production/index-react-server.d.ts +12 -3
  52. package/dist/production/index-react-server.js +82 -40
  53. package/dist/production/index-react-server.mjs +82 -40
  54. package/dist/production/index.d.mts +10 -10
  55. package/dist/production/index.d.ts +8 -8
  56. package/dist/production/index.js +101 -87
  57. package/dist/production/index.mjs +3 -3
  58. package/dist/production/lib/types/internal.d.mts +10 -10
  59. package/dist/production/lib/types/internal.d.ts +10 -10
  60. package/dist/production/lib/types/internal.js +1 -1
  61. package/dist/production/lib/types/internal.mjs +1 -1
  62. 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, routeDiscovery, getContext, }: RSCHydratedRouterProps): React.JSX.Element;
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-kw54iBKW.mjs';
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, routeDiscovery, getContext, }: RSCHydratedRouterProps): React.JSX.Element;
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 v0.0.0-experimental-567b27f71
2
+ * react-router v0.0.0-experimental-cb0fdf114
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- var _chunk7CRO7VK3js = require('./chunk-7CRO7VK3.js');
17
+ var _chunkC2BCPNNBjs = require('./chunk-C2BCPNNB.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 = _chunk7CRO7VK3js.matchRoutes.call(void 0, routes, location, basename);
32
+ let initialMatches = _chunkC2BCPNNBjs.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 (_chunk7CRO7VK3js.shouldHydrateRouteLoader.call(void 0,
37
+ if (_chunkC2BCPNNBjs.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 (_chunk7CRO7VK3js.isRouteErrorResponse.call(void 0, error)) {
115
+ if (_chunkC2BCPNNBjs.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
- _chunk7CRO7VK3js.ENABLE_DEV_WARNINGS ? heyDeveloper : null
123
+ _chunkC2BCPNNBjs.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 = _chunk7CRO7VK3js.useRouteError.call(void 0, );
149
+ let error = _chunkC2BCPNNBjs.useRouteError.call(void 0, );
150
150
  if (hasRootLayout === void 0) {
151
151
  throw new Error("Missing 'hasRootLayout' prop");
152
152
  }
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
2
- * react-router v0.0.0-experimental-567b27f71
2
+ * react-router v0.0.0-experimental-cb0fdf114
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);
@@ -7064,21 +7064,21 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
7064
7064
  pathname: joinPaths([
7065
7065
  parentPathnameBase,
7066
7066
  // Re-encode pathnames that were decoded inside matchRoutes.
7067
- // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
7067
+ // Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
7068
7068
  // `new URL()` internally and we need to prevent it from treating
7069
7069
  // them as separators
7070
7070
  navigator.encodeLocation ? navigator.encodeLocation(
7071
- match.pathname.replace(/\?/g, "%3F").replace(/#/g, "%23")
7071
+ match.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
7072
7072
  ).pathname : match.pathname
7073
7073
  ]),
7074
7074
  pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([
7075
7075
  parentPathnameBase,
7076
7076
  // Re-encode pathnames that were decoded inside matchRoutes
7077
- // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
7077
+ // Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
7078
7078
  // `new URL()` internally and we need to prevent it from treating
7079
7079
  // them as separators
7080
7080
  navigator.encodeLocation ? navigator.encodeLocation(
7081
- match.pathnameBase.replace(/\?/g, "%3F").replace(/#/g, "%23")
7081
+ match.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
7082
7082
  ).pathname : match.pathnameBase
7083
7083
  ])
7084
7084
  })
@@ -8573,6 +8573,7 @@ function Links({ nonce, crossOrigin }) {
8573
8573
  ));
8574
8574
  }
8575
8575
  function PrefetchPageLinks({ page, ...linkProps }) {
8576
+ let rsc = useIsRSCRouterContext();
8576
8577
  let { router } = useDataRouterContext2();
8577
8578
  let matches = React7.useMemo(
8578
8579
  () => matchRoutes(router.routes, page, router.basename),
@@ -8581,6 +8582,9 @@ function PrefetchPageLinks({ page, ...linkProps }) {
8581
8582
  if (!matches) {
8582
8583
  return null;
8583
8584
  }
8585
+ if (rsc) {
8586
+ return /* @__PURE__ */ React7.createElement(RSCPrefetchPageLinksImpl, { page, matches, ...linkProps });
8587
+ }
8584
8588
  return /* @__PURE__ */ React7.createElement(PrefetchPageLinksImpl, { page, matches, ...linkProps });
8585
8589
  }
8586
8590
  function useKeyedPrefetchLinks(matches) {
@@ -8601,6 +8605,46 @@ function useKeyedPrefetchLinks(matches) {
8601
8605
  }, [matches, manifest, routeModules]);
8602
8606
  return keyedPrefetchLinks;
8603
8607
  }
8608
+ function RSCPrefetchPageLinksImpl({
8609
+ page,
8610
+ matches: nextMatches,
8611
+ ...linkProps
8612
+ }) {
8613
+ let location = useLocation();
8614
+ let { future } = useFrameworkContext();
8615
+ let { basename } = useDataRouterContext2();
8616
+ let dataHrefs = React7.useMemo(() => {
8617
+ if (page === location.pathname + location.search + location.hash) {
8618
+ return [];
8619
+ }
8620
+ let url = singleFetchUrl(
8621
+ page,
8622
+ basename,
8623
+ future.unstable_trailingSlashAwareDataRequests,
8624
+ "rsc"
8625
+ );
8626
+ let hasSomeRoutesWithShouldRevalidate = false;
8627
+ let targetRoutes = [];
8628
+ for (let match of nextMatches) {
8629
+ if (typeof match.route.shouldRevalidate === "function") {
8630
+ hasSomeRoutesWithShouldRevalidate = true;
8631
+ } else {
8632
+ targetRoutes.push(match.route.id);
8633
+ }
8634
+ }
8635
+ if (hasSomeRoutesWithShouldRevalidate && targetRoutes.length > 0) {
8636
+ url.searchParams.set("_routes", targetRoutes.join(","));
8637
+ }
8638
+ return [url.pathname + url.search];
8639
+ }, [
8640
+ basename,
8641
+ future.unstable_trailingSlashAwareDataRequests,
8642
+ page,
8643
+ location,
8644
+ nextMatches
8645
+ ]);
8646
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, dataHrefs.map((href) => /* @__PURE__ */ React7.createElement("link", { key: href, rel: "prefetch", as: "fetch", href, ...linkProps })));
8647
+ }
8604
8648
  function PrefetchPageLinksImpl({
8605
8649
  page,
8606
8650
  matches: nextMatches,
@@ -9915,4 +9959,5 @@ function withErrorBoundaryProps(ErrorBoundary) {
9915
9959
 
9916
9960
 
9917
9961
 
9918
- exports.Action = Action; exports.createMemoryHistory = createMemoryHistory; exports.createBrowserHistory = createBrowserHistory; exports.createHashHistory = createHashHistory; exports.invariant = invariant; exports.warning = warning; exports.createPath = createPath; exports.parsePath = parsePath; exports.createContext = createContext; exports.RouterContextProvider = RouterContextProvider; exports.convertRoutesToDataRoutes = convertRoutesToDataRoutes; exports.matchRoutes = matchRoutes; exports.generatePath = generatePath; exports.matchPath = matchPath; exports.stripBasename = stripBasename; exports.resolvePath = resolvePath; exports.resolveTo = resolveTo; exports.joinPaths = joinPaths; exports.data = data; exports.redirect = redirect; exports.redirectDocument = redirectDocument; exports.replace = replace; exports.ErrorResponseImpl = ErrorResponseImpl; exports.isRouteErrorResponse = isRouteErrorResponse; exports.parseToInfo = parseToInfo; exports.escapeHtml = escapeHtml; exports.encode = encode; exports.instrumentHandler = instrumentHandler; exports.IDLE_NAVIGATION = IDLE_NAVIGATION; exports.IDLE_FETCHER = IDLE_FETCHER; exports.IDLE_BLOCKER = IDLE_BLOCKER; exports.createRouter = createRouter; exports.createStaticHandler = createStaticHandler; exports.getStaticContextFromError = getStaticContextFromError; exports.isDataWithResponseInit = isDataWithResponseInit; exports.isResponse = isResponse; exports.isRedirectStatusCode = isRedirectStatusCode; exports.isRedirectResponse = isRedirectResponse; exports.isMutationMethod = isMutationMethod; exports.createRequestInit = createRequestInit; exports.SingleFetchRedirectSymbol = SingleFetchRedirectSymbol; exports.SINGLE_FETCH_REDIRECT_STATUS = SINGLE_FETCH_REDIRECT_STATUS; exports.NO_BODY_STATUS_CODES = NO_BODY_STATUS_CODES; exports.StreamTransfer = StreamTransfer; exports.getTurboStreamSingleFetchDataStrategy = getTurboStreamSingleFetchDataStrategy; exports.getSingleFetchDataStrategyImpl = getSingleFetchDataStrategyImpl; exports.stripIndexParam = stripIndexParam; exports.singleFetchUrl = singleFetchUrl; exports.decodeViaTurboStream = decodeViaTurboStream; exports.DataRouterContext = DataRouterContext; exports.DataRouterStateContext = DataRouterStateContext; exports.RSCRouterContext = RSCRouterContext; exports.ViewTransitionContext = ViewTransitionContext; exports.FetchersContext = FetchersContext; exports.AwaitContextProvider = AwaitContextProvider; exports.NavigationContext = NavigationContext; exports.LocationContext = LocationContext; exports.RouteContext = RouteContext; exports.ENABLE_DEV_WARNINGS = ENABLE_DEV_WARNINGS; exports.warnOnce = warnOnce; exports.decodeRedirectErrorDigest = decodeRedirectErrorDigest; exports.decodeRouteErrorResponseDigest = decodeRouteErrorResponseDigest; exports.useHref = useHref; exports.useInRouterContext = useInRouterContext; exports.useLocation = useLocation; exports.useNavigationType = useNavigationType; exports.useMatch = useMatch; exports.useNavigate = useNavigate; exports.useOutletContext = useOutletContext; exports.useOutlet = useOutlet; exports.useParams = useParams; exports.useResolvedPath = useResolvedPath; exports.useRoutes = useRoutes; exports.useRouteId = useRouteId; exports.useNavigation = useNavigation; exports.useRevalidator = useRevalidator; exports.useMatches = useMatches; exports.useLoaderData = useLoaderData; exports.useRouteLoaderData = useRouteLoaderData; exports.useActionData = useActionData; exports.useRouteError = useRouteError; exports.useAsyncValue = useAsyncValue; exports.useAsyncError = useAsyncError; exports.useBlocker = useBlocker; exports.useRoute = useRoute; exports.RemixErrorBoundary = RemixErrorBoundary; exports.createServerRoutes = createServerRoutes; exports.createClientRoutesWithHMRRevalidationOptOut = createClientRoutesWithHMRRevalidationOptOut; exports.noActionDefinedError = noActionDefinedError; exports.createClientRoutes = createClientRoutes; exports.shouldHydrateRouteLoader = shouldHydrateRouteLoader; exports.getPatchRoutesOnNavigationFunction = getPatchRoutesOnNavigationFunction; exports.useFogOFWarDiscovery = useFogOFWarDiscovery; exports.getManifestPath = getManifestPath; exports.FrameworkContext = FrameworkContext; exports.usePrefetchBehavior = usePrefetchBehavior; exports.CRITICAL_CSS_DATA_ATTRIBUTE = CRITICAL_CSS_DATA_ATTRIBUTE; exports.Links = Links; exports.PrefetchPageLinks = PrefetchPageLinks; exports.Meta = Meta; exports.setIsHydrated = setIsHydrated; exports.Scripts = Scripts; exports.mergeRefs = mergeRefs; exports.mapRouteProperties = mapRouteProperties; exports.hydrationRouteProperties = hydrationRouteProperties; exports.createMemoryRouter = createMemoryRouter; exports.RouterProvider = RouterProvider; exports.DataRoutes = DataRoutes; exports.MemoryRouter = MemoryRouter; exports.Navigate = Navigate; exports.Outlet = Outlet; exports.Route = Route; exports.Router = Router; exports.Routes = Routes; exports.Await = Await; exports.createRoutesFromChildren = createRoutesFromChildren; exports.createRoutesFromElements = createRoutesFromElements; exports.renderMatches = renderMatches; exports.WithComponentProps = WithComponentProps; exports.withComponentProps = withComponentProps; exports.WithHydrateFallbackProps = WithHydrateFallbackProps; exports.withHydrateFallbackProps = withHydrateFallbackProps; exports.WithErrorBoundaryProps = WithErrorBoundaryProps; exports.withErrorBoundaryProps = withErrorBoundaryProps;
9962
+
9963
+ exports.Action = Action; exports.createMemoryHistory = createMemoryHistory; exports.createBrowserHistory = createBrowserHistory; exports.createHashHistory = createHashHistory; exports.invariant = invariant; exports.warning = warning; exports.createPath = createPath; exports.parsePath = parsePath; exports.createContext = createContext; exports.RouterContextProvider = RouterContextProvider; exports.convertRoutesToDataRoutes = convertRoutesToDataRoutes; exports.matchRoutes = matchRoutes; exports.generatePath = generatePath; exports.matchPath = matchPath; exports.stripBasename = stripBasename; exports.resolvePath = resolvePath; exports.resolveTo = resolveTo; exports.joinPaths = joinPaths; exports.data = data; exports.redirect = redirect; exports.redirectDocument = redirectDocument; exports.replace = replace; exports.ErrorResponseImpl = ErrorResponseImpl; exports.isRouteErrorResponse = isRouteErrorResponse; exports.parseToInfo = parseToInfo; exports.escapeHtml = escapeHtml; exports.encode = encode; exports.instrumentHandler = instrumentHandler; exports.IDLE_NAVIGATION = IDLE_NAVIGATION; exports.IDLE_FETCHER = IDLE_FETCHER; exports.IDLE_BLOCKER = IDLE_BLOCKER; exports.createRouter = createRouter; exports.createStaticHandler = createStaticHandler; exports.getStaticContextFromError = getStaticContextFromError; exports.invalidProtocols = invalidProtocols; exports.isDataWithResponseInit = isDataWithResponseInit; exports.isResponse = isResponse; exports.isRedirectStatusCode = isRedirectStatusCode; exports.isRedirectResponse = isRedirectResponse; exports.isMutationMethod = isMutationMethod; exports.createRequestInit = createRequestInit; exports.SingleFetchRedirectSymbol = SingleFetchRedirectSymbol; exports.SINGLE_FETCH_REDIRECT_STATUS = SINGLE_FETCH_REDIRECT_STATUS; exports.NO_BODY_STATUS_CODES = NO_BODY_STATUS_CODES; exports.StreamTransfer = StreamTransfer; exports.getTurboStreamSingleFetchDataStrategy = getTurboStreamSingleFetchDataStrategy; exports.getSingleFetchDataStrategyImpl = getSingleFetchDataStrategyImpl; exports.stripIndexParam = stripIndexParam; exports.singleFetchUrl = singleFetchUrl; exports.decodeViaTurboStream = decodeViaTurboStream; exports.DataRouterContext = DataRouterContext; exports.DataRouterStateContext = DataRouterStateContext; exports.RSCRouterContext = RSCRouterContext; exports.ViewTransitionContext = ViewTransitionContext; exports.FetchersContext = FetchersContext; exports.AwaitContextProvider = AwaitContextProvider; exports.NavigationContext = NavigationContext; exports.LocationContext = LocationContext; exports.RouteContext = RouteContext; exports.ENABLE_DEV_WARNINGS = ENABLE_DEV_WARNINGS; exports.warnOnce = warnOnce; exports.decodeRedirectErrorDigest = decodeRedirectErrorDigest; exports.decodeRouteErrorResponseDigest = decodeRouteErrorResponseDigest; exports.useHref = useHref; exports.useInRouterContext = useInRouterContext; exports.useLocation = useLocation; exports.useNavigationType = useNavigationType; exports.useMatch = useMatch; exports.useNavigate = useNavigate; exports.useOutletContext = useOutletContext; exports.useOutlet = useOutlet; exports.useParams = useParams; exports.useResolvedPath = useResolvedPath; exports.useRoutes = useRoutes; exports.useRouteId = useRouteId; exports.useNavigation = useNavigation; exports.useRevalidator = useRevalidator; exports.useMatches = useMatches; exports.useLoaderData = useLoaderData; exports.useRouteLoaderData = useRouteLoaderData; exports.useActionData = useActionData; exports.useRouteError = useRouteError; exports.useAsyncValue = useAsyncValue; exports.useAsyncError = useAsyncError; exports.useBlocker = useBlocker; exports.useRoute = useRoute; exports.RemixErrorBoundary = RemixErrorBoundary; exports.createServerRoutes = createServerRoutes; exports.createClientRoutesWithHMRRevalidationOptOut = createClientRoutesWithHMRRevalidationOptOut; exports.noActionDefinedError = noActionDefinedError; exports.createClientRoutes = createClientRoutes; exports.shouldHydrateRouteLoader = shouldHydrateRouteLoader; exports.getPatchRoutesOnNavigationFunction = getPatchRoutesOnNavigationFunction; exports.useFogOFWarDiscovery = useFogOFWarDiscovery; exports.getManifestPath = getManifestPath; exports.FrameworkContext = FrameworkContext; exports.usePrefetchBehavior = usePrefetchBehavior; exports.CRITICAL_CSS_DATA_ATTRIBUTE = CRITICAL_CSS_DATA_ATTRIBUTE; exports.Links = Links; exports.PrefetchPageLinks = PrefetchPageLinks; exports.Meta = Meta; exports.setIsHydrated = setIsHydrated; exports.Scripts = Scripts; exports.mergeRefs = mergeRefs; exports.mapRouteProperties = mapRouteProperties; exports.hydrationRouteProperties = hydrationRouteProperties; exports.createMemoryRouter = createMemoryRouter; exports.RouterProvider = RouterProvider; exports.DataRoutes = DataRoutes; exports.MemoryRouter = MemoryRouter; exports.Navigate = Navigate; exports.Outlet = Outlet; exports.Route = Route; exports.Router = Router; exports.Routes = Routes; exports.Await = Await; exports.createRoutesFromChildren = createRoutesFromChildren; exports.createRoutesFromElements = createRoutesFromElements; exports.renderMatches = renderMatches; exports.WithComponentProps = WithComponentProps; exports.withComponentProps = withComponentProps; exports.WithHydrateFallbackProps = WithHydrateFallbackProps; exports.withHydrateFallbackProps = withHydrateFallbackProps; exports.WithErrorBoundaryProps = WithErrorBoundaryProps; exports.withErrorBoundaryProps = withErrorBoundaryProps;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v0.0.0-experimental-567b27f71
2
+ * react-router v0.0.0-experimental-cb0fdf114
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-567b27f71";
9973
+ "0.0.0-experimental-cb0fdf114";
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-567b27f71
2
+ * react-router v0.0.0-experimental-cb0fdf114
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-MFSTD5J4.mjs";
54
+ } from "./chunk-L7VOOA4V.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
- () => controller.abort(new Error("Server Timeout")),
1099
+ () => {
1100
+ controller.abort(new Error("Server Timeout"));
1101
+ cleanupCallbacks();
1102
+ },
1100
1103
  typeof streamTimeout === "number" ? streamTimeout : 4950
1101
1104
  );
1102
- let clearStreamTimeout = () => clearTimeout(timeoutId);
1103
- requestSignal.addEventListener("abort", clearStreamTimeout);
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: clearStreamTimeout,
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: "lazy", manifestPath: "/__manifest" },
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(