react-router 7.5.1-pre.0 → 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 +19 -1
- package/dist/development/{chunk-QP2GE2RJ.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-TOAG3JKW.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
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
-
## 7.5.
|
|
3
|
+
## 7.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Update Single Fetch to also handle the 204 redirects used in `?_data` requests in Remix v2 ([#13364](https://github.com/remix-run/react-router/pull/13364))
|
|
8
|
+
|
|
9
|
+
- This allows applications to return a redirect on `.data` requests from outside the scope of React Router (i.e., an `express`/`hono` middleware)
|
|
10
|
+
- ⚠️ Please note that doing so relies on implementation details that are subject to change without a SemVer major release
|
|
11
|
+
- This is primarily done to ease upgrading to Single Fetch for existing Remix v2 applications, but the recommended way to handle this is redirecting from a route middleware
|
|
12
|
+
|
|
13
|
+
- Adjust approach for Prerendering/SPA Mode via headers ([#13453](https://github.com/remix-run/react-router/pull/13453))
|
|
14
|
+
|
|
15
|
+
## 7.5.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
6
18
|
|
|
7
19
|
- Fix single fetch bug where no revalidation request would be made when navigating upwards to a reused parent route ([#13253](https://github.com/remix-run/react-router/pull/13253))
|
|
20
|
+
|
|
8
21
|
- When using the object-based `route.lazy` API, the `HydrateFallback` and `hydrateFallbackElement` properties are now skipped when lazy loading routes after hydration. ([#13376](https://github.com/remix-run/react-router/pull/13376))
|
|
9
22
|
|
|
10
23
|
If you move the code for these properties into a separate file, you can use this optimization to avoid downloading unused hydration code. For example:
|
|
@@ -24,8 +37,11 @@
|
|
|
24
37
|
```
|
|
25
38
|
|
|
26
39
|
- Properly revalidate prerendered paths when param values change ([#13380](https://github.com/remix-run/react-router/pull/13380))
|
|
40
|
+
|
|
27
41
|
- UNSTABLE: Add a new `unstable_runClientMiddleware` argument to `dataStrategy` to enable middleware execution in custom `dataStrategy` implementations ([#13395](https://github.com/remix-run/react-router/pull/13395))
|
|
42
|
+
|
|
28
43
|
- UNSTABLE: Add better error messaging when `getLoadContext` is not updated to return a `Map`" ([#13242](https://github.com/remix-run/react-router/pull/13242))
|
|
44
|
+
|
|
29
45
|
- Do not automatically add `null` to `staticHandler.query()` `context.loaderData` if routes do not have loaders ([#13223](https://github.com/remix-run/react-router/pull/13223))
|
|
30
46
|
|
|
31
47
|
- This was a Remix v2 implementation detail inadvertently left in for React Router v7
|
|
@@ -33,7 +49,9 @@
|
|
|
33
49
|
- ⚠️ This could be a "breaking bug fix" for you if you are doing manual SSR with `createStaticHandler()`/`<StaticRouterProvider>`, and using `context.loaderData` to control `<RouterProvider>` hydration behavior on the client
|
|
34
50
|
|
|
35
51
|
- Fix prerendering when a loader returns a redirect ([#13365](https://github.com/remix-run/react-router/pull/13365))
|
|
52
|
+
|
|
36
53
|
- UNSTABLE: Update context type for `LoaderFunctionArgs`/`ActionFunctionArgs` when middleware is enabled ([#13381](https://github.com/remix-run/react-router/pull/13381))
|
|
54
|
+
|
|
37
55
|
- Add support for the new `unstable_shouldCallHandler`/`unstable_shouldRevalidateArgs` APIs in `dataStrategy` ([#13253](https://github.com/remix-run/react-router/pull/13253))
|
|
38
56
|
|
|
39
57
|
## 7.5.0
|
|
@@ -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;
|