react-router 0.0.0-experimental-e87ed2fd4 → 0.0.0-experimental-e7eb25a7b
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 +91 -2
- package/dist/development/{browser-C9OqCpRB.d.mts → browser-BM9EKN98.d.mts} +3 -3
- package/dist/development/{chunk-PVJCBITV.mjs → chunk-SHQJZRZ7.mjs} +127 -36
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.js +2 -1
- package/dist/development/dom-export.mjs +3 -2
- package/dist/development/index.d.mts +5 -5
- package/dist/development/index.d.ts +5 -5
- package/dist/development/index.js +137 -46
- package/dist/development/index.mjs +7 -7
- 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/register-zy84znbA.d.ts → development/register-B0EYMBux.d.ts} +1 -1
- package/dist/{production/route-data-C-cmsWVs.d.mts → development/route-data-B3YkvRuy.d.mts} +1 -1
- package/dist/development/rsc-export.d.mts +1 -2
- package/dist/development/rsc-export.d.ts +1 -2
- package/dist/development/rsc-export.js +59 -37
- package/dist/development/rsc-export.mjs +60 -38
- package/dist/production/{browser-C9OqCpRB.d.mts → browser-BM9EKN98.d.mts} +3 -3
- package/dist/production/{chunk-FJS6IVQF.mjs → chunk-VMGK4BUZ.mjs} +127 -36
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.js +2 -1
- package/dist/production/dom-export.mjs +3 -2
- package/dist/production/index.d.mts +5 -5
- package/dist/production/index.d.ts +5 -5
- package/dist/production/index.js +137 -46
- package/dist/production/index.mjs +7 -7
- 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/register-zy84znbA.d.ts → production/register-B0EYMBux.d.ts} +1 -1
- package/dist/{development/route-data-C-cmsWVs.d.mts → production/route-data-B3YkvRuy.d.mts} +1 -1
- package/dist/production/rsc-export.d.mts +1 -2
- package/dist/production/rsc-export.d.ts +1 -2
- package/dist/production/rsc-export.js +59 -37
- package/dist/production/rsc-export.mjs +60 -38
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-e7eb25a7b
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -63,8 +63,6 @@ __export(react_router_exports, {
|
|
|
63
63
|
NavigationType: () => Action,
|
|
64
64
|
Outlet: () => Outlet,
|
|
65
65
|
PrefetchPageLinks: () => PrefetchPageLinks,
|
|
66
|
-
RSCHydratedRouter: () => RSCHydratedRouter,
|
|
67
|
-
RSCStaticRouter: () => RSCStaticRouter,
|
|
68
66
|
Route: () => Route,
|
|
69
67
|
Router: () => Router,
|
|
70
68
|
RouterProvider: () => RouterProvider,
|
|
@@ -105,7 +103,6 @@ __export(react_router_exports, {
|
|
|
105
103
|
UNSAFE_withErrorBoundaryProps: () => withErrorBoundaryProps,
|
|
106
104
|
UNSAFE_withHydrateFallbackProps: () => withHydrateFallbackProps,
|
|
107
105
|
createBrowserRouter: () => createBrowserRouter,
|
|
108
|
-
createCallServer: () => createCallServer,
|
|
109
106
|
createCookie: () => createCookie,
|
|
110
107
|
createCookieSessionStorage: () => createCookieSessionStorage,
|
|
111
108
|
createHashRouter: () => createHashRouter,
|
|
@@ -123,7 +120,6 @@ __export(react_router_exports, {
|
|
|
123
120
|
createStaticRouter: () => createStaticRouter,
|
|
124
121
|
data: () => data,
|
|
125
122
|
generatePath: () => generatePath,
|
|
126
|
-
getServerStream: () => getServerStream,
|
|
127
123
|
href: () => href,
|
|
128
124
|
isCookie: () => isCookie,
|
|
129
125
|
isRouteErrorResponse: () => isRouteErrorResponse,
|
|
@@ -136,10 +132,14 @@ __export(react_router_exports, {
|
|
|
136
132
|
renderMatches: () => renderMatches,
|
|
137
133
|
replace: () => replace,
|
|
138
134
|
resolvePath: () => resolvePath,
|
|
139
|
-
routeRSCServerRequest: () => routeRSCServerRequest,
|
|
140
135
|
unstable_HistoryRouter: () => HistoryRouter,
|
|
136
|
+
unstable_RSCHydratedRouter: () => RSCHydratedRouter,
|
|
137
|
+
unstable_RSCStaticRouter: () => RSCStaticRouter,
|
|
141
138
|
unstable_RouterContextProvider: () => unstable_RouterContextProvider,
|
|
139
|
+
unstable_createCallServer: () => createCallServer,
|
|
142
140
|
unstable_createContext: () => unstable_createContext,
|
|
141
|
+
unstable_getServerStream: () => getServerStream,
|
|
142
|
+
unstable_routeRSCServerRequest: () => routeRSCServerRequest,
|
|
143
143
|
unstable_setDevServerHooks: () => setDevServerHooks,
|
|
144
144
|
unstable_usePrompt: () => usePrompt,
|
|
145
145
|
useActionData: () => useActionData,
|
|
@@ -7356,7 +7356,7 @@ function getTurboStreamSingleFetchDataStrategy(getRouter, manifest, routeModules
|
|
|
7356
7356
|
);
|
|
7357
7357
|
return async (args) => args.unstable_runClientMiddleware(dataStrategy);
|
|
7358
7358
|
}
|
|
7359
|
-
function getSingleFetchDataStrategyImpl(getRouter, getRouteInfo, fetchAndDecode, ssr, basename) {
|
|
7359
|
+
function getSingleFetchDataStrategyImpl(getRouter, getRouteInfo, fetchAndDecode, ssr, basename, shouldAllowOptOut = () => true) {
|
|
7360
7360
|
return async (args) => {
|
|
7361
7361
|
let { request, matches, fetcherKey } = args;
|
|
7362
7362
|
let router = getRouter();
|
|
@@ -7379,7 +7379,8 @@ function getSingleFetchDataStrategyImpl(getRouter, getRouteInfo, fetchAndDecode,
|
|
|
7379
7379
|
getRouteInfo,
|
|
7380
7380
|
fetchAndDecode,
|
|
7381
7381
|
ssr,
|
|
7382
|
-
basename
|
|
7382
|
+
basename,
|
|
7383
|
+
shouldAllowOptOut
|
|
7383
7384
|
);
|
|
7384
7385
|
};
|
|
7385
7386
|
}
|
|
@@ -7431,7 +7432,7 @@ async function nonSsrStrategy(args, getRouteInfo, fetchAndDecode, basename) {
|
|
|
7431
7432
|
);
|
|
7432
7433
|
return results;
|
|
7433
7434
|
}
|
|
7434
|
-
async function singleFetchLoaderNavigationStrategy(args, router, getRouteInfo, fetchAndDecode, ssr, basename) {
|
|
7435
|
+
async function singleFetchLoaderNavigationStrategy(args, router, getRouteInfo, fetchAndDecode, ssr, basename, shouldAllowOptOut = () => true) {
|
|
7435
7436
|
let routesParams = /* @__PURE__ */ new Set();
|
|
7436
7437
|
let foundOptOutRoute = false;
|
|
7437
7438
|
let routeDfds = args.matches.map(() => createDeferred2());
|
|
@@ -7451,7 +7452,7 @@ async function singleFetchLoaderNavigationStrategy(args, router, getRouteInfo, f
|
|
|
7451
7452
|
hasShouldRevalidate === true);
|
|
7452
7453
|
return;
|
|
7453
7454
|
}
|
|
7454
|
-
if (hasClientLoader) {
|
|
7455
|
+
if (shouldAllowOptOut(m) && hasClientLoader) {
|
|
7455
7456
|
if (hasLoader) {
|
|
7456
7457
|
foundOptOutRoute = true;
|
|
7457
7458
|
}
|
|
@@ -8952,7 +8953,7 @@ function mergeRefs(...refs) {
|
|
|
8952
8953
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
8953
8954
|
try {
|
|
8954
8955
|
if (isBrowser) {
|
|
8955
|
-
window.__reactRouterVersion = "0.0.0-experimental-
|
|
8956
|
+
window.__reactRouterVersion = "0.0.0-experimental-e7eb25a7b";
|
|
8956
8957
|
}
|
|
8957
8958
|
} catch (e) {
|
|
8958
8959
|
}
|
|
@@ -11778,23 +11779,11 @@ function createRouterFromPayload({
|
|
|
11778
11779
|
void 0,
|
|
11779
11780
|
false
|
|
11780
11781
|
),
|
|
11781
|
-
async patchRoutesOnNavigation({
|
|
11782
|
-
|
|
11783
|
-
|
|
11784
|
-
|
|
11785
|
-
|
|
11786
|
-
let payload2 = await decode2(response.body);
|
|
11787
|
-
if (payload2.type !== "manifest") {
|
|
11788
|
-
throw new Error("Failed to patch routes on navigation");
|
|
11789
|
-
}
|
|
11790
|
-
payload2.matches.forEach(
|
|
11791
|
-
(match, i) => patch(payload2.matches[i - 1]?.id ?? null, [
|
|
11792
|
-
createRouteFromServerManifest(match)
|
|
11793
|
-
])
|
|
11794
|
-
);
|
|
11795
|
-
payload2.patches.forEach((p) => {
|
|
11796
|
-
patch(p.parentId ?? null, [createRouteFromServerManifest(p)]);
|
|
11797
|
-
});
|
|
11782
|
+
async patchRoutesOnNavigation({ path, signal }) {
|
|
11783
|
+
if (discoveredPaths2.has(path)) {
|
|
11784
|
+
return;
|
|
11785
|
+
}
|
|
11786
|
+
await fetchAndApplyManifestPatches2([path], decode2, signal);
|
|
11798
11787
|
},
|
|
11799
11788
|
// FIXME: Pass `build.ssr` and `build.basename` into this function
|
|
11800
11789
|
dataStrategy: getRSCSingleFetchDataStrategy(
|
|
@@ -11835,23 +11824,35 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, decode2) {
|
|
|
11835
11824
|
// pass map into fetchAndDecode so it can add payloads
|
|
11836
11825
|
getFetchAndDecodeViaRSC(decode2),
|
|
11837
11826
|
ssr,
|
|
11838
|
-
basename
|
|
11827
|
+
basename,
|
|
11828
|
+
// If we don't have an element, we need to hit the server loader flow
|
|
11829
|
+
// regardless of whether the client loader calls `serverLoader` or not,
|
|
11830
|
+
// otherwise we'll have nothing to render.
|
|
11831
|
+
// TODO: Do we need to account for API routes? Do we need a
|
|
11832
|
+
// `match.hasComponent` flag?
|
|
11833
|
+
(match) => match.route.element != null
|
|
11839
11834
|
);
|
|
11840
11835
|
return async (args) => args.unstable_runClientMiddleware(async () => {
|
|
11841
11836
|
let context = args.context;
|
|
11842
11837
|
context.set(renderedRoutesContext, []);
|
|
11843
11838
|
let results = await dataStrategy(args);
|
|
11844
|
-
const
|
|
11845
|
-
|
|
11846
|
-
|
|
11839
|
+
const renderedRoutesById = /* @__PURE__ */ new Map();
|
|
11840
|
+
for (const route of context.get(renderedRoutesContext)) {
|
|
11841
|
+
if (!renderedRoutesById.has(route.id)) {
|
|
11842
|
+
renderedRoutesById.set(route.id, []);
|
|
11843
|
+
}
|
|
11844
|
+
renderedRoutesById.get(route.id).push(route);
|
|
11845
|
+
}
|
|
11847
11846
|
for (const match of args.matches) {
|
|
11848
|
-
const
|
|
11849
|
-
if (
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
|
|
11847
|
+
const renderedRoutes = renderedRoutesById.get(match.route.id);
|
|
11848
|
+
if (renderedRoutes) {
|
|
11849
|
+
for (const rendered of renderedRoutes) {
|
|
11850
|
+
window.__router.patchRoutes(
|
|
11851
|
+
rendered.parentId ?? null,
|
|
11852
|
+
[createRouteFromServerManifest(rendered)],
|
|
11853
|
+
true
|
|
11854
|
+
);
|
|
11855
|
+
}
|
|
11855
11856
|
}
|
|
11856
11857
|
}
|
|
11857
11858
|
return results;
|
|
@@ -11910,7 +11911,8 @@ function getFetchAndDecodeViaRSC(decode2) {
|
|
|
11910
11911
|
}
|
|
11911
11912
|
function RSCHydratedRouter({
|
|
11912
11913
|
decode: decode2,
|
|
11913
|
-
payload
|
|
11914
|
+
payload,
|
|
11915
|
+
routeDiscovery = "eager"
|
|
11914
11916
|
}) {
|
|
11915
11917
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
11916
11918
|
let router = React14.useMemo(
|
|
@@ -11924,6 +11926,49 @@ function RSCHydratedRouter({
|
|
|
11924
11926
|
window.__router.initialize();
|
|
11925
11927
|
}
|
|
11926
11928
|
}, []);
|
|
11929
|
+
React14.useEffect(() => {
|
|
11930
|
+
if (routeDiscovery === "lazy" || // @ts-expect-error - TS doesn't know about this yet
|
|
11931
|
+
window.navigator?.connection?.saveData === true) {
|
|
11932
|
+
return;
|
|
11933
|
+
}
|
|
11934
|
+
function registerElement(el) {
|
|
11935
|
+
let path = el.tagName === "FORM" ? el.getAttribute("action") : el.getAttribute("href");
|
|
11936
|
+
if (!path) {
|
|
11937
|
+
return;
|
|
11938
|
+
}
|
|
11939
|
+
let pathname = el.tagName === "A" ? el.pathname : new URL(path, window.location.origin).pathname;
|
|
11940
|
+
if (!discoveredPaths2.has(pathname)) {
|
|
11941
|
+
nextPaths2.add(pathname);
|
|
11942
|
+
}
|
|
11943
|
+
}
|
|
11944
|
+
async function fetchPatches() {
|
|
11945
|
+
document.querySelectorAll("a[data-discover], form[data-discover]").forEach(registerElement);
|
|
11946
|
+
let paths = Array.from(nextPaths2.keys()).filter((path) => {
|
|
11947
|
+
if (discoveredPaths2.has(path)) {
|
|
11948
|
+
nextPaths2.delete(path);
|
|
11949
|
+
return false;
|
|
11950
|
+
}
|
|
11951
|
+
return true;
|
|
11952
|
+
});
|
|
11953
|
+
if (paths.length === 0) {
|
|
11954
|
+
return;
|
|
11955
|
+
}
|
|
11956
|
+
try {
|
|
11957
|
+
await fetchAndApplyManifestPatches2(paths, decode2);
|
|
11958
|
+
} catch (e) {
|
|
11959
|
+
console.error("Failed to fetch manifest patches", e);
|
|
11960
|
+
}
|
|
11961
|
+
}
|
|
11962
|
+
let debouncedFetchPatches = debounce2(fetchPatches, 100);
|
|
11963
|
+
fetchPatches();
|
|
11964
|
+
let observer = new MutationObserver(() => debouncedFetchPatches());
|
|
11965
|
+
observer.observe(document.documentElement, {
|
|
11966
|
+
subtree: true,
|
|
11967
|
+
childList: true,
|
|
11968
|
+
attributes: true,
|
|
11969
|
+
attributeFilter: ["data-discover", "href", "action"]
|
|
11970
|
+
});
|
|
11971
|
+
}, [routeDiscovery, decode2]);
|
|
11927
11972
|
const frameworkContext = {
|
|
11928
11973
|
future: {
|
|
11929
11974
|
// These flags have no runtime impact so can always be false. If we add
|
|
@@ -11953,7 +11998,12 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
11953
11998
|
let initialData = payload?.loaderData[match.id];
|
|
11954
11999
|
let hasInitialError = payload?.errors && match.id in payload.errors;
|
|
11955
12000
|
let initialError = payload?.errors?.[match.id];
|
|
11956
|
-
let isHydrationRequest = match.clientLoader?.hydrate === true || !match.hasLoader
|
|
12001
|
+
let isHydrationRequest = match.clientLoader?.hydrate === true || !match.hasLoader || // If we don't have an element, we need to hit the server loader flow
|
|
12002
|
+
// regardless of whether the client loader calls `serverLoader` or not,
|
|
12003
|
+
// otherwise we'll have nothing to render.
|
|
12004
|
+
// TODO: Do we need to account for API routes? Do we need a
|
|
12005
|
+
// `match.hasComponent` flag?
|
|
12006
|
+
!match.element;
|
|
11957
12007
|
let dataRoute = {
|
|
11958
12008
|
id: match.id,
|
|
11959
12009
|
element: match.element,
|
|
@@ -12035,6 +12085,47 @@ function preventInvalidServerHandlerCall2(type, routeId, hasHandler) {
|
|
|
12035
12085
|
throw new ErrorResponseImpl(400, "Bad Request", new Error(msg), true);
|
|
12036
12086
|
}
|
|
12037
12087
|
}
|
|
12088
|
+
var nextPaths2 = /* @__PURE__ */ new Set();
|
|
12089
|
+
var discoveredPathsMaxSize2 = 1e3;
|
|
12090
|
+
var discoveredPaths2 = /* @__PURE__ */ new Set();
|
|
12091
|
+
var URL_LIMIT2 = 7680;
|
|
12092
|
+
async function fetchAndApplyManifestPatches2(paths, decode2, signal) {
|
|
12093
|
+
let basename = (window.__router.basename ?? "").replace(/^\/|\/$/g, "");
|
|
12094
|
+
let url = new URL(`${basename}/.manifest`, window.location.origin);
|
|
12095
|
+
paths.sort().forEach((path) => url.searchParams.append("p", path));
|
|
12096
|
+
if (url.toString().length > URL_LIMIT2) {
|
|
12097
|
+
nextPaths2.clear();
|
|
12098
|
+
return;
|
|
12099
|
+
}
|
|
12100
|
+
let response = await fetch(url, { signal });
|
|
12101
|
+
if (!response.body || response.status < 200 || response.status >= 300) {
|
|
12102
|
+
throw new Error("Unable to fetch new route matches from the server");
|
|
12103
|
+
}
|
|
12104
|
+
let payload = await decode2(response.body);
|
|
12105
|
+
if (payload.type !== "manifest") {
|
|
12106
|
+
throw new Error("Failed to patch routes");
|
|
12107
|
+
}
|
|
12108
|
+
paths.forEach((p) => addToFifoQueue2(p, discoveredPaths2));
|
|
12109
|
+
payload.patches.forEach((p) => {
|
|
12110
|
+
window.__router.patchRoutes(p.parentId ?? null, [
|
|
12111
|
+
createRouteFromServerManifest(p)
|
|
12112
|
+
]);
|
|
12113
|
+
});
|
|
12114
|
+
}
|
|
12115
|
+
function addToFifoQueue2(path, queue) {
|
|
12116
|
+
if (queue.size >= discoveredPathsMaxSize2) {
|
|
12117
|
+
let first = queue.values().next().value;
|
|
12118
|
+
queue.delete(first);
|
|
12119
|
+
}
|
|
12120
|
+
queue.add(path);
|
|
12121
|
+
}
|
|
12122
|
+
function debounce2(callback, wait) {
|
|
12123
|
+
let timeoutId;
|
|
12124
|
+
return (...args) => {
|
|
12125
|
+
window.clearTimeout(timeoutId);
|
|
12126
|
+
timeoutId = window.setTimeout(() => callback(...args), wait);
|
|
12127
|
+
};
|
|
12128
|
+
}
|
|
12038
12129
|
|
|
12039
12130
|
// lib/rsc/server.ssr.tsx
|
|
12040
12131
|
var React15 = __toESM(require("react"));
|
|
@@ -12383,8 +12474,6 @@ function deserializeErrors2(errors) {
|
|
|
12383
12474
|
NavigationType,
|
|
12384
12475
|
Outlet,
|
|
12385
12476
|
PrefetchPageLinks,
|
|
12386
|
-
RSCHydratedRouter,
|
|
12387
|
-
RSCStaticRouter,
|
|
12388
12477
|
Route,
|
|
12389
12478
|
Router,
|
|
12390
12479
|
RouterProvider,
|
|
@@ -12425,7 +12514,6 @@ function deserializeErrors2(errors) {
|
|
|
12425
12514
|
UNSAFE_withErrorBoundaryProps,
|
|
12426
12515
|
UNSAFE_withHydrateFallbackProps,
|
|
12427
12516
|
createBrowserRouter,
|
|
12428
|
-
createCallServer,
|
|
12429
12517
|
createCookie,
|
|
12430
12518
|
createCookieSessionStorage,
|
|
12431
12519
|
createHashRouter,
|
|
@@ -12443,7 +12531,6 @@ function deserializeErrors2(errors) {
|
|
|
12443
12531
|
createStaticRouter,
|
|
12444
12532
|
data,
|
|
12445
12533
|
generatePath,
|
|
12446
|
-
getServerStream,
|
|
12447
12534
|
href,
|
|
12448
12535
|
isCookie,
|
|
12449
12536
|
isRouteErrorResponse,
|
|
@@ -12456,10 +12543,14 @@ function deserializeErrors2(errors) {
|
|
|
12456
12543
|
renderMatches,
|
|
12457
12544
|
replace,
|
|
12458
12545
|
resolvePath,
|
|
12459
|
-
routeRSCServerRequest,
|
|
12460
12546
|
unstable_HistoryRouter,
|
|
12547
|
+
unstable_RSCHydratedRouter,
|
|
12548
|
+
unstable_RSCStaticRouter,
|
|
12461
12549
|
unstable_RouterContextProvider,
|
|
12550
|
+
unstable_createCallServer,
|
|
12462
12551
|
unstable_createContext,
|
|
12552
|
+
unstable_getServerStream,
|
|
12553
|
+
unstable_routeRSCServerRequest,
|
|
12463
12554
|
unstable_setDevServerHooks,
|
|
12464
12555
|
unstable_usePrompt,
|
|
12465
12556
|
useActionData,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v0.0.0-experimental-
|
|
2
|
+
* react-router v0.0.0-experimental-e7eb25a7b
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
withComponentProps,
|
|
135
135
|
withErrorBoundaryProps,
|
|
136
136
|
withHydrateFallbackProps
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-SHQJZRZ7.mjs";
|
|
138
138
|
export {
|
|
139
139
|
Await,
|
|
140
140
|
BrowserRouter,
|
|
@@ -152,8 +152,6 @@ export {
|
|
|
152
152
|
Action as NavigationType,
|
|
153
153
|
Outlet,
|
|
154
154
|
PrefetchPageLinks,
|
|
155
|
-
RSCHydratedRouter,
|
|
156
|
-
RSCStaticRouter,
|
|
157
155
|
Route,
|
|
158
156
|
Router,
|
|
159
157
|
RouterProvider,
|
|
@@ -194,7 +192,6 @@ export {
|
|
|
194
192
|
withErrorBoundaryProps as UNSAFE_withErrorBoundaryProps,
|
|
195
193
|
withHydrateFallbackProps as UNSAFE_withHydrateFallbackProps,
|
|
196
194
|
createBrowserRouter,
|
|
197
|
-
createCallServer,
|
|
198
195
|
createCookie,
|
|
199
196
|
createCookieSessionStorage,
|
|
200
197
|
createHashRouter,
|
|
@@ -212,7 +209,6 @@ export {
|
|
|
212
209
|
createStaticRouter,
|
|
213
210
|
data,
|
|
214
211
|
generatePath,
|
|
215
|
-
getServerStream,
|
|
216
212
|
href,
|
|
217
213
|
isCookie,
|
|
218
214
|
isRouteErrorResponse,
|
|
@@ -225,10 +221,14 @@ export {
|
|
|
225
221
|
renderMatches,
|
|
226
222
|
replace,
|
|
227
223
|
resolvePath,
|
|
228
|
-
routeRSCServerRequest,
|
|
229
224
|
HistoryRouter as unstable_HistoryRouter,
|
|
225
|
+
RSCHydratedRouter as unstable_RSCHydratedRouter,
|
|
226
|
+
RSCStaticRouter as unstable_RSCStaticRouter,
|
|
230
227
|
unstable_RouterContextProvider,
|
|
228
|
+
createCallServer as unstable_createCallServer,
|
|
231
229
|
unstable_createContext,
|
|
230
|
+
getServerStream as unstable_getServerStream,
|
|
231
|
+
routeRSCServerRequest as unstable_routeRSCServerRequest,
|
|
232
232
|
setDevServerHooks as unstable_setDevServerHooks,
|
|
233
233
|
usePrompt as unstable_usePrompt,
|
|
234
234
|
useActionData,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aV as RouteModule, aD as LinkDescriptor, L as Location, aW as Pretty, aA as MetaDescriptor, aX as GetLoaderData, h as MiddlewareEnabled, a9 as unstable_RouterContextProvider, i as AppLoadContext, aY as unstable_MiddlewareNextFunction, aZ as ServerDataFrom, a_ as Normalize, a$ as GetActionData } from '../../route-data-B3YkvRuy.mjs';
|
|
2
2
|
import { a as RouteFiles, P as Pages } from '../../register-DeIo2iHO.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aX as RouteModule, aI as LinkDescriptor, i as Location, aY as Pretty, aG as MetaDescriptor, aZ as GetLoaderData, M as MiddlewareEnabled, u as unstable_RouterContextProvider, A as AppLoadContext, a_ as unstable_MiddlewareNextFunction, a$ as ServerDataFrom, b0 as RouteFiles, b1 as Normalize, _ as Pages, b2 as GetActionData } from '../../register-B0EYMBux.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
|
|
4
4
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -1824,4 +1824,4 @@ type RouteFiles = Register extends {
|
|
|
1824
1824
|
routeFiles: infer Registered extends AnyRouteFiles;
|
|
1825
1825
|
} ? Registered : AnyRouteFiles;
|
|
1826
1826
|
|
|
1827
|
-
export { type Equal as $, type AppLoadContext as A, type BlockerFunction as B, type ClientLoaderFunction as C, type DataRouteObject as D, type PageLinkDescriptor as E, type FutureConfig as F, type History as G, type HydrationState as H, type
|
|
1827
|
+
export { type Equal as $, type AppLoadContext as A, type BlockerFunction as B, type ClientLoaderFunction as C, type DataRouteObject as D, type PageLinkDescriptor as E, type FutureConfig as F, type History as G, type HydrationState as H, type IndexRouteObject as I, type GetScrollRestorationKeyFunction as J, type Fetcher as K, type LoaderFunctionArgs as L, type MiddlewareEnabled as M, type NavigateOptions as N, type CreateStaticHandlerOptions as O, type ParamParseKey as P, type StaticHandler as Q, type RouteManifest as R, type ServerRouteModule as S, type To as T, type UIMatch as U, type LoaderFunction as V, type ActionFunction as W, type MetaFunction as X, type LinksFunction as Y, type unstable_InitialContext as Z, type Pages as _, type ActionFunctionArgs as a, type ServerDataFrom as a$, type ClientActionFunction as a0, type ShouldRevalidateFunction as a1, type RouterState as a2, type GetScrollPositionFunction as a3, type NavigationStates as a4, type RouterSubscriber as a5, type RouterNavigateOptions as a6, type RouterFetchOptions as a7, type RevalidationState as a8, type DataStrategyFunctionArgs as a9, type PatchRoutesOnNavigationFunctionArgs as aA, type ClientActionFunctionArgs as aB, type ClientLoaderFunctionArgs as aC, type HeadersArgs as aD, type HeadersFunction as aE, type MetaArgs as aF, type MetaDescriptor as aG, type HtmlLinkDescriptor as aH, type LinkDescriptor as aI, type Future as aJ, type unstable_SerializesTo as aK, type Register as aL, createBrowserHistory as aM, invariant as aN, createRouter as aO, ErrorResponseImpl as aP, DataRouterContext as aQ, DataRouterStateContext as aR, FetchersContext as aS, LocationContext as aT, NavigationContext as aU, RouteContext as aV, ViewTransitionContext as aW, type RouteModule as aX, type Pretty as aY, type GetLoaderData as aZ, type unstable_MiddlewareNextFunction as a_, type DataStrategyMatch as aa, type DataStrategyResult as ab, DataWithResponseInit as ac, type ErrorResponse as ad, type FormMethod as ae, type unstable_MiddlewareFunction as af, type PathParam as ag, type RedirectFunction as ah, type unstable_RouterContext as ai, type ShouldRevalidateFunctionArgs as aj, unstable_createContext as ak, createPath as al, parsePath as am, IDLE_NAVIGATION as an, IDLE_FETCHER as ao, IDLE_BLOCKER as ap, data as aq, generatePath as ar, isRouteErrorResponse as as, matchPath as at, matchRoutes as au, redirect as av, redirectDocument as aw, replace as ax, resolvePath as ay, type DataRouteMatch as az, type RouteModules as b, type RouteFiles as b0, type Normalize as b1, type GetActionData as b2, type StaticHandlerContext as c, type Router as d, type DataStrategyFunction as e, type Blocker as f, type SerializeFrom as g, type RelativeRoutingType as h, type Location as i, type Path as j, type PathPattern as k, type PathMatch as l, type Navigation as m, Action as n, type Params as o, type RouteObject as p, type LazyRouteFunction as q, type NonIndexRouteObject as r, type RouterInit as s, type InitialEntry as t, unstable_RouterContextProvider as u, type PatchRoutesOnNavigationFunction as v, type Navigator as w, type RouteMatch as x, type HTMLFormMethod as y, type FormEncType as z };
|
|
@@ -1801,4 +1801,4 @@ type _DataActionData<ServerActionData, ClientActionData> = Awaited<[
|
|
|
1801
1801
|
IsDefined<ClientActionData>
|
|
1802
1802
|
] extends [true, true] ? ServerActionData | ClientActionData : IsDefined<ClientActionData> extends true ? ClientActionData : IsDefined<ServerActionData> extends true ? ServerActionData : undefined>;
|
|
1803
1803
|
|
|
1804
|
-
export { type Params as $, type ActionFunction as A, type Blocker as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type DataStrategyMatch as J, type DataStrategyResult as K, type Location as L, type MetaFunction as M, type NonIndexRouteObject as N, DataWithResponseInit as O, type PatchRoutesOnNavigationFunction as P, type ErrorResponse as Q, type RouterInit as R, type StaticHandlerContext as S, type To as T, type FormEncType as U, type FormMethod as V, type HTMLFormMethod as W, type LazyRouteFunction as X, type LoaderFunctionArgs as Y, type unstable_MiddlewareFunction as Z, type ParamParseKey as _, type Router as a, type GetActionData as a$, type PathMatch as a0, type PathParam as a1, type PathPattern as a2, type RedirectFunction as a3, type unstable_RouterContext as a4, type ShouldRevalidateFunction as a5, type ShouldRevalidateFunctionArgs as a6, type UIMatch as a7, unstable_createContext as a8, unstable_RouterContextProvider as a9, type MetaDescriptor as aA, type PageLinkDescriptor as aB, type HtmlLinkDescriptor as aC, type LinkDescriptor as aD, type Future as aE, type unstable_SerializesTo as aF, createBrowserHistory as aG, invariant as aH, createRouter as aI, ErrorResponseImpl as aJ, DataRouterContext as aK, DataRouterStateContext as aL, FetchersContext as aM, LocationContext as aN, NavigationContext as aO, RouteContext as aP, ViewTransitionContext as aQ, type RouteManifest as aR, type ServerRouteModule as aS, type SerializeFrom as aT, type History as aU, type RouteModule as aV, type
|
|
1804
|
+
export { type Params as $, type ActionFunction as A, type Blocker as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type DataStrategyMatch as J, type DataStrategyResult as K, type Location as L, type MetaFunction as M, type NonIndexRouteObject as N, DataWithResponseInit as O, type PatchRoutesOnNavigationFunction as P, type ErrorResponse as Q, type RouterInit as R, type StaticHandlerContext as S, type To as T, type FormEncType as U, type FormMethod as V, type HTMLFormMethod as W, type LazyRouteFunction as X, type LoaderFunctionArgs as Y, type unstable_MiddlewareFunction as Z, type ParamParseKey as _, type Router as a, type GetActionData as a$, type PathMatch as a0, type PathParam as a1, type PathPattern as a2, type RedirectFunction as a3, type unstable_RouterContext as a4, type ShouldRevalidateFunction as a5, type ShouldRevalidateFunctionArgs as a6, type UIMatch as a7, unstable_createContext as a8, unstable_RouterContextProvider as a9, type MetaDescriptor as aA, type PageLinkDescriptor as aB, type HtmlLinkDescriptor as aC, type LinkDescriptor as aD, type Future as aE, type unstable_SerializesTo as aF, createBrowserHistory as aG, invariant as aH, createRouter as aI, ErrorResponseImpl as aJ, DataRouterContext as aK, DataRouterStateContext as aL, FetchersContext as aM, LocationContext as aN, NavigationContext as aO, RouteContext as aP, ViewTransitionContext as aQ, type RouteManifest as aR, type ServerRouteModule as aS, type SerializeFrom as aT, type History as aU, type RouteModule as aV, type Pretty as aW, type GetLoaderData as aX, type unstable_MiddlewareNextFunction as aY, type ServerDataFrom as aZ, type Normalize as a_, Action as aa, createPath as ab, parsePath as ac, IDLE_NAVIGATION as ad, IDLE_FETCHER as ae, IDLE_BLOCKER as af, data as ag, generatePath as ah, isRouteErrorResponse as ai, matchPath as aj, matchRoutes as ak, redirect as al, redirectDocument as am, replace as an, resolvePath as ao, type DataRouteMatch as ap, type NavigateOptions as aq, type Navigator as ar, type PatchRoutesOnNavigationFunctionArgs as as, type RouteMatch as at, type ClientActionFunction as au, type ClientActionFunctionArgs as av, type ClientLoaderFunctionArgs as aw, type HeadersArgs as ax, type HeadersFunction as ay, type MetaArgs as az, type RouteModules as b, type RouteObject as c, type StaticHandler as d, type IndexRouteObject as e, type LoaderFunction as f, type LinksFunction as g, type MiddlewareEnabled as h, type AppLoadContext as i, type RouterState as j, type DataRouteObject as k, type ClientLoaderFunction as l, type Path as m, type GetScrollRestorationKeyFunction as n, type Fetcher as o, type Navigation as p, type NavigationStates as q, type RelativeRoutingType as r, type BlockerFunction as s, type RouterSubscriber as t, type unstable_InitialContext as u, type RouterNavigateOptions as v, type RouterFetchOptions as w, type RevalidationState as x, type ActionFunctionArgs as y, type DataStrategyFunctionArgs as z };
|
|
@@ -1763,7 +1763,6 @@ type ServerRenderPayload = {
|
|
|
1763
1763
|
};
|
|
1764
1764
|
type ServerManifestPayload = {
|
|
1765
1765
|
type: "manifest";
|
|
1766
|
-
matches: RenderedRoute[];
|
|
1767
1766
|
patches: RenderedRoute[];
|
|
1768
1767
|
};
|
|
1769
1768
|
type ServerActionPayload = {
|
|
@@ -1795,4 +1794,4 @@ declare function matchRSCServerRequest({ decodeCallServer, decodeFormAction, onE
|
|
|
1795
1794
|
generateResponse: (match: ServerMatch) => Response;
|
|
1796
1795
|
}): Promise<Response>;
|
|
1797
1796
|
|
|
1798
|
-
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type
|
|
1797
|
+
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type FlashSessionData, type IsCookieFunction, type IsSessionFunction, type RenderedRoute as ServerRouteManifest, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isSession, matchRoutes, redirect, redirectDocument, replace, type DecodeCallServerFunction as unstable_DecodeCallServerFunction, type DecodeFormActionFunction as unstable_DecodeFormActionFunction, type unstable_MiddlewareFunction, type unstable_MiddlewareNextFunction, type unstable_RouterContext, unstable_RouterContextProvider, type ServerManifestPayload as unstable_ServerManifestPayload, type ServerMatch as unstable_ServerMatch, type ServerPayload as unstable_ServerPayload, type ServerRenderPayload as unstable_ServerRenderPayload, type ServerRouteMatch as unstable_ServerRouteMatch, type ServerRouteObject as unstable_ServerRouteObject, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|
|
@@ -1763,7 +1763,6 @@ type ServerRenderPayload = {
|
|
|
1763
1763
|
};
|
|
1764
1764
|
type ServerManifestPayload = {
|
|
1765
1765
|
type: "manifest";
|
|
1766
|
-
matches: RenderedRoute[];
|
|
1767
1766
|
patches: RenderedRoute[];
|
|
1768
1767
|
};
|
|
1769
1768
|
type ServerActionPayload = {
|
|
@@ -1795,4 +1794,4 @@ declare function matchRSCServerRequest({ decodeCallServer, decodeFormAction, onE
|
|
|
1795
1794
|
generateResponse: (match: ServerMatch) => Response;
|
|
1796
1795
|
}): Promise<Response>;
|
|
1797
1796
|
|
|
1798
|
-
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type
|
|
1797
|
+
export { type Cookie, type CookieOptions, type CookieSignatureOptions, type FlashSessionData, type IsCookieFunction, type IsSessionFunction, type RenderedRoute as ServerRouteManifest, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, createCookie, createCookieSessionStorage, createMemorySessionStorage, createSession, createSessionStorage, createStaticHandler, data, isCookie, isSession, matchRoutes, redirect, redirectDocument, replace, type DecodeCallServerFunction as unstable_DecodeCallServerFunction, type DecodeFormActionFunction as unstable_DecodeFormActionFunction, type unstable_MiddlewareFunction, type unstable_MiddlewareNextFunction, type unstable_RouterContext, unstable_RouterContextProvider, type ServerManifestPayload as unstable_ServerManifestPayload, type ServerMatch as unstable_ServerMatch, type ServerPayload as unstable_ServerPayload, type ServerRenderPayload as unstable_ServerRenderPayload, type ServerRouteMatch as unstable_ServerRouteMatch, type ServerRouteObject as unstable_ServerRouteObject, unstable_createContext, matchRSCServerRequest as unstable_matchRSCServerRequest };
|
|
@@ -25,7 +25,7 @@ function _interopNamespace(e) {
|
|
|
25
25
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* react-router v0.0.0-experimental-
|
|
28
|
+
* react-router v0.0.0-experimental-e7eb25a7b
|
|
29
29
|
*
|
|
30
30
|
* Copyright (c) Remix Software Inc.
|
|
31
31
|
*
|
|
@@ -61,7 +61,7 @@ function createKey() {
|
|
|
61
61
|
}
|
|
62
62
|
function createLocation(current, to, state = null, key) {
|
|
63
63
|
let location = {
|
|
64
|
-
pathname:
|
|
64
|
+
pathname: "string" === "string" ? current : current.pathname,
|
|
65
65
|
search: "",
|
|
66
66
|
hash: "",
|
|
67
67
|
...typeof to === "string" ? parsePath(to) : to,
|
|
@@ -1506,10 +1506,9 @@ async function runMiddlewarePipeline(args, propagateResult, handler, errorHandle
|
|
|
1506
1506
|
middlewareState.middlewareError.error,
|
|
1507
1507
|
middlewareState.middlewareError.routeId
|
|
1508
1508
|
);
|
|
1509
|
-
|
|
1509
|
+
{
|
|
1510
1510
|
return result;
|
|
1511
1511
|
}
|
|
1512
|
-
return Object.assign(middlewareState.handlerResult, result);
|
|
1513
1512
|
}
|
|
1514
1513
|
}
|
|
1515
1514
|
async function callRouteMiddleware(args, middlewares, propagateResult, middlewareState, handler, idx = 0) {
|
|
@@ -1543,7 +1542,7 @@ async function callRouteMiddleware(args, middlewares, propagateResult, middlewar
|
|
|
1543
1542
|
handler,
|
|
1544
1543
|
idx + 1
|
|
1545
1544
|
);
|
|
1546
|
-
|
|
1545
|
+
{
|
|
1547
1546
|
nextResult = result;
|
|
1548
1547
|
return nextResult;
|
|
1549
1548
|
}
|
|
@@ -2476,19 +2475,28 @@ async function matchRSCServerRequest({
|
|
|
2476
2475
|
}
|
|
2477
2476
|
async function generateManifestResponse(routes, request, generateResponse) {
|
|
2478
2477
|
let url = new URL(request.url);
|
|
2479
|
-
let
|
|
2478
|
+
let pathnameParams = url.searchParams.getAll("p");
|
|
2479
|
+
let pathnames = pathnameParams.length ? pathnameParams : [url.pathname.replace(/\.manifest$/, "")];
|
|
2480
|
+
let routeIds = /* @__PURE__ */ new Set();
|
|
2481
|
+
let matchedRoutes = pathnames.flatMap((pathname) => {
|
|
2482
|
+
let pathnameMatches = matchRoutes(routes, pathname);
|
|
2483
|
+
return pathnameMatches?.map((m, i) => ({
|
|
2484
|
+
...m.route,
|
|
2485
|
+
parentId: pathnameMatches[i - 1]?.route.id
|
|
2486
|
+
})) ?? [];
|
|
2487
|
+
}).filter((route) => {
|
|
2488
|
+
if (!routeIds.has(route.id)) {
|
|
2489
|
+
routeIds.add(route.id);
|
|
2490
|
+
return true;
|
|
2491
|
+
}
|
|
2492
|
+
return false;
|
|
2493
|
+
});
|
|
2480
2494
|
let payload = {
|
|
2481
2495
|
type: "manifest",
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
),
|
|
2487
|
-
patches: await getAdditionalRoutePatches(
|
|
2488
|
-
url.pathname,
|
|
2489
|
-
routes,
|
|
2490
|
-
matches?.map((m) => m.route.id) ?? []
|
|
2491
|
-
)
|
|
2496
|
+
patches: (await Promise.all([
|
|
2497
|
+
...matchedRoutes.map((route) => getManifestRoute(route)),
|
|
2498
|
+
getAdditionalRoutePatches(pathnames, routes, Array.from(routeIds))
|
|
2499
|
+
])).flat(1)
|
|
2492
2500
|
};
|
|
2493
2501
|
return generateResponse({
|
|
2494
2502
|
statusCode: 200,
|
|
@@ -2555,7 +2563,11 @@ async function generateRenderResponse(request, routes, decodeCallServer, decodeF
|
|
|
2555
2563
|
if (matches) {
|
|
2556
2564
|
await Promise.all(matches.map((m) => explodeLazyRoute(m.route)));
|
|
2557
2565
|
}
|
|
2558
|
-
const handler = createStaticHandler(routes
|
|
2566
|
+
const handler = createStaticHandler(routes, {
|
|
2567
|
+
mapRouteProperties: (r) => ({
|
|
2568
|
+
hasErrorBoundary: r.ErrorBoundary != null
|
|
2569
|
+
})
|
|
2570
|
+
});
|
|
2559
2571
|
const result = await handler.query(request, {
|
|
2560
2572
|
skipLoaderErrorBubbling: isDataRequest,
|
|
2561
2573
|
skipRevalidation: isSubmission,
|
|
@@ -2693,7 +2705,7 @@ async function getRenderPayload(baseRenderPayload, routes, routeIdsToLoad, isDat
|
|
|
2693
2705
|
})
|
|
2694
2706
|
);
|
|
2695
2707
|
let patchesPromise = !isDataRequest ? getAdditionalRoutePatches(
|
|
2696
|
-
staticContext.location.pathname,
|
|
2708
|
+
[staticContext.location.pathname],
|
|
2697
2709
|
routes,
|
|
2698
2710
|
staticContext.matches.map((m) => m.route.id)
|
|
2699
2711
|
) : void 0;
|
|
@@ -2789,7 +2801,7 @@ async function getServerRouteMatch(staticContext, match, shouldRenderComponent,
|
|
|
2789
2801
|
shouldRevalidate: match.route.shouldRevalidate
|
|
2790
2802
|
};
|
|
2791
2803
|
}
|
|
2792
|
-
async function getManifestRoute(route
|
|
2804
|
+
async function getManifestRoute(route) {
|
|
2793
2805
|
await explodeLazyRoute(route);
|
|
2794
2806
|
const Layout = route.Layout || React__namespace.Fragment;
|
|
2795
2807
|
const errorElement = route.ErrorBoundary ? React__namespace.createElement(
|
|
@@ -2806,7 +2818,7 @@ async function getManifestRoute(route, parentId) {
|
|
|
2806
2818
|
errorElement,
|
|
2807
2819
|
hasLoader: !!route.loader,
|
|
2808
2820
|
id: route.id,
|
|
2809
|
-
parentId,
|
|
2821
|
+
parentId: route.parentId,
|
|
2810
2822
|
path: route.path,
|
|
2811
2823
|
index: "index" in route ? route.index : void 0,
|
|
2812
2824
|
links: route.links,
|
|
@@ -2822,26 +2834,36 @@ async function explodeLazyRoute(route) {
|
|
|
2822
2834
|
route.lazy = void 0;
|
|
2823
2835
|
}
|
|
2824
2836
|
}
|
|
2825
|
-
async function getAdditionalRoutePatches(
|
|
2837
|
+
async function getAdditionalRoutePatches(pathnames, routes, matchedRouteIds) {
|
|
2826
2838
|
let patchRouteMatches = /* @__PURE__ */ new Map();
|
|
2827
|
-
let
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
paths.push(`/${segments.join("/")}`);
|
|
2839
|
+
let matchedPaths = /* @__PURE__ */ new Set();
|
|
2840
|
+
for (const pathname of pathnames) {
|
|
2841
|
+
let segments = pathname.split("/").filter(Boolean);
|
|
2842
|
+
let paths = ["/"];
|
|
2832
2843
|
segments.pop();
|
|
2844
|
+
while (segments.length > 0) {
|
|
2845
|
+
paths.push(`/${segments.join("/")}`);
|
|
2846
|
+
segments.pop();
|
|
2847
|
+
}
|
|
2848
|
+
paths.forEach((path) => {
|
|
2849
|
+
if (matchedPaths.has(path)) {
|
|
2850
|
+
return;
|
|
2851
|
+
}
|
|
2852
|
+
matchedPaths.add(path);
|
|
2853
|
+
let matches = matchRoutes(routes, path) || [];
|
|
2854
|
+
matches.forEach((m, i) => {
|
|
2855
|
+
if (patchRouteMatches.get(m.route.id)) {
|
|
2856
|
+
return;
|
|
2857
|
+
}
|
|
2858
|
+
patchRouteMatches.set(m.route.id, {
|
|
2859
|
+
...m.route,
|
|
2860
|
+
parentId: matches[i - 1]?.route.id
|
|
2861
|
+
});
|
|
2862
|
+
});
|
|
2863
|
+
});
|
|
2833
2864
|
}
|
|
2834
|
-
paths.forEach((path) => {
|
|
2835
|
-
let matches = matchRoutes(routes, path) || [];
|
|
2836
|
-
matches.forEach(
|
|
2837
|
-
(m, i) => patchRouteMatches.set(m.route.id, {
|
|
2838
|
-
...m.route,
|
|
2839
|
-
parentId: matches[i - 1]?.route.id
|
|
2840
|
-
})
|
|
2841
|
-
);
|
|
2842
|
-
});
|
|
2843
2865
|
let patches = await Promise.all(
|
|
2844
|
-
[...patchRouteMatches.values()].filter((route) => !matchedRouteIds.some((id) => id === route.id)).map((route) => getManifestRoute(route
|
|
2866
|
+
[...patchRouteMatches.values()].filter((route) => !matchedRouteIds.some((id) => id === route.id)).map((route) => getManifestRoute(route))
|
|
2845
2867
|
);
|
|
2846
2868
|
return patches;
|
|
2847
2869
|
}
|
|
@@ -2862,9 +2884,9 @@ exports.createStaticHandler = createStaticHandler;
|
|
|
2862
2884
|
exports.data = data;
|
|
2863
2885
|
exports.isCookie = isCookie;
|
|
2864
2886
|
exports.isSession = isSession;
|
|
2865
|
-
exports.matchRSCServerRequest = matchRSCServerRequest;
|
|
2866
2887
|
exports.matchRoutes = matchRoutes;
|
|
2867
2888
|
exports.redirect = redirect;
|
|
2868
2889
|
exports.redirectDocument = redirectDocument;
|
|
2869
2890
|
exports.replace = replace;
|
|
2870
2891
|
exports.unstable_createContext = unstable_createContext;
|
|
2892
|
+
exports.unstable_matchRSCServerRequest = matchRSCServerRequest;
|