react-router 0.0.0-experimental-80dc2f07b → 0.0.0-experimental-84753c0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/browser-z32v5KVN.d.mts +46 -0
- package/dist/development/{chunk-ZDIHB6MN.mjs → chunk-2XECXUWB.mjs} +48 -7
- package/dist/development/{chunk-FRVKHHSP.mjs → chunk-7BNQ3X22.mjs} +48 -53
- package/dist/{production/chunk-IMCXOMKU.js → development/chunk-BKA6MN6C.js} +130 -130
- package/dist/development/chunk-OYS64IUQ.js +42 -0
- package/dist/development/{chunk-QIEB5IKV.js → chunk-WFJQVGQ4.js} +47 -52
- package/dist/development/{components-kfi-pq4A.d.mts → components-BeoSj2y5.d.mts} +4 -3
- package/dist/development/dom-export.d.mts +25 -11
- package/dist/development/dom-export.d.ts +23 -7
- package/dist/development/dom-export.js +17 -7
- package/dist/development/dom-export.mjs +14 -6
- package/dist/{production/index-react-server-client-DWt5PSS7.d.mts → development/index-react-server-client-CD1wssaX.d.mts} +301 -241
- package/dist/{production/index-react-server-client-C4nRtAah.d.ts → development/index-react-server-client-DWvSxTlp.d.ts} +410 -349
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +2 -2
- 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 +41 -40
- package/dist/development/index-react-server.d.ts +41 -40
- package/dist/development/index-react-server.js +1 -1
- package/dist/development/index-react-server.mjs +1 -1
- package/dist/development/index.d.mts +291 -88
- package/dist/development/index.d.ts +135 -107
- package/dist/development/index.js +115 -102
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +1 -1
- package/dist/development/lib/types/internal.d.ts +1 -1
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/{production/route-data-Dccdkjzt.d.mts → development/route-data-DLWzV8y8.d.mts} +56 -21
- package/dist/development/{routeModules-ePxkpnOJ.d.ts → routeModules-DGh-lOIY.d.ts} +76 -41
- package/dist/production/browser-z32v5KVN.d.mts +46 -0
- package/dist/{development/chunk-KW2YDZG2.js → production/chunk-DNCPQZC4.js} +130 -130
- package/dist/production/chunk-OYS64IUQ.js +42 -0
- package/dist/production/{chunk-NUPZJCEO.mjs → chunk-VJVBIB4Y.mjs} +48 -7
- package/dist/production/{chunk-BJQSOW5M.js → chunk-XVO4RTEQ.js} +47 -52
- package/dist/production/{chunk-VQ4KM56U.mjs → chunk-ZGP5JW47.mjs} +48 -53
- package/dist/production/{components-kfi-pq4A.d.mts → components-BeoSj2y5.d.mts} +4 -3
- package/dist/production/dom-export.d.mts +25 -11
- package/dist/production/dom-export.d.ts +23 -7
- package/dist/production/dom-export.js +17 -7
- package/dist/production/dom-export.mjs +14 -6
- package/dist/{development/index-react-server-client-DWt5PSS7.d.mts → production/index-react-server-client-CD1wssaX.d.mts} +301 -241
- package/dist/{development/index-react-server-client-C4nRtAah.d.ts → production/index-react-server-client-DWvSxTlp.d.ts} +410 -349
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +2 -2
- 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 +41 -40
- package/dist/production/index-react-server.d.ts +41 -40
- package/dist/production/index-react-server.js +1 -1
- package/dist/production/index-react-server.mjs +1 -1
- package/dist/production/index.d.mts +291 -88
- package/dist/production/index.d.ts +135 -107
- package/dist/production/index.js +115 -102
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +1 -1
- package/dist/production/lib/types/internal.d.ts +1 -1
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/{development/route-data-Dccdkjzt.d.mts → production/route-data-DLWzV8y8.d.mts} +56 -21
- package/dist/production/{routeModules-ePxkpnOJ.d.ts → routeModules-DGh-lOIY.d.ts} +76 -41
- package/package.json +1 -1
- package/dist/development/browser-DO9ukXOW.d.mts +0 -226
- package/dist/production/browser-DO9ukXOW.d.mts +0 -226
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
__FLIGHT_DATA: any[];
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Get the prerendered [RSC](https://react.dev/reference/rsc/server-components)
|
|
8
|
+
* stream for hydration. Usually passed directly to your
|
|
9
|
+
* `react-server-dom-xyz/client`'s `createFromReadableStream`.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import { startTransition, StrictMode } from "react";
|
|
13
|
+
* import { hydrateRoot } from "react-dom/client";
|
|
14
|
+
* import {
|
|
15
|
+
* unstable_getRSCStream as getRSCStream,
|
|
16
|
+
* unstable_RSCHydratedRouter as RSCHydratedRouter,
|
|
17
|
+
* } from "react-router";
|
|
18
|
+
* import type { unstable_RSCPayload as RSCPayload } from "react-router";
|
|
19
|
+
*
|
|
20
|
+
* createFromReadableStream(getRSCStream()).then(
|
|
21
|
+
* (payload: RSCServerPayload) => {
|
|
22
|
+
* startTransition(async () => {
|
|
23
|
+
* hydrateRoot(
|
|
24
|
+
* document,
|
|
25
|
+
* <StrictMode>
|
|
26
|
+
* <RSCHydratedRouter {...props} />
|
|
27
|
+
* </StrictMode>,
|
|
28
|
+
* {
|
|
29
|
+
* // Options
|
|
30
|
+
* }
|
|
31
|
+
* );
|
|
32
|
+
* });
|
|
33
|
+
* }
|
|
34
|
+
* );
|
|
35
|
+
*
|
|
36
|
+
* @name unstable_getRSCStream
|
|
37
|
+
* @public
|
|
38
|
+
* @category RSC
|
|
39
|
+
* @mode data
|
|
40
|
+
* @returns A [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)
|
|
41
|
+
* that contains the [RSC](https://react.dev/reference/rsc/server-components)
|
|
42
|
+
* data for hydration.
|
|
43
|
+
*/
|
|
44
|
+
declare function getRSCStream(): ReadableStream;
|
|
45
|
+
|
|
46
|
+
export { getRSCStream as g };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-84753c0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -57,10 +57,40 @@ import {
|
|
|
57
57
|
withComponentProps,
|
|
58
58
|
withErrorBoundaryProps,
|
|
59
59
|
withHydrateFallbackProps
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-7BNQ3X22.mjs";
|
|
61
61
|
|
|
62
62
|
// lib/dom/ssr/server.tsx
|
|
63
63
|
import * as React from "react";
|
|
64
|
+
|
|
65
|
+
// lib/dom/ssr/routeModules.ts
|
|
66
|
+
var defaultLoadRouteModule = async (route, routeModulesCache) => {
|
|
67
|
+
if (route.id in routeModulesCache) {
|
|
68
|
+
return routeModulesCache[route.id];
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
let routeModule = await import(
|
|
72
|
+
/* @vite-ignore */
|
|
73
|
+
/* webpackIgnore: true */
|
|
74
|
+
route.module
|
|
75
|
+
);
|
|
76
|
+
routeModulesCache[route.id] = routeModule;
|
|
77
|
+
return routeModule;
|
|
78
|
+
} catch (error) {
|
|
79
|
+
console.error(
|
|
80
|
+
`Error loading route module \`${route.module}\`, reloading page...`
|
|
81
|
+
);
|
|
82
|
+
console.error(error);
|
|
83
|
+
if (window.__reactRouterContext && window.__reactRouterContext.isSpaMode && // @ts-expect-error
|
|
84
|
+
import.meta.hot) {
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
window.location.reload();
|
|
88
|
+
return new Promise(() => {
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// lib/dom/ssr/server.tsx
|
|
64
94
|
function ServerRouter({
|
|
65
95
|
context,
|
|
66
96
|
url,
|
|
@@ -106,7 +136,8 @@ function ServerRouter({
|
|
|
106
136
|
isSpaMode: context.isSpaMode,
|
|
107
137
|
routeDiscovery: context.routeDiscovery,
|
|
108
138
|
serializeError: context.serializeError,
|
|
109
|
-
renderMeta: context.renderMeta
|
|
139
|
+
renderMeta: context.renderMeta,
|
|
140
|
+
loadRouteModule: defaultLoadRouteModule
|
|
110
141
|
}
|
|
111
142
|
},
|
|
112
143
|
/* @__PURE__ */ React.createElement(RemixErrorBoundary, { location: router.state.location }, /* @__PURE__ */ React.createElement(
|
|
@@ -136,7 +167,8 @@ function createRoutesStub(routes, _context) {
|
|
|
136
167
|
initialEntries,
|
|
137
168
|
initialIndex,
|
|
138
169
|
hydrationData,
|
|
139
|
-
future
|
|
170
|
+
future,
|
|
171
|
+
loadRouteModule = defaultLoadRouteModule
|
|
140
172
|
}) {
|
|
141
173
|
let routerRef = React2.useRef();
|
|
142
174
|
let frameworkContextRef = React2.useRef();
|
|
@@ -155,6 +187,7 @@ function createRoutesStub(routes, _context) {
|
|
|
155
187
|
routeModules: {},
|
|
156
188
|
ssr: false,
|
|
157
189
|
isSpaMode: false,
|
|
190
|
+
loadRouteModule,
|
|
158
191
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" }
|
|
159
192
|
};
|
|
160
193
|
let patched = processRoutes(
|
|
@@ -1361,7 +1394,8 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1361
1394
|
ssr: build.ssr,
|
|
1362
1395
|
routeDiscovery: build.routeDiscovery,
|
|
1363
1396
|
isSpaMode: isSpaMode2,
|
|
1364
|
-
serializeError: (err) => serializeError(err, serverMode)
|
|
1397
|
+
serializeError: (err) => serializeError(err, serverMode),
|
|
1398
|
+
loadRouteModule: defaultLoadRouteModule
|
|
1365
1399
|
};
|
|
1366
1400
|
let handleDocumentRequestFunction = build.entry.module.default;
|
|
1367
1401
|
try {
|
|
@@ -2193,7 +2227,10 @@ function RSCHydratedRouter({
|
|
|
2193
2227
|
}
|
|
2194
2228
|
},
|
|
2195
2229
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2196
|
-
routeModules: {}
|
|
2230
|
+
routeModules: {},
|
|
2231
|
+
loadRouteModule: () => {
|
|
2232
|
+
throw new Error("Not required in RSC Mode");
|
|
2233
|
+
}
|
|
2197
2234
|
};
|
|
2198
2235
|
return /* @__PURE__ */ React4.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React4.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React4.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React4.createElement(RouterProvider, { router, flushSync: ReactDOM.flushSync }))));
|
|
2199
2236
|
}
|
|
@@ -2582,7 +2619,10 @@ function RSCStaticRouter({ getPayload }) {
|
|
|
2582
2619
|
}
|
|
2583
2620
|
},
|
|
2584
2621
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
2585
|
-
routeModules: {}
|
|
2622
|
+
routeModules: {},
|
|
2623
|
+
loadRouteModule: () => {
|
|
2624
|
+
throw new Error("Not required in RSC Mode");
|
|
2625
|
+
}
|
|
2586
2626
|
};
|
|
2587
2627
|
return /* @__PURE__ */ React5.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React5.createElement(RSCRouterGlobalErrorBoundary, { location: payload.location }, /* @__PURE__ */ React5.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React5.createElement(
|
|
2588
2628
|
StaticRouterProvider,
|
|
@@ -2674,6 +2714,7 @@ function deserializeErrors(errors) {
|
|
|
2674
2714
|
}
|
|
2675
2715
|
|
|
2676
2716
|
export {
|
|
2717
|
+
defaultLoadRouteModule,
|
|
2677
2718
|
ServerRouter,
|
|
2678
2719
|
createRoutesStub,
|
|
2679
2720
|
createCookie,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-84753c0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -7366,34 +7366,6 @@ import * as React9 from "react";
|
|
|
7366
7366
|
// lib/dom/ssr/components.tsx
|
|
7367
7367
|
import * as React8 from "react";
|
|
7368
7368
|
|
|
7369
|
-
// lib/dom/ssr/routeModules.ts
|
|
7370
|
-
async function loadRouteModule(route, routeModulesCache) {
|
|
7371
|
-
if (route.id in routeModulesCache) {
|
|
7372
|
-
return routeModulesCache[route.id];
|
|
7373
|
-
}
|
|
7374
|
-
try {
|
|
7375
|
-
let routeModule = await import(
|
|
7376
|
-
/* @vite-ignore */
|
|
7377
|
-
/* webpackIgnore: true */
|
|
7378
|
-
route.module
|
|
7379
|
-
);
|
|
7380
|
-
routeModulesCache[route.id] = routeModule;
|
|
7381
|
-
return routeModule;
|
|
7382
|
-
} catch (error) {
|
|
7383
|
-
console.error(
|
|
7384
|
-
`Error loading route module \`${route.module}\`, reloading page...`
|
|
7385
|
-
);
|
|
7386
|
-
console.error(error);
|
|
7387
|
-
if (window.__reactRouterContext && window.__reactRouterContext.isSpaMode && // @ts-expect-error
|
|
7388
|
-
import.meta.hot) {
|
|
7389
|
-
throw error;
|
|
7390
|
-
}
|
|
7391
|
-
window.location.reload();
|
|
7392
|
-
return new Promise(() => {
|
|
7393
|
-
});
|
|
7394
|
-
}
|
|
7395
|
-
}
|
|
7396
|
-
|
|
7397
7369
|
// lib/dom/ssr/links.ts
|
|
7398
7370
|
function getKeyedLinksForMatches(matches, routeModules, manifest) {
|
|
7399
7371
|
let descriptors = matches.map((match) => {
|
|
@@ -7475,7 +7447,7 @@ function isHtmlLinkDescriptor(object) {
|
|
|
7475
7447
|
}
|
|
7476
7448
|
return typeof object.rel === "string" && typeof object.href === "string";
|
|
7477
7449
|
}
|
|
7478
|
-
async function getKeyedPrefetchLinks(matches, manifest, routeModules) {
|
|
7450
|
+
async function getKeyedPrefetchLinks(matches, manifest, routeModules, loadRouteModule) {
|
|
7479
7451
|
let links = await Promise.all(
|
|
7480
7452
|
matches.map(async (match) => {
|
|
7481
7453
|
let route = manifest.routes[match.route.id];
|
|
@@ -7698,13 +7670,14 @@ function createServerRoutes(manifest, routeModules, future, isSpaMode, parentId
|
|
|
7698
7670
|
return dataRoute;
|
|
7699
7671
|
});
|
|
7700
7672
|
}
|
|
7701
|
-
function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest, routeModulesCache, initialState, ssr, isSpaMode) {
|
|
7673
|
+
function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation, manifest, routeModulesCache, initialState, ssr, isSpaMode, loadRouteModule) {
|
|
7702
7674
|
return createClientRoutes(
|
|
7703
7675
|
manifest,
|
|
7704
7676
|
routeModulesCache,
|
|
7705
7677
|
initialState,
|
|
7706
7678
|
ssr,
|
|
7707
7679
|
isSpaMode,
|
|
7680
|
+
loadRouteModule,
|
|
7708
7681
|
"",
|
|
7709
7682
|
groupRoutesByParentId(manifest),
|
|
7710
7683
|
needsRevalidation
|
|
@@ -7724,7 +7697,7 @@ function noActionDefinedError(type, routeId) {
|
|
|
7724
7697
|
console.error(msg);
|
|
7725
7698
|
throw new ErrorResponseImpl(405, "Method Not Allowed", new Error(msg), true);
|
|
7726
7699
|
}
|
|
7727
|
-
function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSpaMode, parentId = "", routesByParentId = groupRoutesByParentId(manifest), needsRevalidation) {
|
|
7700
|
+
function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSpaMode, loadRouteModule, parentId = "", routesByParentId = groupRoutesByParentId(manifest), needsRevalidation) {
|
|
7728
7701
|
return (routesByParentId[parentId] || []).map((route) => {
|
|
7729
7702
|
let routeModule = routeModulesCache[route.id];
|
|
7730
7703
|
function fetchServerHandler(singleFetch) {
|
|
@@ -7879,7 +7852,8 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7879
7852
|
}
|
|
7880
7853
|
let routeModulePromise = loadRouteModuleWithBlockingLinks(
|
|
7881
7854
|
route,
|
|
7882
|
-
routeModulesCache
|
|
7855
|
+
routeModulesCache,
|
|
7856
|
+
loadRouteModule
|
|
7883
7857
|
);
|
|
7884
7858
|
prefetchRouteModuleChunks(route);
|
|
7885
7859
|
return await routeModulePromise;
|
|
@@ -7954,6 +7928,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7954
7928
|
initialState,
|
|
7955
7929
|
ssr,
|
|
7956
7930
|
isSpaMode,
|
|
7931
|
+
loadRouteModule,
|
|
7957
7932
|
route.id,
|
|
7958
7933
|
routesByParentId,
|
|
7959
7934
|
needsRevalidation
|
|
@@ -7999,7 +7974,7 @@ function wrapShouldRevalidateForHdr(routeId, routeShouldRevalidate, needsRevalid
|
|
|
7999
7974
|
return routeShouldRevalidate ? routeShouldRevalidate(arg) : arg.defaultShouldRevalidate;
|
|
8000
7975
|
};
|
|
8001
7976
|
}
|
|
8002
|
-
async function loadRouteModuleWithBlockingLinks(route, routeModules) {
|
|
7977
|
+
async function loadRouteModuleWithBlockingLinks(route, routeModules, loadRouteModule) {
|
|
8003
7978
|
let routeModulePromise = loadRouteModule(route, routeModules);
|
|
8004
7979
|
let prefetchRouteCssPromise = prefetchRouteCss(route);
|
|
8005
7980
|
let routeModule = await routeModulePromise;
|
|
@@ -8063,7 +8038,7 @@ function getPartialManifest({ sri, ...manifest }, router) {
|
|
|
8063
8038
|
sri: sri ? true : void 0
|
|
8064
8039
|
};
|
|
8065
8040
|
}
|
|
8066
|
-
function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, routeDiscovery, isSpaMode, basename) {
|
|
8041
|
+
function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, routeDiscovery, isSpaMode, basename, loadRouteModule) {
|
|
8067
8042
|
if (!isFogOfWarEnabled(routeDiscovery, ssr)) {
|
|
8068
8043
|
return void 0;
|
|
8069
8044
|
}
|
|
@@ -8078,6 +8053,7 @@ function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, routeDi
|
|
|
8078
8053
|
routeModules,
|
|
8079
8054
|
ssr,
|
|
8080
8055
|
isSpaMode,
|
|
8056
|
+
loadRouteModule,
|
|
8081
8057
|
basename,
|
|
8082
8058
|
routeDiscovery.manifestPath,
|
|
8083
8059
|
patch,
|
|
@@ -8085,7 +8061,7 @@ function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, routeDi
|
|
|
8085
8061
|
);
|
|
8086
8062
|
};
|
|
8087
8063
|
}
|
|
8088
|
-
function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscovery, isSpaMode) {
|
|
8064
|
+
function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscovery, isSpaMode, loadRouteModule) {
|
|
8089
8065
|
React7.useEffect(() => {
|
|
8090
8066
|
if (!isFogOfWarEnabled(routeDiscovery, ssr) || // @ts-expect-error - TS doesn't know about this yet
|
|
8091
8067
|
window.navigator?.connection?.saveData === true) {
|
|
@@ -8121,6 +8097,7 @@ function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscover
|
|
|
8121
8097
|
routeModules,
|
|
8122
8098
|
ssr,
|
|
8123
8099
|
isSpaMode,
|
|
8100
|
+
loadRouteModule,
|
|
8124
8101
|
router.basename,
|
|
8125
8102
|
routeDiscovery.manifestPath,
|
|
8126
8103
|
router.patchRoutes
|
|
@@ -8139,7 +8116,15 @@ function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscover
|
|
|
8139
8116
|
attributeFilter: ["data-discover", "href", "action"]
|
|
8140
8117
|
});
|
|
8141
8118
|
return () => observer.disconnect();
|
|
8142
|
-
}, [
|
|
8119
|
+
}, [
|
|
8120
|
+
ssr,
|
|
8121
|
+
isSpaMode,
|
|
8122
|
+
manifest,
|
|
8123
|
+
routeModules,
|
|
8124
|
+
router,
|
|
8125
|
+
routeDiscovery,
|
|
8126
|
+
loadRouteModule
|
|
8127
|
+
]);
|
|
8143
8128
|
}
|
|
8144
8129
|
function getManifestPath(_manifestPath, basename) {
|
|
8145
8130
|
let manifestPath = _manifestPath || "/__manifest";
|
|
@@ -8149,7 +8134,7 @@ function getManifestPath(_manifestPath, basename) {
|
|
|
8149
8134
|
return `${basename}${manifestPath}`.replace(/\/+/g, "/");
|
|
8150
8135
|
}
|
|
8151
8136
|
var MANIFEST_VERSION_STORAGE_KEY = "react-router-manifest-version";
|
|
8152
|
-
async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, routeModules, ssr, isSpaMode, basename, manifestPath, patchRoutes, signal) {
|
|
8137
|
+
async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, routeModules, ssr, isSpaMode, loadRouteModule, basename, manifestPath, patchRoutes, signal) {
|
|
8153
8138
|
let url = new URL(
|
|
8154
8139
|
getManifestPath(manifestPath, basename),
|
|
8155
8140
|
window.location.origin
|
|
@@ -8210,7 +8195,15 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
8210
8195
|
parentIds.forEach(
|
|
8211
8196
|
(parentId) => patchRoutes(
|
|
8212
8197
|
parentId || null,
|
|
8213
|
-
createClientRoutes(
|
|
8198
|
+
createClientRoutes(
|
|
8199
|
+
patches,
|
|
8200
|
+
routeModules,
|
|
8201
|
+
null,
|
|
8202
|
+
ssr,
|
|
8203
|
+
isSpaMode,
|
|
8204
|
+
loadRouteModule,
|
|
8205
|
+
parentId
|
|
8206
|
+
)
|
|
8214
8207
|
)
|
|
8215
8208
|
);
|
|
8216
8209
|
}
|
|
@@ -8333,7 +8326,7 @@ function getActiveMatches(matches, errors, isSpaMode) {
|
|
|
8333
8326
|
return matches;
|
|
8334
8327
|
}
|
|
8335
8328
|
var CRITICAL_CSS_DATA_ATTRIBUTE = "data-react-router-critical-css";
|
|
8336
|
-
function Links(
|
|
8329
|
+
function Links() {
|
|
8337
8330
|
let { isSpaMode, manifest, routeModules, criticalCss } = useFrameworkContext();
|
|
8338
8331
|
let { errors, matches: routerMatches } = useDataRouterStateContext();
|
|
8339
8332
|
let matches = getActiveMatches(routerMatches, errors, isSpaMode);
|
|
@@ -8352,11 +8345,10 @@ function Links({ nonce }) {
|
|
|
8352
8345
|
{
|
|
8353
8346
|
...{ [CRITICAL_CSS_DATA_ATTRIBUTE]: "" },
|
|
8354
8347
|
rel: "stylesheet",
|
|
8355
|
-
href: criticalCss.href
|
|
8356
|
-
nonce
|
|
8348
|
+
href: criticalCss.href
|
|
8357
8349
|
}
|
|
8358
8350
|
) : null, keyedLinks.map(
|
|
8359
|
-
({ key, link }) => isPageLinkDescriptor(link) ? /* @__PURE__ */ React8.createElement(PrefetchPageLinks, { key,
|
|
8351
|
+
({ key, link }) => isPageLinkDescriptor(link) ? /* @__PURE__ */ React8.createElement(PrefetchPageLinks, { key, ...link }) : /* @__PURE__ */ React8.createElement("link", { key, ...link })
|
|
8360
8352
|
));
|
|
8361
8353
|
}
|
|
8362
8354
|
function PrefetchPageLinks({ page, ...linkProps }) {
|
|
@@ -8371,21 +8363,24 @@ function PrefetchPageLinks({ page, ...linkProps }) {
|
|
|
8371
8363
|
return /* @__PURE__ */ React8.createElement(PrefetchPageLinksImpl, { page, matches, ...linkProps });
|
|
8372
8364
|
}
|
|
8373
8365
|
function useKeyedPrefetchLinks(matches) {
|
|
8374
|
-
let { manifest, routeModules } = useFrameworkContext();
|
|
8366
|
+
let { manifest, routeModules, loadRouteModule } = useFrameworkContext();
|
|
8375
8367
|
let [keyedPrefetchLinks, setKeyedPrefetchLinks] = React8.useState([]);
|
|
8376
8368
|
React8.useEffect(() => {
|
|
8377
8369
|
let interrupted = false;
|
|
8378
|
-
void getKeyedPrefetchLinks(
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8370
|
+
void getKeyedPrefetchLinks(
|
|
8371
|
+
matches,
|
|
8372
|
+
manifest,
|
|
8373
|
+
routeModules,
|
|
8374
|
+
loadRouteModule
|
|
8375
|
+
).then((links) => {
|
|
8376
|
+
if (!interrupted) {
|
|
8377
|
+
setKeyedPrefetchLinks(links);
|
|
8383
8378
|
}
|
|
8384
|
-
);
|
|
8379
|
+
});
|
|
8385
8380
|
return () => {
|
|
8386
8381
|
interrupted = true;
|
|
8387
8382
|
};
|
|
8388
|
-
}, [matches, manifest, routeModules]);
|
|
8383
|
+
}, [matches, manifest, routeModules, loadRouteModule]);
|
|
8389
8384
|
return keyedPrefetchLinks;
|
|
8390
8385
|
}
|
|
8391
8386
|
function PrefetchPageLinksImpl({
|
|
@@ -8467,7 +8462,7 @@ function PrefetchPageLinksImpl({
|
|
|
8467
8462
|
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, dataHrefs.map((href) => /* @__PURE__ */ React8.createElement("link", { key: href, rel: "prefetch", as: "fetch", href, ...linkProps })), moduleHrefs.map((href) => /* @__PURE__ */ React8.createElement("link", { key: href, rel: "modulepreload", href, ...linkProps })), keyedPrefetchLinks.map(({ key, link }) => (
|
|
8468
8463
|
// these don't spread `linkProps` because they are full link descriptors
|
|
8469
8464
|
// already with their own props
|
|
8470
|
-
/* @__PURE__ */ React8.createElement("link", { key,
|
|
8465
|
+
/* @__PURE__ */ React8.createElement("link", { key, ...link })
|
|
8471
8466
|
)));
|
|
8472
8467
|
}
|
|
8473
8468
|
function Meta() {
|
|
@@ -8846,7 +8841,7 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
8846
8841
|
try {
|
|
8847
8842
|
if (isBrowser) {
|
|
8848
8843
|
window.__reactRouterVersion = // @ts-expect-error
|
|
8849
|
-
"0.0.0-experimental-
|
|
8844
|
+
"0.0.0-experimental-84753c0";
|
|
8850
8845
|
}
|
|
8851
8846
|
} catch (e) {
|
|
8852
8847
|
}
|