react-router 7.5.1 → 7.5.2
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 +12 -0
- package/dist/development/{chunk-LSOULM7L.mjs → chunk-BAXFHI7N.mjs} +104 -35
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +89 -61
- package/dist/development/dom-export.mjs +17 -41
- package/dist/{production/fog-of-war-CyHis97d.d.mts → development/fog-of-war-BLArG-qZ.d.ts} +2 -2
- package/dist/development/{fog-of-war-D4x86-Xc.d.ts → fog-of-war-D2zsXvum.d.mts} +2 -2
- package/dist/development/index.d.mts +19 -16
- package/dist/development/index.d.ts +19 -16
- package/dist/development/index.js +105 -35
- package/dist/development/index.mjs +6 -4
- package/dist/development/lib/types/route-module.d.mts +1 -1
- package/dist/development/lib/types/route-module.d.ts +1 -1
- package/dist/development/lib/types/route-module.js +1 -1
- package/dist/development/lib/types/route-module.mjs +1 -1
- package/dist/development/{route-data-OcOrqK13.d.ts → route-data-C12CLHiN.d.mts} +1 -1
- package/dist/{production/route-data-OcOrqK13.d.mts → development/route-data-C12CLHiN.d.ts} +1 -1
- package/dist/production/{chunk-SAWFLE7G.mjs → chunk-XAHXRTXS.mjs} +104 -35
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +89 -61
- package/dist/production/dom-export.mjs +17 -41
- package/dist/{development/fog-of-war-CyHis97d.d.mts → production/fog-of-war-BLArG-qZ.d.ts} +2 -2
- package/dist/production/{fog-of-war-D4x86-Xc.d.ts → fog-of-war-D2zsXvum.d.mts} +2 -2
- package/dist/production/index.d.mts +19 -16
- package/dist/production/index.d.ts +19 -16
- package/dist/production/index.js +105 -35
- package/dist/production/index.mjs +6 -4
- package/dist/production/lib/types/route-module.d.mts +1 -1
- package/dist/production/lib/types/route-module.d.ts +1 -1
- package/dist/production/lib/types/route-module.js +1 -1
- package/dist/production/lib/types/route-module.mjs +1 -1
- package/dist/production/{route-data-OcOrqK13.d.ts → route-data-C12CLHiN.d.mts} +1 -1
- package/dist/{development/route-data-OcOrqK13.d.mts → production/route-data-C12CLHiN.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.5.
|
|
2
|
+
* react-router v7.5.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -71,8 +71,9 @@ import {
|
|
|
71
71
|
decodeViaTurboStream,
|
|
72
72
|
deserializeErrors,
|
|
73
73
|
generatePath,
|
|
74
|
+
getHydrationData,
|
|
74
75
|
getPatchRoutesOnNavigationFunction,
|
|
75
|
-
|
|
76
|
+
getTurboStreamSingleFetchDataStrategy,
|
|
76
77
|
href,
|
|
77
78
|
hydrationRouteProperties,
|
|
78
79
|
invariant,
|
|
@@ -124,7 +125,7 @@ import {
|
|
|
124
125
|
useSearchParams,
|
|
125
126
|
useSubmit,
|
|
126
127
|
useViewTransitionState
|
|
127
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-BAXFHI7N.mjs";
|
|
128
129
|
export {
|
|
129
130
|
Await,
|
|
130
131
|
BrowserRouter,
|
|
@@ -169,8 +170,9 @@ export {
|
|
|
169
170
|
createRouter as UNSAFE_createRouter,
|
|
170
171
|
decodeViaTurboStream as UNSAFE_decodeViaTurboStream,
|
|
171
172
|
deserializeErrors as UNSAFE_deserializeErrors,
|
|
173
|
+
getHydrationData as UNSAFE_getHydrationData,
|
|
172
174
|
getPatchRoutesOnNavigationFunction as UNSAFE_getPatchRoutesOnNavigationFunction,
|
|
173
|
-
|
|
175
|
+
getTurboStreamSingleFetchDataStrategy as UNSAFE_getTurboStreamSingleFetchDataStrategy,
|
|
174
176
|
hydrationRouteProperties as UNSAFE_hydrationRouteProperties,
|
|
175
177
|
invariant as UNSAFE_invariant,
|
|
176
178
|
mapRouteProperties as UNSAFE_mapRouteProperties,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aF as LinkDescriptor, aC as MetaDescriptor, aU as ServerDataFrom, aV as ClientDataFrom, aW as Func, aX as unstable_MiddlewareNextFunction, E as Equal, u as unstable_RouterContextProvider, M as MiddlewareEnabled, aY as Pretty } from '../../route-data-C12CLHiN.mjs';
|
|
2
2
|
import { A as AppLoadContext } from '../../data-CQbyyGzl.mjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aF as LinkDescriptor, aC as MetaDescriptor, aU as ServerDataFrom, aV as ClientDataFrom, aW as Func, aX as unstable_MiddlewareNextFunction, E as Equal, u as unstable_RouterContextProvider, M as MiddlewareEnabled, aY as Pretty } from '../../route-data-C12CLHiN.js';
|
|
2
2
|
import { A as AppLoadContext } from '../../data-CQbyyGzl.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
@@ -1736,4 +1736,4 @@ type ServerDataFrom<T> = ServerData<DataFrom<T>>;
|
|
|
1736
1736
|
type ClientDataFrom<T> = ClientData<DataFrom<T>>;
|
|
1737
1737
|
type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [ClientLoaderFunctionArgs | ClientActionFunctionArgs] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
|
|
1738
1738
|
|
|
1739
|
-
export { type
|
|
1739
|
+
export { type DataStrategyResult as $, type ActionFunctionArgs as A, type BlockerFunction as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type DataRouteObject as G, type HydrationState as H, type InitialEntry as I, type ClientLoaderFunction as J, type GetScrollPositionFunction as K, type LoaderFunctionArgs as L, type MiddlewareEnabled as M, type NavigateOptions as N, type GetScrollRestorationKeyFunction as O, type ParamParseKey as P, type Fetcher as Q, type RouterInit as R, type ServerRouteModule as S, type To as T, type UIMatch as U, type NavigationStates as V, type RouterSubscriber as W, type RouterNavigateOptions as X, type RouterFetchOptions as Y, type DataStrategyFunctionArgs as Z, type DataStrategyMatch as _, type Router as a, DataWithResponseInit as a0, type ErrorResponse as a1, type FormEncType as a2, type FormMethod as a3, type HTMLFormMethod as a4, type LazyRouteFunction as a5, type unstable_MiddlewareFunction as a6, type PathParam as a7, type RedirectFunction as a8, type unstable_RouterContext as a9, type HeadersFunction as aA, type MetaArgs as aB, type MetaDescriptor as aC, type PageLinkDescriptor as aD, type HtmlLinkDescriptor as aE, type LinkDescriptor as aF, type Future as aG, type unstable_SerializesTo as aH, createBrowserHistory as aI, invariant as aJ, createRouter as aK, ErrorResponseImpl as aL, DataRouterContext as aM, DataRouterStateContext as aN, FetchersContext as aO, LocationContext as aP, NavigationContext as aQ, RouteContext as aR, ViewTransitionContext as aS, type History as aT, type ServerDataFrom as aU, type ClientDataFrom as aV, type Func as aW, type unstable_MiddlewareNextFunction as aX, type Pretty as aY, type ShouldRevalidateFunction as aa, type ShouldRevalidateFunctionArgs as ab, unstable_createContext as ac, createPath as ad, parsePath as ae, IDLE_NAVIGATION as af, IDLE_FETCHER as ag, IDLE_BLOCKER as ah, data as ai, generatePath as aj, isRouteErrorResponse as ak, matchPath as al, matchRoutes as am, redirect as an, redirectDocument as ao, replace as ap, resolvePath as aq, type DataRouteMatch as ar, type Navigator as as, type PatchRoutesOnNavigationFunction as at, type PatchRoutesOnNavigationFunctionArgs as au, type RouteMatch as av, type ClientActionFunction as aw, type ClientActionFunctionArgs as ax, type ClientLoaderFunctionArgs as ay, type HeadersArgs as az, type RouteModules as b, type RouteManifest as c, type RelativeRoutingType as d, type Location as e, Action as f, type Path as g, type PathPattern as h, type PathMatch as i, type Params as j, type RouteObject as k, type Navigation as l, type RevalidationState as m, type SerializeFrom as n, type Blocker as o, type StaticHandlerContext as p, type StaticHandler as q, type unstable_InitialContext as r, type IndexRouteObject as s, type LoaderFunction as t, unstable_RouterContextProvider as u, type ActionFunction as v, type MetaFunction as w, type LinksFunction as x, type NonIndexRouteObject as y, type RouterState as z };
|
|
@@ -1736,4 +1736,4 @@ type ServerDataFrom<T> = ServerData<DataFrom<T>>;
|
|
|
1736
1736
|
type ClientDataFrom<T> = ClientData<DataFrom<T>>;
|
|
1737
1737
|
type SerializeFrom<T> = T extends (...args: infer Args) => unknown ? Args extends [ClientLoaderFunctionArgs | ClientActionFunctionArgs] ? ClientDataFrom<T> : ServerDataFrom<T> : T;
|
|
1738
1738
|
|
|
1739
|
-
export { type
|
|
1739
|
+
export { type DataStrategyResult as $, type ActionFunctionArgs as A, type BlockerFunction as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type DataRouteObject as G, type HydrationState as H, type InitialEntry as I, type ClientLoaderFunction as J, type GetScrollPositionFunction as K, type LoaderFunctionArgs as L, type MiddlewareEnabled as M, type NavigateOptions as N, type GetScrollRestorationKeyFunction as O, type ParamParseKey as P, type Fetcher as Q, type RouterInit as R, type ServerRouteModule as S, type To as T, type UIMatch as U, type NavigationStates as V, type RouterSubscriber as W, type RouterNavigateOptions as X, type RouterFetchOptions as Y, type DataStrategyFunctionArgs as Z, type DataStrategyMatch as _, type Router as a, DataWithResponseInit as a0, type ErrorResponse as a1, type FormEncType as a2, type FormMethod as a3, type HTMLFormMethod as a4, type LazyRouteFunction as a5, type unstable_MiddlewareFunction as a6, type PathParam as a7, type RedirectFunction as a8, type unstable_RouterContext as a9, type HeadersFunction as aA, type MetaArgs as aB, type MetaDescriptor as aC, type PageLinkDescriptor as aD, type HtmlLinkDescriptor as aE, type LinkDescriptor as aF, type Future as aG, type unstable_SerializesTo as aH, createBrowserHistory as aI, invariant as aJ, createRouter as aK, ErrorResponseImpl as aL, DataRouterContext as aM, DataRouterStateContext as aN, FetchersContext as aO, LocationContext as aP, NavigationContext as aQ, RouteContext as aR, ViewTransitionContext as aS, type History as aT, type ServerDataFrom as aU, type ClientDataFrom as aV, type Func as aW, type unstable_MiddlewareNextFunction as aX, type Pretty as aY, type ShouldRevalidateFunction as aa, type ShouldRevalidateFunctionArgs as ab, unstable_createContext as ac, createPath as ad, parsePath as ae, IDLE_NAVIGATION as af, IDLE_FETCHER as ag, IDLE_BLOCKER as ah, data as ai, generatePath as aj, isRouteErrorResponse as ak, matchPath as al, matchRoutes as am, redirect as an, redirectDocument as ao, replace as ap, resolvePath as aq, type DataRouteMatch as ar, type Navigator as as, type PatchRoutesOnNavigationFunction as at, type PatchRoutesOnNavigationFunctionArgs as au, type RouteMatch as av, type ClientActionFunction as aw, type ClientActionFunctionArgs as ax, type ClientLoaderFunctionArgs as ay, type HeadersArgs as az, type RouteModules as b, type RouteManifest as c, type RelativeRoutingType as d, type Location as e, Action as f, type Path as g, type PathPattern as h, type PathMatch as i, type Params as j, type RouteObject as k, type Navigation as l, type RevalidationState as m, type SerializeFrom as n, type Blocker as o, type StaticHandlerContext as p, type StaticHandler as q, type unstable_InitialContext as r, type IndexRouteObject as s, type LoaderFunction as t, unstable_RouterContextProvider as u, type ActionFunction as v, type MetaFunction as w, type LinksFunction as x, type NonIndexRouteObject as y, type RouterState as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.5.
|
|
2
|
+
* react-router v7.5.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -6312,6 +6312,7 @@ async function createRequestInit(request) {
|
|
|
6312
6312
|
|
|
6313
6313
|
// lib/dom/ssr/single-fetch.tsx
|
|
6314
6314
|
var SingleFetchRedirectSymbol = Symbol("SingleFetchRedirect");
|
|
6315
|
+
var SINGLE_FETCH_REDIRECT_STATUS = 202;
|
|
6315
6316
|
var NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([100, 101, 204, 205]);
|
|
6316
6317
|
function StreamTransfer({
|
|
6317
6318
|
context,
|
|
@@ -6379,10 +6380,19 @@ function StreamTransfer({
|
|
|
6379
6380
|
)));
|
|
6380
6381
|
}
|
|
6381
6382
|
}
|
|
6382
|
-
function
|
|
6383
|
+
function getTurboStreamSingleFetchDataStrategy(getRouter, manifest, routeModules, ssr, basename) {
|
|
6383
6384
|
let dataStrategy = getSingleFetchDataStrategyImpl(
|
|
6384
6385
|
getRouter,
|
|
6385
|
-
|
|
6386
|
+
(match) => {
|
|
6387
|
+
let manifestRoute = manifest.routes[match.route.id];
|
|
6388
|
+
invariant2(manifestRoute, "Route not found in manifest");
|
|
6389
|
+
let routeModule = routeModules[match.route.id];
|
|
6390
|
+
return {
|
|
6391
|
+
hasLoader: manifestRoute.hasLoader,
|
|
6392
|
+
hasClientLoader: manifestRoute.hasClientLoader,
|
|
6393
|
+
hasShouldRevalidate: Boolean(routeModule?.shouldRevalidate)
|
|
6394
|
+
};
|
|
6395
|
+
},
|
|
6386
6396
|
fetchAndDecodeViaTurboStream,
|
|
6387
6397
|
ssr,
|
|
6388
6398
|
basename
|
|
@@ -6397,7 +6407,7 @@ function getSingleFetchDataStrategyImpl(getRouter, getRouteInfo, fetchAndDecode,
|
|
|
6397
6407
|
return singleFetchActionStrategy(args, fetchAndDecode, basename);
|
|
6398
6408
|
}
|
|
6399
6409
|
let foundRevalidatingServerLoader = matches.some((m) => {
|
|
6400
|
-
let { hasLoader, hasClientLoader } = getRouteInfo(m
|
|
6410
|
+
let { hasLoader, hasClientLoader } = getRouteInfo(m);
|
|
6401
6411
|
return m.unstable_shouldCallHandler() && hasLoader && !hasClientLoader;
|
|
6402
6412
|
});
|
|
6403
6413
|
if (!ssr && !foundRevalidatingServerLoader) {
|
|
@@ -6449,7 +6459,7 @@ async function nonSsrStrategy(args, getRouteInfo, fetchAndDecode, basename) {
|
|
|
6449
6459
|
matchesToLoad.map(
|
|
6450
6460
|
(m) => m.resolve(async (handler) => {
|
|
6451
6461
|
try {
|
|
6452
|
-
let { hasClientLoader } = getRouteInfo(m
|
|
6462
|
+
let { hasClientLoader } = getRouteInfo(m);
|
|
6453
6463
|
let routeId = m.route.id;
|
|
6454
6464
|
let result = hasClientLoader ? await handler(async () => {
|
|
6455
6465
|
let { data: data2 } = await fetchAndDecode(args, basename, [routeId]);
|
|
@@ -6475,7 +6485,7 @@ async function singleFetchLoaderNavigationStrategy(args, router, getRouteInfo, f
|
|
|
6475
6485
|
async (m, i) => m.resolve(async (handler) => {
|
|
6476
6486
|
routeDfds[i].resolve();
|
|
6477
6487
|
let routeId = m.route.id;
|
|
6478
|
-
let { hasLoader, hasClientLoader, hasShouldRevalidate } = getRouteInfo(
|
|
6488
|
+
let { hasLoader, hasClientLoader, hasShouldRevalidate } = getRouteInfo(m);
|
|
6479
6489
|
let defaultShouldRevalidate = !m.unstable_shouldRevalidateArgs || m.unstable_shouldRevalidateArgs.actionStatus == null || m.unstable_shouldRevalidateArgs.actionStatus < 400;
|
|
6480
6490
|
let shouldCall = m.unstable_shouldCallHandler(defaultShouldRevalidate);
|
|
6481
6491
|
if (!shouldCall) {
|
|
@@ -6516,7 +6526,7 @@ async function singleFetchLoaderNavigationStrategy(args, router, getRouteInfo, f
|
|
|
6516
6526
|
);
|
|
6517
6527
|
await Promise.all(routeDfds.map((d) => d.promise));
|
|
6518
6528
|
if ((!router.state.initialized || routesParams.size === 0) && !window.__reactRouterHdrActive) {
|
|
6519
|
-
singleFetchDfd.resolve({});
|
|
6529
|
+
singleFetchDfd.resolve({ routes: {} });
|
|
6520
6530
|
} else {
|
|
6521
6531
|
let targetRoutes = ssr && foundOptOutRoute && routesParams.size > 0 ? [...routesParams.keys()] : void 0;
|
|
6522
6532
|
try {
|
|
@@ -6584,6 +6594,20 @@ async function fetchAndDecodeViaTurboStream(args, basename, targetRoutes) {
|
|
|
6584
6594
|
if (res.status === 404 && !res.headers.has("X-Remix-Response")) {
|
|
6585
6595
|
throw new ErrorResponseImpl(404, "Not Found", true);
|
|
6586
6596
|
}
|
|
6597
|
+
if (res.status === 204 && res.headers.has("X-Remix-Redirect")) {
|
|
6598
|
+
return {
|
|
6599
|
+
status: SINGLE_FETCH_REDIRECT_STATUS,
|
|
6600
|
+
data: {
|
|
6601
|
+
redirect: {
|
|
6602
|
+
redirect: res.headers.get("X-Remix-Redirect"),
|
|
6603
|
+
status: Number(res.headers.get("X-Remix-Status") || "302"),
|
|
6604
|
+
revalidate: res.headers.get("X-Remix-Revalidate") === "true",
|
|
6605
|
+
reload: res.headers.get("X-Remix-Reload-Document") === "true",
|
|
6606
|
+
replace: res.headers.get("X-Remix-Replace") === "true"
|
|
6607
|
+
}
|
|
6608
|
+
}
|
|
6609
|
+
};
|
|
6610
|
+
}
|
|
6587
6611
|
if (NO_BODY_STATUS_CODES.has(res.status)) {
|
|
6588
6612
|
let routes = {};
|
|
6589
6613
|
if (targetRoutes && request.method !== "GET") {
|
|
@@ -7034,8 +7058,9 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7034
7058
|
}
|
|
7035
7059
|
};
|
|
7036
7060
|
dataRoute.loader.hydrate = shouldHydrateRouteLoader(
|
|
7037
|
-
route,
|
|
7038
|
-
routeModule,
|
|
7061
|
+
route.id,
|
|
7062
|
+
routeModule.clientLoader,
|
|
7063
|
+
route.hasLoader,
|
|
7039
7064
|
isSpaMode
|
|
7040
7065
|
);
|
|
7041
7066
|
dataRoute.action = ({ request, params, context }, singleFetch) => {
|
|
@@ -7233,8 +7258,8 @@ function getRouteModuleComponent(routeModule) {
|
|
|
7233
7258
|
return routeModule.default;
|
|
7234
7259
|
}
|
|
7235
7260
|
}
|
|
7236
|
-
function shouldHydrateRouteLoader(
|
|
7237
|
-
return isSpaMode &&
|
|
7261
|
+
function shouldHydrateRouteLoader(routeId, clientLoader, hasLoader, isSpaMode) {
|
|
7262
|
+
return isSpaMode && routeId !== "root" || clientLoader != null && (clientLoader.hydrate === true || hasLoader !== true);
|
|
7238
7263
|
}
|
|
7239
7264
|
|
|
7240
7265
|
// lib/dom/ssr/fog-of-war.ts
|
|
@@ -7916,7 +7941,7 @@ function mergeRefs(...refs) {
|
|
|
7916
7941
|
var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
7917
7942
|
try {
|
|
7918
7943
|
if (isBrowser) {
|
|
7919
|
-
window.__reactRouterVersion = "7.5.
|
|
7944
|
+
window.__reactRouterVersion = "7.5.2";
|
|
7920
7945
|
}
|
|
7921
7946
|
} catch (e) {
|
|
7922
7947
|
}
|
|
@@ -9019,7 +9044,12 @@ function ServerRouter({
|
|
|
9019
9044
|
let routeId = match.route.id;
|
|
9020
9045
|
let route = routeModules[routeId];
|
|
9021
9046
|
let manifestRoute = context.manifest.routes[routeId];
|
|
9022
|
-
if (route && manifestRoute && shouldHydrateRouteLoader(
|
|
9047
|
+
if (route && manifestRoute && shouldHydrateRouteLoader(
|
|
9048
|
+
routeId,
|
|
9049
|
+
route.clientLoader,
|
|
9050
|
+
manifestRoute.hasLoader,
|
|
9051
|
+
context.isSpaMode
|
|
9052
|
+
) && (route.HydrateFallback || !manifestRoute.hasLoader)) {
|
|
9023
9053
|
delete context.staticHandlerContext.loaderData[routeId];
|
|
9024
9054
|
}
|
|
9025
9055
|
}
|
|
@@ -9488,6 +9518,26 @@ function invariant3(value, message) {
|
|
|
9488
9518
|
}
|
|
9489
9519
|
}
|
|
9490
9520
|
|
|
9521
|
+
// lib/server-runtime/dev.ts
|
|
9522
|
+
var globalDevServerHooksKey = "__reactRouterDevServerHooks";
|
|
9523
|
+
function setDevServerHooks(devServerHooks) {
|
|
9524
|
+
globalThis[globalDevServerHooksKey] = devServerHooks;
|
|
9525
|
+
}
|
|
9526
|
+
function getDevServerHooks() {
|
|
9527
|
+
return globalThis[globalDevServerHooksKey];
|
|
9528
|
+
}
|
|
9529
|
+
function getBuildTimeHeader(request, headerName) {
|
|
9530
|
+
if (typeof process !== "undefined") {
|
|
9531
|
+
try {
|
|
9532
|
+
if (process.env?.IS_RR_BUILD_REQUEST === "yes") {
|
|
9533
|
+
return request.headers.get(headerName);
|
|
9534
|
+
}
|
|
9535
|
+
} catch (e) {
|
|
9536
|
+
}
|
|
9537
|
+
}
|
|
9538
|
+
return null;
|
|
9539
|
+
}
|
|
9540
|
+
|
|
9491
9541
|
// lib/server-runtime/routes.ts
|
|
9492
9542
|
function groupRoutesByParentId2(manifest) {
|
|
9493
9543
|
let routes = {};
|
|
@@ -9519,10 +9569,11 @@ function createStaticHandlerDataRoutes(manifest, future, parentId = "", routesBy
|
|
|
9519
9569
|
// Need to use RR's version in the param typed here to permit the optional
|
|
9520
9570
|
// context even though we know it'll always be provided in remix
|
|
9521
9571
|
loader: route.module.loader ? async (args) => {
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9572
|
+
let preRenderedData = getBuildTimeHeader(
|
|
9573
|
+
args.request,
|
|
9574
|
+
"X-React-Router-Prerender-Data"
|
|
9575
|
+
);
|
|
9576
|
+
if (preRenderedData != null) {
|
|
9526
9577
|
let encoded = preRenderedData ? decodeURI(preRenderedData) : preRenderedData;
|
|
9527
9578
|
invariant3(encoded, "Missing prerendered data for route");
|
|
9528
9579
|
let uint8array = new TextEncoder().encode(encoded);
|
|
@@ -9597,15 +9648,6 @@ function createServerHandoffString(serverHandoff) {
|
|
|
9597
9648
|
return escapeHtml2(JSON.stringify(serverHandoff));
|
|
9598
9649
|
}
|
|
9599
9650
|
|
|
9600
|
-
// lib/server-runtime/dev.ts
|
|
9601
|
-
var globalDevServerHooksKey = "__reactRouterDevServerHooks";
|
|
9602
|
-
function setDevServerHooks(devServerHooks) {
|
|
9603
|
-
globalThis[globalDevServerHooksKey] = devServerHooks;
|
|
9604
|
-
}
|
|
9605
|
-
function getDevServerHooks() {
|
|
9606
|
-
return globalThis[globalDevServerHooksKey];
|
|
9607
|
-
}
|
|
9608
|
-
|
|
9609
9651
|
// lib/server-runtime/single-fetch.ts
|
|
9610
9652
|
import { encode } from "turbo-stream";
|
|
9611
9653
|
|
|
@@ -9676,7 +9718,6 @@ function prependCookies(parentHeaders, childHeaders) {
|
|
|
9676
9718
|
}
|
|
9677
9719
|
|
|
9678
9720
|
// lib/server-runtime/single-fetch.ts
|
|
9679
|
-
var SINGLE_FETCH_REDIRECT_STATUS = 202;
|
|
9680
9721
|
var SERVER_NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([
|
|
9681
9722
|
...NO_BODY_STATUS_CODES,
|
|
9682
9723
|
304
|
|
@@ -10015,9 +10056,10 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
10015
10056
|
if (stripBasename(normalizedPath, normalizedBasename) !== "/" && normalizedPath.endsWith("/")) {
|
|
10016
10057
|
normalizedPath = normalizedPath.slice(0, -1);
|
|
10017
10058
|
}
|
|
10059
|
+
let isSpaMode = getBuildTimeHeader(request, "X-React-Router-SPA-Mode") === "yes";
|
|
10018
10060
|
if (!_build.ssr) {
|
|
10019
10061
|
if (_build.prerender.length === 0) {
|
|
10020
|
-
|
|
10062
|
+
isSpaMode = true;
|
|
10021
10063
|
} else if (!_build.prerender.includes(normalizedPath) && !_build.prerender.includes(normalizedPath + "/")) {
|
|
10022
10064
|
if (url.pathname.endsWith(".data")) {
|
|
10023
10065
|
errorHandler(
|
|
@@ -10037,7 +10079,7 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
10037
10079
|
statusText: "Not Found"
|
|
10038
10080
|
});
|
|
10039
10081
|
} else {
|
|
10040
|
-
|
|
10082
|
+
isSpaMode = true;
|
|
10041
10083
|
}
|
|
10042
10084
|
}
|
|
10043
10085
|
}
|
|
@@ -10106,7 +10148,7 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
10106
10148
|
);
|
|
10107
10149
|
}
|
|
10108
10150
|
}
|
|
10109
|
-
} else if (!
|
|
10151
|
+
} else if (!isSpaMode && matches && matches[matches.length - 1].route.module.default == null && matches[matches.length - 1].route.module.ErrorBoundary == null) {
|
|
10110
10152
|
response = await handleResourceRequest(
|
|
10111
10153
|
serverMode,
|
|
10112
10154
|
_build,
|
|
@@ -10131,6 +10173,7 @@ Error: ${e instanceof Error ? e.toString() : e}`
|
|
|
10131
10173
|
request,
|
|
10132
10174
|
loadContext,
|
|
10133
10175
|
handleError,
|
|
10176
|
+
isSpaMode,
|
|
10134
10177
|
criticalCss
|
|
10135
10178
|
);
|
|
10136
10179
|
}
|
|
@@ -10206,8 +10249,7 @@ async function handleSingleFetchRequest(serverMode, build, staticHandler, reques
|
|
|
10206
10249
|
);
|
|
10207
10250
|
return response;
|
|
10208
10251
|
}
|
|
10209
|
-
async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, criticalCss) {
|
|
10210
|
-
let isSpaMode = request.headers.has("X-React-Router-SPA-Mode");
|
|
10252
|
+
async function handleDocumentRequest(serverMode, build, staticHandler, request, loadContext, handleError, isSpaMode, criticalCss) {
|
|
10211
10253
|
try {
|
|
10212
10254
|
let response = await staticHandler.query(request, {
|
|
10213
10255
|
requestContext: loadContext,
|
|
@@ -10480,7 +10522,7 @@ function createSessionStorage({
|
|
|
10480
10522
|
function warnOnceAboutSigningSessionCookie(cookie) {
|
|
10481
10523
|
warnOnce(
|
|
10482
10524
|
cookie.isSigned,
|
|
10483
|
-
`The "${cookie.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://
|
|
10525
|
+
`The "${cookie.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies for more information.`
|
|
10484
10526
|
);
|
|
10485
10527
|
}
|
|
10486
10528
|
|
|
@@ -10597,6 +10639,32 @@ function deserializeErrors2(errors) {
|
|
|
10597
10639
|
return serialized;
|
|
10598
10640
|
}
|
|
10599
10641
|
|
|
10642
|
+
// lib/dom/ssr/hydration.tsx
|
|
10643
|
+
function getHydrationData(state, routes, getRouteInfo, location, basename, isSpaMode) {
|
|
10644
|
+
let hydrationData = {
|
|
10645
|
+
...state,
|
|
10646
|
+
loaderData: { ...state.loaderData }
|
|
10647
|
+
};
|
|
10648
|
+
let initialMatches = matchRoutes(routes, location, basename);
|
|
10649
|
+
if (initialMatches) {
|
|
10650
|
+
for (let match of initialMatches) {
|
|
10651
|
+
let routeId = match.route.id;
|
|
10652
|
+
let routeInfo = getRouteInfo(routeId);
|
|
10653
|
+
if (shouldHydrateRouteLoader(
|
|
10654
|
+
routeId,
|
|
10655
|
+
routeInfo.clientLoader,
|
|
10656
|
+
routeInfo.hasLoader,
|
|
10657
|
+
isSpaMode
|
|
10658
|
+
) && (routeInfo.hasHydrateFallback || !routeInfo.hasLoader)) {
|
|
10659
|
+
delete hydrationData.loaderData[routeId];
|
|
10660
|
+
} else if (!routeInfo.hasLoader) {
|
|
10661
|
+
hydrationData.loaderData[routeId] = null;
|
|
10662
|
+
}
|
|
10663
|
+
}
|
|
10664
|
+
}
|
|
10665
|
+
return hydrationData;
|
|
10666
|
+
}
|
|
10667
|
+
|
|
10600
10668
|
export {
|
|
10601
10669
|
Action,
|
|
10602
10670
|
createBrowserHistory,
|
|
@@ -10663,7 +10731,7 @@ export {
|
|
|
10663
10731
|
renderMatches,
|
|
10664
10732
|
createSearchParams,
|
|
10665
10733
|
SingleFetchRedirectSymbol,
|
|
10666
|
-
|
|
10734
|
+
getTurboStreamSingleFetchDataStrategy,
|
|
10667
10735
|
decodeViaTurboStream,
|
|
10668
10736
|
RemixErrorBoundary,
|
|
10669
10737
|
createClientRoutesWithHMRRevalidationOptOut,
|
|
@@ -10712,5 +10780,6 @@ export {
|
|
|
10712
10780
|
createCookieSessionStorage,
|
|
10713
10781
|
createMemorySessionStorage,
|
|
10714
10782
|
href,
|
|
10715
|
-
deserializeErrors2 as deserializeErrors
|
|
10783
|
+
deserializeErrors2 as deserializeErrors,
|
|
10784
|
+
getHydrationData
|
|
10716
10785
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './fog-of-war-
|
|
3
|
-
import { R as RouterInit } from './route-data-
|
|
2
|
+
import { R as RouterProviderProps$1 } from './fog-of-war-D2zsXvum.mjs';
|
|
3
|
+
import { R as RouterInit } from './route-data-C12CLHiN.mjs';
|
|
4
4
|
|
|
5
5
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
6
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './fog-of-war-
|
|
3
|
-
import { R as RouterInit } from './route-data-
|
|
2
|
+
import { R as RouterProviderProps$1 } from './fog-of-war-BLArG-qZ.js';
|
|
3
|
+
import { R as RouterInit } from './route-data-C12CLHiN.js';
|
|
4
4
|
|
|
5
5
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
6
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|