react-router 7.8.0 → 7.8.1-pre.0
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-VC6RBZTR.js → chunk-3JLHOGU7.js} +130 -130
- package/dist/development/{chunk-EVX7OBGB.js → chunk-CXAO7FY7.js} +70 -47
- package/dist/{production/chunk-XPGU3ZMH.mjs → development/chunk-V2P3SFSY.mjs} +147 -33
- package/dist/development/{chunk-ZYFC6VSF.mjs → chunk-WKLBIS42.mjs} +34 -11
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/{production/index-react-server-client-DXb0OgpJ.d.mts → development/index-react-server-client-11fLy3qB.d.mts} +1 -1
- package/dist/development/{index-react-server-client-CMphySRb.d.ts → index-react-server-client-BQ6FxdA_.d.ts} +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 +38 -1
- package/dist/development/index-react-server.d.ts +38 -1
- package/dist/development/index-react-server.js +28 -9
- package/dist/development/index-react-server.mjs +28 -10
- package/dist/development/index.d.mts +42 -4
- package/dist/development/index.d.ts +42 -4
- package/dist/development/index.js +242 -128
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +6 -3
- package/dist/development/lib/types/internal.d.ts +6 -3
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{route-data-CpB5xtMm.d.mts → route-data-CNjObrhZ.d.mts} +1 -1
- package/dist/development/{routeModules-qBivMBjd.d.ts → routeModules-C3oqzPpI.d.ts} +1 -1
- package/dist/production/{chunk-O6DRQPUD.js → chunk-6K5ETUFZ.js} +130 -130
- package/dist/production/{chunk-SIHON65V.mjs → chunk-GIJZ6O2U.mjs} +34 -11
- package/dist/production/{chunk-BOD6JCOU.js → chunk-ZFXTWIWH.js} +70 -47
- package/dist/{development/chunk-HZX6U7MI.mjs → production/chunk-ZKLGVTLT.mjs} +147 -33
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/{development/index-react-server-client-DXb0OgpJ.d.mts → production/index-react-server-client-11fLy3qB.d.mts} +1 -1
- package/dist/production/{index-react-server-client-CMphySRb.d.ts → index-react-server-client-BQ6FxdA_.d.ts} +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 +38 -1
- package/dist/production/index-react-server.d.ts +38 -1
- package/dist/production/index-react-server.js +28 -9
- package/dist/production/index-react-server.mjs +28 -10
- package/dist/production/index.d.mts +42 -4
- package/dist/production/index.d.ts +42 -4
- package/dist/production/index.js +242 -128
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +6 -3
- package/dist/production/lib/types/internal.d.ts +6 -3
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{route-data-CpB5xtMm.d.mts → route-data-CNjObrhZ.d.mts} +1 -1
- package/dist/production/{routeModules-qBivMBjd.d.ts → routeModules-C3oqzPpI.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -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.8.0
|
|
2
|
+
* react-router v7.8.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -513,8 +513,8 @@ function convertRouteMatchToUiMatch(match, loaderData) {
|
|
|
513
513
|
handle: route.handle
|
|
514
514
|
};
|
|
515
515
|
}
|
|
516
|
-
function flattenRoutes(routes, branches = [], parentsMeta = [], parentPath = "") {
|
|
517
|
-
let flattenRoute = (route, index, relativePath) => {
|
|
516
|
+
function flattenRoutes(routes, branches = [], parentsMeta = [], parentPath = "", _hasParentOptionalSegments = false) {
|
|
517
|
+
let flattenRoute = (route, index, hasParentOptionalSegments = _hasParentOptionalSegments, relativePath) => {
|
|
518
518
|
let meta = {
|
|
519
519
|
relativePath: relativePath === void 0 ? route.path || "" : relativePath,
|
|
520
520
|
caseSensitive: route.caseSensitive === true,
|
|
@@ -522,6 +522,9 @@ function flattenRoutes(routes, branches = [], parentsMeta = [], parentPath = "")
|
|
|
522
522
|
route
|
|
523
523
|
};
|
|
524
524
|
if (meta.relativePath.startsWith("/")) {
|
|
525
|
+
if (!meta.relativePath.startsWith(parentPath) && hasParentOptionalSegments) {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
525
528
|
invariant(
|
|
526
529
|
meta.relativePath.startsWith(parentPath),
|
|
527
530
|
`Absolute route path "${meta.relativePath}" nested under path "${parentPath}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
@@ -537,7 +540,13 @@ function flattenRoutes(routes, branches = [], parentsMeta = [], parentPath = "")
|
|
|
537
540
|
route.index !== true,
|
|
538
541
|
`Index routes must not have child routes. Please remove all child routes from route path "${path}".`
|
|
539
542
|
);
|
|
540
|
-
flattenRoutes(
|
|
543
|
+
flattenRoutes(
|
|
544
|
+
route.children,
|
|
545
|
+
branches,
|
|
546
|
+
routesMeta,
|
|
547
|
+
path,
|
|
548
|
+
hasParentOptionalSegments
|
|
549
|
+
);
|
|
541
550
|
}
|
|
542
551
|
if (route.path == null && !route.index) {
|
|
543
552
|
return;
|
|
@@ -553,7 +562,7 @@ function flattenRoutes(routes, branches = [], parentsMeta = [], parentPath = "")
|
|
|
553
562
|
flattenRoute(route, index);
|
|
554
563
|
} else {
|
|
555
564
|
for (let exploded of explodeOptionalSegments(route.path)) {
|
|
556
|
-
flattenRoute(route, index, exploded);
|
|
565
|
+
flattenRoute(route, index, true, exploded);
|
|
557
566
|
}
|
|
558
567
|
}
|
|
559
568
|
});
|
|
@@ -745,7 +754,7 @@ function compilePath(path, caseSensitive = false, end = true) {
|
|
|
745
754
|
params.push({ paramName, isOptional: isOptional != null });
|
|
746
755
|
return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)";
|
|
747
756
|
}
|
|
748
|
-
);
|
|
757
|
+
).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
|
|
749
758
|
if (path.endsWith("*")) {
|
|
750
759
|
params.push({ paramName: "*" });
|
|
751
760
|
regexpSource += path === "*" || path === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$";
|
|
@@ -3272,8 +3281,12 @@ function createStaticHandler(routes, opts) {
|
|
|
3272
3281
|
basename
|
|
3273
3282
|
);
|
|
3274
3283
|
}
|
|
3275
|
-
if (
|
|
3276
|
-
|
|
3284
|
+
if (isRouteRequest) {
|
|
3285
|
+
if (isResponse(result.result)) {
|
|
3286
|
+
throw result;
|
|
3287
|
+
} else if (isDataWithResponseInit(result.result)) {
|
|
3288
|
+
throw dataWithResponseInitToResponse(result.result);
|
|
3289
|
+
}
|
|
3277
3290
|
}
|
|
3278
3291
|
dataResults[match.route.id] = await convertDataStrategyResultToDataResult(result);
|
|
3279
3292
|
})
|
|
@@ -3941,9 +3954,15 @@ function clientMiddlewareErrorHandler(error, routeId, matches, didCallHandler) {
|
|
|
3941
3954
|
[routeId]: { type: "error", result: error }
|
|
3942
3955
|
};
|
|
3943
3956
|
} else {
|
|
3957
|
+
let maxBoundaryIdx = Math.min(
|
|
3958
|
+
// Throwing route
|
|
3959
|
+
matches.findIndex((m) => m.route.id === routeId) || 0,
|
|
3960
|
+
// or the shallowest route that needs to load data
|
|
3961
|
+
matches.findIndex((m) => m.unstable_shouldCallHandler()) || 0
|
|
3962
|
+
);
|
|
3944
3963
|
let boundaryRouteId = findNearestBoundary(
|
|
3945
3964
|
matches,
|
|
3946
|
-
|
|
3965
|
+
matches[maxBoundaryIdx].route.id
|
|
3947
3966
|
).route.id;
|
|
3948
3967
|
return {
|
|
3949
3968
|
[boundaryRouteId]: { type: "error", result: error }
|
|
@@ -4168,8 +4187,8 @@ function getDataStrategyMatch(mapRouteProperties, manifest, request, match, lazy
|
|
|
4168
4187
|
return callLoaderOrAction({
|
|
4169
4188
|
request,
|
|
4170
4189
|
match,
|
|
4171
|
-
lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess',
|
|
4172
|
-
lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess',
|
|
4190
|
+
lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess', _37 => _37.handler]),
|
|
4191
|
+
lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess', _38 => _38.route]),
|
|
4173
4192
|
handlerOverride,
|
|
4174
4193
|
scopedContext
|
|
4175
4194
|
});
|
|
@@ -4209,8 +4228,8 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, m
|
|
|
4209
4228
|
});
|
|
4210
4229
|
}
|
|
4211
4230
|
async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherKey, scopedContext, isStaticHandler) {
|
|
4212
|
-
if (matches.some((m) => _optionalChain([m, 'access',
|
|
4213
|
-
await Promise.all(matches.map((m) => _optionalChain([m, 'access',
|
|
4231
|
+
if (matches.some((m) => _optionalChain([m, 'access', _39 => _39._lazyPromises, 'optionalAccess', _40 => _40.middleware]))) {
|
|
4232
|
+
await Promise.all(matches.map((m) => _optionalChain([m, 'access', _41 => _41._lazyPromises, 'optionalAccess', _42 => _42.middleware])));
|
|
4214
4233
|
}
|
|
4215
4234
|
let dataStrategyArgs = {
|
|
4216
4235
|
request,
|
|
@@ -4255,8 +4274,8 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
|
|
|
4255
4274
|
try {
|
|
4256
4275
|
await Promise.all(
|
|
4257
4276
|
matches.flatMap((m) => [
|
|
4258
|
-
_optionalChain([m, 'access',
|
|
4259
|
-
_optionalChain([m, 'access',
|
|
4277
|
+
_optionalChain([m, 'access', _43 => _43._lazyPromises, 'optionalAccess', _44 => _44.handler]),
|
|
4278
|
+
_optionalChain([m, 'access', _45 => _45._lazyPromises, 'optionalAccess', _46 => _46.route])
|
|
4260
4279
|
])
|
|
4261
4280
|
);
|
|
4262
4281
|
} catch (e) {
|
|
@@ -4401,19 +4420,19 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
|
|
|
4401
4420
|
return {
|
|
4402
4421
|
type: "error" /* error */,
|
|
4403
4422
|
error: result.data,
|
|
4404
|
-
statusCode: _optionalChain([result, 'access',
|
|
4405
|
-
headers: _optionalChain([result, 'access',
|
|
4423
|
+
statusCode: _optionalChain([result, 'access', _47 => _47.init, 'optionalAccess', _48 => _48.status]),
|
|
4424
|
+
headers: _optionalChain([result, 'access', _49 => _49.init, 'optionalAccess', _50 => _50.headers]) ? new Headers(result.init.headers) : void 0
|
|
4406
4425
|
};
|
|
4407
4426
|
}
|
|
4408
4427
|
return {
|
|
4409
4428
|
type: "error" /* error */,
|
|
4410
4429
|
error: new ErrorResponseImpl(
|
|
4411
|
-
_optionalChain([result, 'access',
|
|
4430
|
+
_optionalChain([result, 'access', _51 => _51.init, 'optionalAccess', _52 => _52.status]) || 500,
|
|
4412
4431
|
void 0,
|
|
4413
4432
|
result.data
|
|
4414
4433
|
),
|
|
4415
4434
|
statusCode: isRouteErrorResponse(result) ? result.status : void 0,
|
|
4416
|
-
headers: _optionalChain([result, 'access',
|
|
4435
|
+
headers: _optionalChain([result, 'access', _53 => _53.init, 'optionalAccess', _54 => _54.headers]) ? new Headers(result.init.headers) : void 0
|
|
4417
4436
|
};
|
|
4418
4437
|
}
|
|
4419
4438
|
return {
|
|
@@ -4426,8 +4445,8 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
|
|
|
4426
4445
|
return {
|
|
4427
4446
|
type: "data" /* data */,
|
|
4428
4447
|
data: result.data,
|
|
4429
|
-
statusCode: _optionalChain([result, 'access',
|
|
4430
|
-
headers: _optionalChain([result, 'access',
|
|
4448
|
+
statusCode: _optionalChain([result, 'access', _55 => _55.init, 'optionalAccess', _56 => _56.status]),
|
|
4449
|
+
headers: _optionalChain([result, 'access', _57 => _57.init, 'optionalAccess', _58 => _58.headers]) ? new Headers(result.init.headers) : void 0
|
|
4431
4450
|
};
|
|
4432
4451
|
}
|
|
4433
4452
|
return { type: "data" /* data */, data: result };
|
|
@@ -4576,7 +4595,7 @@ function processLoaderData(state, matches, results, pendingActionResult, revalid
|
|
|
4576
4595
|
let result = fetcherResults[key];
|
|
4577
4596
|
invariant(result, "Did not find corresponding fetcher result");
|
|
4578
4597
|
if (isErrorResult(result)) {
|
|
4579
|
-
let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess',
|
|
4598
|
+
let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess', _59 => _59.route, 'access', _60 => _60.id]));
|
|
4580
4599
|
if (!(errors && errors[boundaryMatch.route.id])) {
|
|
4581
4600
|
errors = {
|
|
4582
4601
|
...errors,
|
|
@@ -4713,8 +4732,8 @@ function dataWithResponseInitToResponse(data2) {
|
|
|
4713
4732
|
}
|
|
4714
4733
|
function dataWithResponseInitToErrorResponse(data2) {
|
|
4715
4734
|
return new ErrorResponseImpl(
|
|
4716
|
-
_nullishCoalesce(_optionalChain([data2, 'access',
|
|
4717
|
-
_nullishCoalesce(_optionalChain([data2, 'access',
|
|
4735
|
+
_nullishCoalesce(_optionalChain([data2, 'access', _61 => _61.init, 'optionalAccess', _62 => _62.status]), () => ( 500)),
|
|
4736
|
+
_nullishCoalesce(_optionalChain([data2, 'access', _63 => _63.init, 'optionalAccess', _64 => _64.statusText]), () => ( "Internal Server Error")),
|
|
4718
4737
|
data2.data
|
|
4719
4738
|
);
|
|
4720
4739
|
}
|
|
@@ -5753,7 +5772,7 @@ function getTurboStreamSingleFetchDataStrategy(getRouter, manifest, routeModules
|
|
|
5753
5772
|
return {
|
|
5754
5773
|
hasLoader: manifestRoute.hasLoader,
|
|
5755
5774
|
hasClientLoader: manifestRoute.hasClientLoader,
|
|
5756
|
-
hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess',
|
|
5775
|
+
hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess', _65 => _65.shouldRevalidate]))
|
|
5757
5776
|
};
|
|
5758
5777
|
},
|
|
5759
5778
|
fetchAndDecodeViaTurboStream,
|
|
@@ -5920,7 +5939,7 @@ async function bubbleMiddlewareErrors(singleFetchPromise, matches, routesParams,
|
|
|
5920
5939
|
let routeResult = fetchedData.routes[match.route.id];
|
|
5921
5940
|
if ("error" in routeResult) {
|
|
5922
5941
|
middlewareError = routeResult.error;
|
|
5923
|
-
if (_optionalChain([results, 'access',
|
|
5942
|
+
if (_optionalChain([results, 'access', _66 => _66[match.route.id], 'optionalAccess', _67 => _67.result]) == null) {
|
|
5924
5943
|
results[match.route.id] = {
|
|
5925
5944
|
type: "error",
|
|
5926
5945
|
result: middlewareError
|
|
@@ -6033,7 +6052,7 @@ async function fetchAndDecodeViaTurboStream(args, basename, targetRoutes) {
|
|
|
6033
6052
|
}
|
|
6034
6053
|
} else {
|
|
6035
6054
|
let typed = decoded.value;
|
|
6036
|
-
let routeId = _optionalChain([targetRoutes, 'optionalAccess',
|
|
6055
|
+
let routeId = _optionalChain([targetRoutes, 'optionalAccess', _68 => _68[0]]);
|
|
6037
6056
|
invariant2(routeId, "No routeId found for single fetch call decoding");
|
|
6038
6057
|
if ("redirect" in typed) {
|
|
6039
6058
|
data2 = { redirect: typed };
|
|
@@ -6344,7 +6363,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
6344
6363
|
if (locationArg) {
|
|
6345
6364
|
let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
|
|
6346
6365
|
invariant(
|
|
6347
|
-
parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access',
|
|
6366
|
+
parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access', _69 => _69.pathname, 'optionalAccess', _70 => _70.startsWith, 'call', _71 => _71(parentPathnameBase)]),
|
|
6348
6367
|
`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${parentPathnameBase}" but pathname "${parsedLocationArg.pathname}" was given in the \`location\` prop.`
|
|
6349
6368
|
);
|
|
6350
6369
|
location = parsedLocationArg;
|
|
@@ -6492,10 +6511,10 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
|
|
|
6492
6511
|
}
|
|
6493
6512
|
}
|
|
6494
6513
|
let renderedMatches = matches;
|
|
6495
|
-
let errors = _optionalChain([dataRouterState, 'optionalAccess',
|
|
6514
|
+
let errors = _optionalChain([dataRouterState, 'optionalAccess', _72 => _72.errors]);
|
|
6496
6515
|
if (errors != null) {
|
|
6497
6516
|
let errorIndex = renderedMatches.findIndex(
|
|
6498
|
-
(m) => m.route.id && _optionalChain([errors, 'optionalAccess',
|
|
6517
|
+
(m) => m.route.id && _optionalChain([errors, 'optionalAccess', _73 => _73[m.route.id]]) !== void 0
|
|
6499
6518
|
);
|
|
6500
6519
|
invariant(
|
|
6501
6520
|
errorIndex >= 0,
|
|
@@ -6672,15 +6691,15 @@ function useRouteError() {
|
|
|
6672
6691
|
if (error !== void 0) {
|
|
6673
6692
|
return error;
|
|
6674
6693
|
}
|
|
6675
|
-
return _optionalChain([state, 'access',
|
|
6694
|
+
return _optionalChain([state, 'access', _74 => _74.errors, 'optionalAccess', _75 => _75[routeId]]);
|
|
6676
6695
|
}
|
|
6677
6696
|
function useAsyncValue() {
|
|
6678
6697
|
let value = React3.useContext(AwaitContext);
|
|
6679
|
-
return _optionalChain([value, 'optionalAccess',
|
|
6698
|
+
return _optionalChain([value, 'optionalAccess', _76 => _76._data]);
|
|
6680
6699
|
}
|
|
6681
6700
|
function useAsyncError() {
|
|
6682
6701
|
let value = React3.useContext(AwaitContext);
|
|
6683
|
-
return _optionalChain([value, 'optionalAccess',
|
|
6702
|
+
return _optionalChain([value, 'optionalAccess', _77 => _77._error]);
|
|
6684
6703
|
}
|
|
6685
6704
|
var blockerId = 0;
|
|
6686
6705
|
function useBlocker(shouldBlock) {
|
|
@@ -6792,7 +6811,7 @@ function getKeyedLinksForMatches(matches, routeModules, manifest) {
|
|
|
6792
6811
|
let route = manifest.routes[match.route.id];
|
|
6793
6812
|
return [
|
|
6794
6813
|
route && route.css ? route.css.map((href) => ({ rel: "stylesheet", href })) : [],
|
|
6795
|
-
_optionalChain([module, 'optionalAccess',
|
|
6814
|
+
_optionalChain([module, 'optionalAccess', _78 => _78.links, 'optionalCall', _79 => _79()]) || []
|
|
6796
6815
|
];
|
|
6797
6816
|
}).flat(2);
|
|
6798
6817
|
let preloads = getModuleLinkHrefs(matches, manifest);
|
|
@@ -6893,7 +6912,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
|
|
|
6893
6912
|
// param change, /users/123 -> /users/456
|
|
6894
6913
|
currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path
|
|
6895
6914
|
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
6896
|
-
_optionalChain([currentMatches, 'access',
|
|
6915
|
+
_optionalChain([currentMatches, 'access', _80 => _80[index], 'access', _81 => _81.route, 'access', _82 => _82.path, 'optionalAccess', _83 => _83.endsWith, 'call', _84 => _84("*")]) && currentMatches[index].params["*"] !== match.params["*"]
|
|
6897
6916
|
);
|
|
6898
6917
|
};
|
|
6899
6918
|
if (mode === "assets") {
|
|
@@ -6916,7 +6935,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
|
|
|
6916
6935
|
location.pathname + location.search + location.hash,
|
|
6917
6936
|
window.origin
|
|
6918
6937
|
),
|
|
6919
|
-
currentParams: _optionalChain([currentMatches, 'access',
|
|
6938
|
+
currentParams: _optionalChain([currentMatches, 'access', _85 => _85[0], 'optionalAccess', _86 => _86.params]) || {},
|
|
6920
6939
|
nextUrl: new URL(page, window.origin),
|
|
6921
6940
|
nextParams: match.params,
|
|
6922
6941
|
defaultShouldRevalidate: true
|
|
@@ -7188,10 +7207,10 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7188
7207
|
)
|
|
7189
7208
|
});
|
|
7190
7209
|
let hasInitialData = initialState && initialState.loaderData && route.id in initialState.loaderData;
|
|
7191
|
-
let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess',
|
|
7210
|
+
let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess', _87 => _87.loaderData, 'optionalAccess', _88 => _88[route.id]]) : void 0;
|
|
7192
7211
|
let hasInitialError = initialState && initialState.errors && route.id in initialState.errors;
|
|
7193
|
-
let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess',
|
|
7194
|
-
let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access',
|
|
7212
|
+
let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess', _89 => _89.errors, 'optionalAccess', _90 => _90[route.id]]) : void 0;
|
|
7213
|
+
let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access', _91 => _91.clientLoader, 'optionalAccess', _92 => _92.hydrate]) === true || !route.hasLoader);
|
|
7195
7214
|
dataRoute.loader = async ({ request, params, context }, singleFetch) => {
|
|
7196
7215
|
try {
|
|
7197
7216
|
let result = await prefetchStylesAndCallHandler(async () => {
|
|
@@ -7488,7 +7507,7 @@ function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, routeDi
|
|
|
7488
7507
|
function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscovery, isSpaMode) {
|
|
7489
7508
|
React6.useEffect(() => {
|
|
7490
7509
|
if (!isFogOfWarEnabled(routeDiscovery, ssr) || // @ts-expect-error - TS doesn't know about this yet
|
|
7491
|
-
_optionalChain([window, 'access',
|
|
7510
|
+
_optionalChain([window, 'access', _93 => _93.navigator, 'optionalAccess', _94 => _94.connection, 'optionalAccess', _95 => _95.saveData]) === true) {
|
|
7492
7511
|
return;
|
|
7493
7512
|
}
|
|
7494
7513
|
function registerElement(el) {
|
|
@@ -7591,7 +7610,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
7591
7610
|
sessionStorage.removeItem(MANIFEST_VERSION_STORAGE_KEY);
|
|
7592
7611
|
serverPatches = await res.json();
|
|
7593
7612
|
} catch (e) {
|
|
7594
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
7613
|
+
if (_optionalChain([signal, 'optionalAccess', _96 => _96.aborted])) return;
|
|
7595
7614
|
throw e;
|
|
7596
7615
|
}
|
|
7597
7616
|
let knownRoutes = new Set(Object.keys(manifest.routes));
|
|
@@ -7832,7 +7851,7 @@ function PrefetchPageLinksImpl({
|
|
|
7832
7851
|
if (!manifestRoute || !manifestRoute.hasLoader) {
|
|
7833
7852
|
return;
|
|
7834
7853
|
}
|
|
7835
|
-
if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access',
|
|
7854
|
+
if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access', _97 => _97[m.route.id], 'optionalAccess', _98 => _98.shouldRevalidate])) {
|
|
7836
7855
|
foundOptOutRoute = true;
|
|
7837
7856
|
} else if (manifestRoute.hasClientLoader) {
|
|
7838
7857
|
foundOptOutRoute = true;
|
|
@@ -7906,7 +7925,7 @@ function Meta() {
|
|
|
7906
7925
|
error
|
|
7907
7926
|
};
|
|
7908
7927
|
matches[i] = match;
|
|
7909
|
-
if (_optionalChain([routeModule, 'optionalAccess',
|
|
7928
|
+
if (_optionalChain([routeModule, 'optionalAccess', _99 => _99.meta])) {
|
|
7910
7929
|
routeMeta = typeof routeModule.meta === "function" ? routeModule.meta({
|
|
7911
7930
|
data: data2,
|
|
7912
7931
|
loaderData: data2,
|
|
@@ -7976,6 +7995,9 @@ function isValidMetaTag(tagName) {
|
|
|
7976
7995
|
return typeof tagName === "string" && /^(meta|link)$/.test(tagName);
|
|
7977
7996
|
}
|
|
7978
7997
|
var isHydrated = false;
|
|
7998
|
+
function setIsHydrated() {
|
|
7999
|
+
isHydrated = true;
|
|
8000
|
+
}
|
|
7979
8001
|
function Scripts(scriptProps) {
|
|
7980
8002
|
let {
|
|
7981
8003
|
manifest,
|
|
@@ -7994,7 +8016,7 @@ function Scripts(scriptProps) {
|
|
|
7994
8016
|
}
|
|
7995
8017
|
let matches = getActiveMatches(routerMatches, null, isSpaMode);
|
|
7996
8018
|
React7.useEffect(() => {
|
|
7997
|
-
|
|
8019
|
+
setIsHydrated();
|
|
7998
8020
|
}, []);
|
|
7999
8021
|
let initialScripts = React7.useMemo(() => {
|
|
8000
8022
|
if (isRSCRouterContext) {
|
|
@@ -8002,7 +8024,7 @@ function Scripts(scriptProps) {
|
|
|
8002
8024
|
}
|
|
8003
8025
|
let streamScript = "window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());";
|
|
8004
8026
|
let contextScript = staticContext ? `window.__reactRouterContext = ${serverHandoffString};${streamScript}` : " ";
|
|
8005
|
-
let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access',
|
|
8027
|
+
let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access', _100 => _100.hmr, 'optionalAccess', _101 => _101.runtime]) ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
|
|
8006
8028
|
${matches.map((match, routeIndex) => {
|
|
8007
8029
|
let routeVarName = `route${routeIndex}`;
|
|
8008
8030
|
let manifestEntry = manifest.routes[match.route.id];
|
|
@@ -8232,7 +8254,7 @@ function BoundaryShell({
|
|
|
8232
8254
|
children
|
|
8233
8255
|
}) {
|
|
8234
8256
|
let { routeModules } = useFrameworkContext();
|
|
8235
|
-
if (_optionalChain([routeModules, 'access',
|
|
8257
|
+
if (_optionalChain([routeModules, 'access', _102 => _102.root, 'optionalAccess', _103 => _103.Layout]) && !isOutsideRemixApp) {
|
|
8236
8258
|
return children;
|
|
8237
8259
|
}
|
|
8238
8260
|
return /* @__PURE__ */ React8.createElement("html", { lang: "en" }, /* @__PURE__ */ React8.createElement("head", null, /* @__PURE__ */ React8.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ React8.createElement(
|
|
@@ -8344,4 +8366,5 @@ function BoundaryShell({
|
|
|
8344
8366
|
|
|
8345
8367
|
|
|
8346
8368
|
|
|
8347
|
-
|
|
8369
|
+
|
|
8370
|
+
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.unstable_createContext = unstable_createContext; exports.unstable_RouterContextProvider = unstable_RouterContextProvider; exports.convertRoutesToDataRoutes = convertRoutesToDataRoutes; exports.matchRoutes = matchRoutes; exports.generatePath = generatePath; exports.matchPath = matchPath; exports.stripBasename = stripBasename; exports.resolvePath = resolvePath; exports.getResolveToMatches = getResolveToMatches; exports.resolveTo = resolveTo; exports.joinPaths = joinPaths; exports.data = data; exports.redirect = redirect; exports.redirectDocument = redirectDocument; exports.replace = replace; exports.ErrorResponseImpl = ErrorResponseImpl; exports.isRouteErrorResponse = isRouteErrorResponse; exports.encode = encode; 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.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.AwaitContext = AwaitContext; exports.NavigationContext = NavigationContext; exports.LocationContext = LocationContext; exports.RouteContext = RouteContext; exports.ENABLE_DEV_WARNINGS = ENABLE_DEV_WARNINGS; exports.warnOnce = warnOnce; 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.useRoutesImpl = useRoutesImpl; exports._renderMatches = _renderMatches; 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.RemixErrorBoundary = RemixErrorBoundary; exports.createServerRoutes = createServerRoutes; exports.createClientRoutesWithHMRRevalidationOptOut = createClientRoutesWithHMRRevalidationOptOut; exports.noActionDefinedError = noActionDefinedError; exports.createClientRoutes = createClientRoutes; exports.shouldHydrateRouteLoader = shouldHydrateRouteLoader; 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;
|