react-router 7.18.4 → 7.18.5
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 +7 -0
- package/dist/development/{browser-eq4RgLsD.d.ts → browser-7x6a6gQP.d.ts} +1 -1
- package/dist/development/{browser-BR5QG7ZC.d.mts → browser-CiGxXXOl.d.mts} +1 -1
- package/dist/development/{chunk-GR4NQCSD.js → chunk-2ZBLYC7V.js} +30 -3
- package/dist/development/{chunk-OB3PAWPO.mjs → chunk-6KYCQHYJ.mjs} +30 -3
- package/dist/development/{chunk-LVPI3KDG.js → chunk-IFHLIXZW.js} +7 -7
- package/dist/{production/chunk-G2MPF4YY.mjs → development/chunk-JAHXRPFV.mjs} +13 -4
- package/dist/development/{chunk-HQO5H5CC.js → chunk-NDF5KBLP.js} +103 -103
- package/dist/{production/context-nqAapj74.d.mts → development/context-BlYKn1tE.d.mts} +2 -0
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +34 -34
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/{index-react-server-client-BjY-eKuf.d.ts → index-react-server-client-BaaZU3sM.d.ts} +1 -1
- package/dist/development/{index-react-server-client-K63fpMH4.d.mts → index-react-server-client-KK-TR-t7.d.mts} +1 -1
- package/dist/development/index-react-server-client.d.mts +2 -2
- 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 +2 -0
- package/dist/development/index-react-server.d.ts +2 -0
- package/dist/development/index-react-server.js +38 -15
- package/dist/development/index-react-server.mjs +38 -15
- package/dist/development/index.d.mts +6 -6
- package/dist/development/index.d.ts +6 -6
- package/dist/development/index.js +101 -92
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-B7w3_Eo9.d.ts → development/instrumentation-CPkMwccd.d.ts} +2 -0
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/production/{browser-eq4RgLsD.d.ts → browser-7x6a6gQP.d.ts} +1 -1
- package/dist/production/{browser-BR5QG7ZC.d.mts → browser-CiGxXXOl.d.mts} +1 -1
- package/dist/production/{chunk-AOOKMWND.js → chunk-75HN637G.js} +103 -103
- package/dist/production/{chunk-Q34X6AWR.mjs → chunk-7RTFRKQW.mjs} +30 -3
- package/dist/production/{chunk-YNGRUB6F.js → chunk-HNBICOIU.js} +30 -3
- package/dist/{development/chunk-H4DAEOV7.mjs → production/chunk-IAM5GYT3.mjs} +13 -4
- package/dist/production/{chunk-QURBR4FZ.js → chunk-K3NA4NUH.js} +7 -7
- package/dist/{development/context-nqAapj74.d.mts → production/context-BlYKn1tE.d.mts} +2 -0
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +34 -34
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/{index-react-server-client-BjY-eKuf.d.ts → index-react-server-client-BaaZU3sM.d.ts} +1 -1
- package/dist/production/{index-react-server-client-K63fpMH4.d.mts → index-react-server-client-KK-TR-t7.d.mts} +1 -1
- package/dist/production/index-react-server-client.d.mts +2 -2
- 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 +2 -0
- package/dist/production/index-react-server.d.ts +2 -0
- package/dist/production/index-react-server.js +38 -15
- package/dist/production/index-react-server.mjs +38 -15
- package/dist/production/index.d.mts +6 -6
- package/dist/production/index.d.ts +6 -6
- package/dist/production/index.js +101 -92
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-B7w3_Eo9.d.ts → production/instrumentation-CPkMwccd.d.ts} +2 -0
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
+
## v7.18.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Bound route manifest processing during server rendering and RSC document/data requests by falling back to initial route discovery for paths with expensive ancestor expansion, accounting for the number and depth of candidate branches when using regex matching ([#15704](https://github.com/remix-run/react-router/pull/15704))
|
|
8
|
+
- Improve turbo-stream decoding validation and object property handling ([d7223c0](https://github.com/remix-run/react-router/commit/d7223c0))
|
|
9
|
+
|
|
3
10
|
## v7.18.4
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterInit } from './instrumentation-
|
|
2
|
+
import { R as RouterInit } from './instrumentation-CPkMwccd.js';
|
|
3
3
|
import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction } from './data-CjO11-hU.js';
|
|
4
4
|
|
|
5
5
|
declare function getRequest(): Request;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterInit } from './context-
|
|
2
|
+
import { R as RouterInit } from './context-BlYKn1tE.mjs';
|
|
3
3
|
import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction } from './data-DEjBmEfD.mjs';
|
|
4
4
|
|
|
5
5
|
declare function getRequest(): Request;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.5
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -3538,6 +3538,10 @@ function createStaticHandler(routes, opts) {
|
|
|
3538
3538
|
manifest
|
|
3539
3539
|
);
|
|
3540
3540
|
let routeBranches = flattenAndRankRoutes(dataRoutes);
|
|
3541
|
+
let matchCost = routeBranches.reduce(
|
|
3542
|
+
(total, branch) => total + branch.routesMeta.length,
|
|
3543
|
+
0
|
|
3544
|
+
);
|
|
3541
3545
|
async function query(request, {
|
|
3542
3546
|
requestContext,
|
|
3543
3547
|
filterMatchesToLoad,
|
|
@@ -4159,6 +4163,7 @@ function createStaticHandler(routes, opts) {
|
|
|
4159
4163
|
}
|
|
4160
4164
|
return {
|
|
4161
4165
|
dataRoutes,
|
|
4166
|
+
_matchCost: matchCost,
|
|
4162
4167
|
_internalRouteBranches: routeBranches,
|
|
4163
4168
|
query,
|
|
4164
4169
|
queryRoute
|
|
@@ -6146,6 +6151,7 @@ function hydrate(index) {
|
|
|
6146
6151
|
set(-0);
|
|
6147
6152
|
continue;
|
|
6148
6153
|
}
|
|
6154
|
+
validateIndex(index2, values.length);
|
|
6149
6155
|
if (hydrated[index2]) {
|
|
6150
6156
|
set(hydrated[index2]);
|
|
6151
6157
|
continue;
|
|
@@ -6234,6 +6240,7 @@ function hydrate(index) {
|
|
|
6234
6240
|
set(obj);
|
|
6235
6241
|
continue;
|
|
6236
6242
|
case TYPE_PROMISE:
|
|
6243
|
+
validateIndex(b, values.length);
|
|
6237
6244
|
if (hydrated[b]) {
|
|
6238
6245
|
set(hydrated[index2] = hydrated[b]);
|
|
6239
6246
|
} else {
|
|
@@ -6249,6 +6256,7 @@ function hydrate(index) {
|
|
|
6249
6256
|
set(error);
|
|
6250
6257
|
continue;
|
|
6251
6258
|
case TYPE_PREVIOUS_RESOLVED:
|
|
6259
|
+
validateIndex(b, values.length);
|
|
6252
6260
|
set(hydrated[index2] = hydrated[b]);
|
|
6253
6261
|
continue;
|
|
6254
6262
|
default:
|
|
@@ -6313,7 +6321,12 @@ function hydrate(index) {
|
|
|
6313
6321
|
}
|
|
6314
6322
|
]);
|
|
6315
6323
|
postRun.push(() => {
|
|
6316
|
-
object
|
|
6324
|
+
Object.defineProperty(object, r[0], {
|
|
6325
|
+
value: r[1],
|
|
6326
|
+
enumerable: true,
|
|
6327
|
+
configurable: true,
|
|
6328
|
+
writable: true
|
|
6329
|
+
});
|
|
6317
6330
|
});
|
|
6318
6331
|
}
|
|
6319
6332
|
set(object);
|
|
@@ -6325,6 +6338,11 @@ function hydrate(index) {
|
|
|
6325
6338
|
}
|
|
6326
6339
|
return result;
|
|
6327
6340
|
}
|
|
6341
|
+
function validateIndex(index, length) {
|
|
6342
|
+
if (!Number.isSafeInteger(index) || index < 0 || index >= length) {
|
|
6343
|
+
throw new SyntaxError();
|
|
6344
|
+
}
|
|
6345
|
+
}
|
|
6328
6346
|
|
|
6329
6347
|
// vendor/turbo-stream-v2/turbo-stream.ts
|
|
6330
6348
|
async function decode(readable, options) {
|
|
@@ -8628,6 +8646,13 @@ function getPathsWithAncestors(paths) {
|
|
|
8628
8646
|
function isFogOfWarEnabled(routeDiscovery, ssr) {
|
|
8629
8647
|
return routeDiscovery.mode === "lazy" && ssr === true;
|
|
8630
8648
|
}
|
|
8649
|
+
var MANIFEST_MATCH_COST_LIMIT = 5e4;
|
|
8650
|
+
var MANIFEST_MATCH_COST_SEGMENT_THRESHOLD = 10;
|
|
8651
|
+
function shouldUseInitialRouteDiscovery(pathname, matchCost = 0) {
|
|
8652
|
+
let segmentCount = pathname.split("/").length - 1;
|
|
8653
|
+
let ancestorCount = Math.max(segmentCount - 1, 0);
|
|
8654
|
+
return ancestorCount * pathname.length + 1 > URL_LIMIT || segmentCount > MANIFEST_MATCH_COST_SEGMENT_THRESHOLD && segmentCount * matchCost > MANIFEST_MATCH_COST_LIMIT;
|
|
8655
|
+
}
|
|
8631
8656
|
function getPartialManifest({ sri, ...manifest }, router) {
|
|
8632
8657
|
let routeIds = new Set(router.state.matches.map((m) => m.route.id));
|
|
8633
8658
|
let segments = router.state.location.pathname.split("/").filter(Boolean);
|
|
@@ -10407,4 +10432,6 @@ function withErrorBoundaryProps(ErrorBoundary) {
|
|
|
10407
10432
|
|
|
10408
10433
|
|
|
10409
10434
|
|
|
10410
|
-
|
|
10435
|
+
|
|
10436
|
+
|
|
10437
|
+
exports.ABSOLUTE_URL_REGEX = ABSOLUTE_URL_REGEX; exports.PROTOCOL_RELATIVE_URL_REGEX = PROTOCOL_RELATIVE_URL_REGEX; exports.Action = Action; exports.createMemoryHistory = createMemoryHistory; exports.createBrowserHistory = createBrowserHistory; exports.createHashHistory = createHashHistory; exports.invariant = invariant; exports.warning = warning; exports.createPath = createPath; exports.parsePath = parsePath; exports.createContext = createContext; exports.RouterContextProvider = RouterContextProvider; exports.convertRoutesToDataRoutes = convertRoutesToDataRoutes; exports.matchRoutes = matchRoutes; exports.matchRoutesImpl = matchRoutesImpl; exports.generatePath = generatePath; exports.matchPath = matchPath; exports.stripBasename = stripBasename; exports.resolvePath = resolvePath; exports.resolveTo = resolveTo; exports.joinPaths = joinPaths; exports.data = data; exports.redirect = redirect; exports.redirectDocument = redirectDocument; exports.replace = replace; exports.SUPPORTED_ERROR_TYPES = SUPPORTED_ERROR_TYPES; exports.ErrorResponseImpl = ErrorResponseImpl; exports.isRouteErrorResponse = isRouteErrorResponse; exports.parseToInfo = parseToInfo; exports.escapeHtml = escapeHtml; exports.escapeAttribute = escapeAttribute; exports.encode = encode; exports.instrumentHandler = instrumentHandler; exports.validateNavigationTarget = validateNavigationTarget; exports.IDLE_NAVIGATION = IDLE_NAVIGATION; exports.IDLE_FETCHER = IDLE_FETCHER; exports.IDLE_BLOCKER = IDLE_BLOCKER; exports.createRouter = createRouter; exports.createStaticHandler = createStaticHandler; exports.getStaticContextFromError = getStaticContextFromError; exports.hasInvalidProtocol = hasInvalidProtocol; exports.isDataWithResponseInit = isDataWithResponseInit; exports.isResponse = isResponse; exports.isRedirectStatusCode = isRedirectStatusCode; exports.isRedirectResponse = isRedirectResponse; exports.isMutationMethod = isMutationMethod; exports.createRequestInit = createRequestInit; exports.SingleFetchRedirectSymbol = SingleFetchRedirectSymbol; exports.SINGLE_FETCH_REDIRECT_STATUS = SINGLE_FETCH_REDIRECT_STATUS; exports.NO_BODY_STATUS_CODES = NO_BODY_STATUS_CODES; exports.StreamTransfer = StreamTransfer; exports.getTurboStreamSingleFetchDataStrategy = getTurboStreamSingleFetchDataStrategy; exports.getSingleFetchDataStrategyImpl = getSingleFetchDataStrategyImpl; exports.stripIndexParam = stripIndexParam; exports.singleFetchUrl = singleFetchUrl; exports.decodeViaTurboStream = decodeViaTurboStream; exports.DataRouterContext = DataRouterContext; exports.DataRouterStateContext = DataRouterStateContext; exports.RSCRouterContext = RSCRouterContext; exports.ViewTransitionContext = ViewTransitionContext; exports.FetchersContext = FetchersContext; exports.AwaitContextProvider = AwaitContextProvider; exports.NavigationContext = NavigationContext; exports.LocationContext = LocationContext; exports.RouteContext = RouteContext; exports.ENABLE_DEV_WARNINGS = ENABLE_DEV_WARNINGS; exports.warnOnce = warnOnce; exports.decodeRedirectErrorDigest = decodeRedirectErrorDigest; exports.decodeRouteErrorResponseDigest = decodeRouteErrorResponseDigest; exports.useHref = useHref; exports.useInRouterContext = useInRouterContext; exports.useLocation = useLocation; exports.useNavigationType = useNavigationType; exports.useMatch = useMatch; exports.useNavigate = useNavigate; exports.useOutletContext = useOutletContext; exports.useOutlet = useOutlet; exports.useParams = useParams; exports.useResolvedPath = useResolvedPath; exports.useRoutes = useRoutes; exports.useRouteId = useRouteId; exports.useNavigation = useNavigation; exports.useRevalidator = useRevalidator; exports.useMatches = useMatches; exports.useLoaderData = useLoaderData; exports.useRouteLoaderData = useRouteLoaderData; exports.useActionData = useActionData; exports.useRouteError = useRouteError; exports.useAsyncValue = useAsyncValue; exports.useAsyncError = useAsyncError; exports.useBlocker = useBlocker; exports.useRoute = useRoute; exports.useRouterState = useRouterState; exports.RemixErrorBoundary = RemixErrorBoundary; exports.createServerRoutes = createServerRoutes; exports.createClientRoutesWithHMRRevalidationOptOut = createClientRoutesWithHMRRevalidationOptOut; exports.noActionDefinedError = noActionDefinedError; exports.createClientRoutes = createClientRoutes; exports.shouldHydrateRouteLoader = shouldHydrateRouteLoader; exports.URL_LIMIT = URL_LIMIT; exports.getPathsWithAncestors = getPathsWithAncestors; exports.isFogOfWarEnabled = isFogOfWarEnabled; exports.shouldUseInitialRouteDiscovery = shouldUseInitialRouteDiscovery; exports.getPatchRoutesOnNavigationFunction = getPatchRoutesOnNavigationFunction; exports.useFogOFWarDiscovery = useFogOFWarDiscovery; exports.getManifestPath = getManifestPath; exports.FrameworkContext = FrameworkContext; exports.usePrefetchBehavior = usePrefetchBehavior; exports.CRITICAL_CSS_DATA_ATTRIBUTE = CRITICAL_CSS_DATA_ATTRIBUTE; exports.Links = Links; exports.PrefetchPageLinks = PrefetchPageLinks; exports.Meta = Meta; exports.setIsHydrated = setIsHydrated; exports.Scripts = Scripts; exports.mergeRefs = mergeRefs; exports.mapRouteProperties = mapRouteProperties; exports.hydrationRouteProperties = hydrationRouteProperties; exports.createMemoryRouter = createMemoryRouter; exports.RouterProvider = RouterProvider; exports.DataRoutes = DataRoutes2; exports.MemoryRouter = MemoryRouter; exports.Navigate = Navigate; exports.Outlet = Outlet; exports.Route = Route; exports.Router = Router; exports.Routes = Routes; exports.Await = Await; exports.createRoutesFromChildren = createRoutesFromChildren; exports.createRoutesFromElements = createRoutesFromElements; exports.renderMatches = renderMatches; exports.WithComponentProps = WithComponentProps; exports.withComponentProps = withComponentProps; exports.WithHydrateFallbackProps = WithHydrateFallbackProps; exports.withHydrateFallbackProps = withHydrateFallbackProps; exports.WithErrorBoundaryProps = WithErrorBoundaryProps; exports.withErrorBoundaryProps = withErrorBoundaryProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.5
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -3538,6 +3538,10 @@ function createStaticHandler(routes, opts) {
|
|
|
3538
3538
|
manifest
|
|
3539
3539
|
);
|
|
3540
3540
|
let routeBranches = flattenAndRankRoutes(dataRoutes);
|
|
3541
|
+
let matchCost = routeBranches.reduce(
|
|
3542
|
+
(total, branch) => total + branch.routesMeta.length,
|
|
3543
|
+
0
|
|
3544
|
+
);
|
|
3541
3545
|
async function query(request, {
|
|
3542
3546
|
requestContext,
|
|
3543
3547
|
filterMatchesToLoad,
|
|
@@ -4159,6 +4163,7 @@ function createStaticHandler(routes, opts) {
|
|
|
4159
4163
|
}
|
|
4160
4164
|
return {
|
|
4161
4165
|
dataRoutes,
|
|
4166
|
+
_matchCost: matchCost,
|
|
4162
4167
|
_internalRouteBranches: routeBranches,
|
|
4163
4168
|
query,
|
|
4164
4169
|
queryRoute
|
|
@@ -7823,6 +7828,7 @@ function hydrate(index) {
|
|
|
7823
7828
|
set(-0);
|
|
7824
7829
|
continue;
|
|
7825
7830
|
}
|
|
7831
|
+
validateIndex(index2, values.length);
|
|
7826
7832
|
if (hydrated[index2]) {
|
|
7827
7833
|
set(hydrated[index2]);
|
|
7828
7834
|
continue;
|
|
@@ -7911,6 +7917,7 @@ function hydrate(index) {
|
|
|
7911
7917
|
set(obj);
|
|
7912
7918
|
continue;
|
|
7913
7919
|
case TYPE_PROMISE:
|
|
7920
|
+
validateIndex(b, values.length);
|
|
7914
7921
|
if (hydrated[b]) {
|
|
7915
7922
|
set(hydrated[index2] = hydrated[b]);
|
|
7916
7923
|
} else {
|
|
@@ -7926,6 +7933,7 @@ function hydrate(index) {
|
|
|
7926
7933
|
set(error);
|
|
7927
7934
|
continue;
|
|
7928
7935
|
case TYPE_PREVIOUS_RESOLVED:
|
|
7936
|
+
validateIndex(b, values.length);
|
|
7929
7937
|
set(hydrated[index2] = hydrated[b]);
|
|
7930
7938
|
continue;
|
|
7931
7939
|
default:
|
|
@@ -7990,7 +7998,12 @@ function hydrate(index) {
|
|
|
7990
7998
|
}
|
|
7991
7999
|
]);
|
|
7992
8000
|
postRun.push(() => {
|
|
7993
|
-
object
|
|
8001
|
+
Object.defineProperty(object, r[0], {
|
|
8002
|
+
value: r[1],
|
|
8003
|
+
enumerable: true,
|
|
8004
|
+
configurable: true,
|
|
8005
|
+
writable: true
|
|
8006
|
+
});
|
|
7994
8007
|
});
|
|
7995
8008
|
}
|
|
7996
8009
|
set(object);
|
|
@@ -8002,6 +8015,11 @@ function hydrate(index) {
|
|
|
8002
8015
|
}
|
|
8003
8016
|
return result;
|
|
8004
8017
|
}
|
|
8018
|
+
function validateIndex(index, length) {
|
|
8019
|
+
if (!Number.isSafeInteger(index) || index < 0 || index >= length) {
|
|
8020
|
+
throw new SyntaxError();
|
|
8021
|
+
}
|
|
8022
|
+
}
|
|
8005
8023
|
|
|
8006
8024
|
// vendor/turbo-stream-v2/turbo-stream.ts
|
|
8007
8025
|
async function decode(readable, options) {
|
|
@@ -9481,6 +9499,13 @@ function getPathsWithAncestors(paths) {
|
|
|
9481
9499
|
function isFogOfWarEnabled(routeDiscovery, ssr) {
|
|
9482
9500
|
return routeDiscovery.mode === "lazy" && ssr === true;
|
|
9483
9501
|
}
|
|
9502
|
+
var MANIFEST_MATCH_COST_LIMIT = 5e4;
|
|
9503
|
+
var MANIFEST_MATCH_COST_SEGMENT_THRESHOLD = 10;
|
|
9504
|
+
function shouldUseInitialRouteDiscovery(pathname, matchCost = 0) {
|
|
9505
|
+
let segmentCount = pathname.split("/").length - 1;
|
|
9506
|
+
let ancestorCount = Math.max(segmentCount - 1, 0);
|
|
9507
|
+
return ancestorCount * pathname.length + 1 > URL_LIMIT || segmentCount > MANIFEST_MATCH_COST_SEGMENT_THRESHOLD && segmentCount * matchCost > MANIFEST_MATCH_COST_LIMIT;
|
|
9508
|
+
}
|
|
9484
9509
|
function getPartialManifest({ sri, ...manifest }, router) {
|
|
9485
9510
|
let routeIds = new Set(router.state.matches.map((m) => m.route.id));
|
|
9486
9511
|
let segments = router.state.location.pathname.split("/").filter(Boolean);
|
|
@@ -10408,7 +10433,7 @@ var isBrowser2 = typeof window !== "undefined" && typeof window.document !== "un
|
|
|
10408
10433
|
try {
|
|
10409
10434
|
if (isBrowser2) {
|
|
10410
10435
|
window.__reactRouterVersion = // @ts-expect-error
|
|
10411
|
-
"7.18.
|
|
10436
|
+
"7.18.5";
|
|
10412
10437
|
}
|
|
10413
10438
|
} catch (e) {
|
|
10414
10439
|
}
|
|
@@ -11673,6 +11698,8 @@ export {
|
|
|
11673
11698
|
shouldHydrateRouteLoader,
|
|
11674
11699
|
URL_LIMIT,
|
|
11675
11700
|
getPathsWithAncestors,
|
|
11701
|
+
isFogOfWarEnabled,
|
|
11702
|
+
shouldUseInitialRouteDiscovery,
|
|
11676
11703
|
getPatchRoutesOnNavigationFunction,
|
|
11677
11704
|
useFogOFWarDiscovery,
|
|
11678
11705
|
getManifestPath,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.5
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk2ZBLYC7Vjs = require('./chunk-2ZBLYC7V.js');
|
|
18
18
|
|
|
19
19
|
// lib/dom/ssr/hydration.tsx
|
|
20
20
|
function getHydrationData({
|
|
@@ -29,12 +29,12 @@ function getHydrationData({
|
|
|
29
29
|
...state,
|
|
30
30
|
loaderData: { ...state.loaderData }
|
|
31
31
|
};
|
|
32
|
-
let initialMatches =
|
|
32
|
+
let initialMatches = _chunk2ZBLYC7Vjs.matchRoutes.call(void 0, routes, location, basename);
|
|
33
33
|
if (initialMatches) {
|
|
34
34
|
for (let match of initialMatches) {
|
|
35
35
|
let routeId = match.route.id;
|
|
36
36
|
let routeInfo = getRouteInfo(routeId);
|
|
37
|
-
if (
|
|
37
|
+
if (_chunk2ZBLYC7Vjs.shouldHydrateRouteLoader.call(void 0,
|
|
38
38
|
routeId,
|
|
39
39
|
routeInfo.clientLoader,
|
|
40
40
|
routeInfo.hasLoader,
|
|
@@ -112,7 +112,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
|
-
if (
|
|
115
|
+
if (_chunk2ZBLYC7Vjs.isRouteErrorResponse.call(void 0, error)) {
|
|
116
116
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
117
117
|
ErrorWrapper,
|
|
118
118
|
{
|
|
@@ -120,7 +120,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
120
120
|
title: "Unhandled Thrown Response!"
|
|
121
121
|
},
|
|
122
122
|
/* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
123
|
-
|
|
123
|
+
_chunk2ZBLYC7Vjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
let errorInstance;
|
|
@@ -146,7 +146,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
146
146
|
function RSCDefaultRootErrorBoundary({
|
|
147
147
|
hasRootLayout
|
|
148
148
|
}) {
|
|
149
|
-
let error =
|
|
149
|
+
let error = _chunk2ZBLYC7Vjs.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.5
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
hasInvalidProtocol,
|
|
40
40
|
instrumentHandler,
|
|
41
41
|
isDataWithResponseInit,
|
|
42
|
+
isFogOfWarEnabled,
|
|
42
43
|
isMutationMethod,
|
|
43
44
|
isRedirectResponse,
|
|
44
45
|
isRedirectStatusCode,
|
|
@@ -50,13 +51,14 @@ import {
|
|
|
50
51
|
redirectDocument,
|
|
51
52
|
replace,
|
|
52
53
|
shouldHydrateRouteLoader,
|
|
54
|
+
shouldUseInitialRouteDiscovery,
|
|
53
55
|
stripBasename,
|
|
54
56
|
useRouteError,
|
|
55
57
|
warnOnce,
|
|
56
58
|
withComponentProps,
|
|
57
59
|
withErrorBoundaryProps,
|
|
58
60
|
withHydrateFallbackProps
|
|
59
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-6KYCQHYJ.mjs";
|
|
60
62
|
|
|
61
63
|
// lib/dom/ssr/server.tsx
|
|
62
64
|
import * as React from "react";
|
|
@@ -1475,10 +1477,17 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1475
1477
|
actionData: context.actionData,
|
|
1476
1478
|
errors: context.errors
|
|
1477
1479
|
};
|
|
1480
|
+
let routeDiscovery = build.routeDiscovery;
|
|
1481
|
+
if (isFogOfWarEnabled(routeDiscovery, build.ssr) && shouldUseInitialRouteDiscovery(
|
|
1482
|
+
context.location.pathname,
|
|
1483
|
+
staticHandler._matchCost
|
|
1484
|
+
)) {
|
|
1485
|
+
routeDiscovery = { ...routeDiscovery, mode: "initial" };
|
|
1486
|
+
}
|
|
1478
1487
|
let baseServerHandoff = {
|
|
1479
1488
|
basename: build.basename,
|
|
1480
1489
|
future: build.future,
|
|
1481
|
-
routeDiscovery
|
|
1490
|
+
routeDiscovery,
|
|
1482
1491
|
ssr: build.ssr,
|
|
1483
1492
|
isSpaMode: isSpaMode2
|
|
1484
1493
|
};
|
|
@@ -1501,7 +1510,7 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
|
|
|
1501
1510
|
renderMeta: {},
|
|
1502
1511
|
future: build.future,
|
|
1503
1512
|
ssr: build.ssr,
|
|
1504
|
-
routeDiscovery
|
|
1513
|
+
routeDiscovery,
|
|
1505
1514
|
isSpaMode: isSpaMode2,
|
|
1506
1515
|
serializeError: (err) => serializeError(err, serverMode)
|
|
1507
1516
|
};
|