react-router 7.8.0-pre.2 → 7.8.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 +51 -48
- package/dist/development/{chunk-74TFO7SN.js → chunk-EVX7OBGB.js} +82 -51
- package/dist/development/{chunk-3D24XHV2.mjs → chunk-HZX6U7MI.mjs} +2 -2
- package/dist/{production/chunk-GSF7DANI.js → development/chunk-VC6RBZTR.js} +130 -130
- package/dist/development/{chunk-WSV33ENW.mjs → chunk-ZYFC6VSF.mjs} +47 -16
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- 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.js +1 -1
- package/dist/development/index-react-server.mjs +1 -1
- package/dist/development/index.js +98 -98
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/production/{chunk-DDK3XFL6.js → chunk-BOD6JCOU.js} +82 -51
- package/dist/{development/chunk-HQ37R3FK.js → production/chunk-O6DRQPUD.js} +130 -130
- package/dist/production/{chunk-IEIDJVF4.mjs → chunk-SIHON65V.mjs} +47 -16
- package/dist/production/{chunk-Q6IGLNPQ.mjs → chunk-XPGU3ZMH.mjs} +2 -2
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- 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.js +1 -1
- package/dist/production/index-react-server.mjs +1 -1
- package/dist/production/index.js +98 -98
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.8.0
|
|
2
|
+
* react-router v7.8.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
isSession,
|
|
32
32
|
routeRSCServerRequest,
|
|
33
33
|
setDevServerHooks
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-HZX6U7MI.mjs";
|
|
35
35
|
import {
|
|
36
36
|
Action,
|
|
37
37
|
Await,
|
|
@@ -140,7 +140,7 @@ import {
|
|
|
140
140
|
withComponentProps,
|
|
141
141
|
withErrorBoundaryProps,
|
|
142
142
|
withHydrateFallbackProps
|
|
143
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-ZYFC6VSF.mjs";
|
|
144
144
|
export {
|
|
145
145
|
Await,
|
|
146
146
|
BrowserRouter,
|
|
@@ -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.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -3920,12 +3920,36 @@ async function defaultDataStrategyWithMiddleware(args) {
|
|
|
3920
3920
|
if (!args.matches.some((m) => m.route.unstable_middleware)) {
|
|
3921
3921
|
return defaultDataStrategy(args);
|
|
3922
3922
|
}
|
|
3923
|
+
let didCallHandler = false;
|
|
3923
3924
|
return runClientMiddlewarePipeline(
|
|
3924
3925
|
args,
|
|
3925
|
-
() =>
|
|
3926
|
-
|
|
3926
|
+
() => {
|
|
3927
|
+
didCallHandler = true;
|
|
3928
|
+
return defaultDataStrategy(args);
|
|
3929
|
+
},
|
|
3930
|
+
(error, routeId) => clientMiddlewareErrorHandler(
|
|
3931
|
+
error,
|
|
3932
|
+
routeId,
|
|
3933
|
+
args.matches,
|
|
3934
|
+
didCallHandler
|
|
3935
|
+
)
|
|
3927
3936
|
);
|
|
3928
3937
|
}
|
|
3938
|
+
function clientMiddlewareErrorHandler(error, routeId, matches, didCallHandler) {
|
|
3939
|
+
if (didCallHandler) {
|
|
3940
|
+
return {
|
|
3941
|
+
[routeId]: { type: "error", result: error }
|
|
3942
|
+
};
|
|
3943
|
+
} else {
|
|
3944
|
+
let boundaryRouteId = findNearestBoundary(
|
|
3945
|
+
matches,
|
|
3946
|
+
_optionalChain([matches, 'access', _37 => _37.find, 'call', _38 => _38((m) => m.route.id === routeId || m.route.loader), 'optionalAccess', _39 => _39.route, 'access', _40 => _40.id]) || routeId
|
|
3947
|
+
).route.id;
|
|
3948
|
+
return {
|
|
3949
|
+
[boundaryRouteId]: { type: "error", result: error }
|
|
3950
|
+
};
|
|
3951
|
+
}
|
|
3952
|
+
}
|
|
3929
3953
|
async function runServerMiddlewarePipeline(args, handler, errorHandler) {
|
|
3930
3954
|
let { matches, request, params, context } = args;
|
|
3931
3955
|
let tuples = matches.flatMap(
|
|
@@ -4144,8 +4168,8 @@ function getDataStrategyMatch(mapRouteProperties, manifest, request, match, lazy
|
|
|
4144
4168
|
return callLoaderOrAction({
|
|
4145
4169
|
request,
|
|
4146
4170
|
match,
|
|
4147
|
-
lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess',
|
|
4148
|
-
lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess',
|
|
4171
|
+
lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess', _41 => _41.handler]),
|
|
4172
|
+
lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess', _42 => _42.route]),
|
|
4149
4173
|
handlerOverride,
|
|
4150
4174
|
scopedContext
|
|
4151
4175
|
});
|
|
@@ -4185,8 +4209,8 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, m
|
|
|
4185
4209
|
});
|
|
4186
4210
|
}
|
|
4187
4211
|
async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherKey, scopedContext, isStaticHandler) {
|
|
4188
|
-
if (matches.some((m) => _optionalChain([m, 'access',
|
|
4189
|
-
await Promise.all(matches.map((m) => _optionalChain([m, 'access',
|
|
4212
|
+
if (matches.some((m) => _optionalChain([m, 'access', _43 => _43._lazyPromises, 'optionalAccess', _44 => _44.middleware]))) {
|
|
4213
|
+
await Promise.all(matches.map((m) => _optionalChain([m, 'access', _45 => _45._lazyPromises, 'optionalAccess', _46 => _46.middleware])));
|
|
4190
4214
|
}
|
|
4191
4215
|
let dataStrategyArgs = {
|
|
4192
4216
|
request,
|
|
@@ -4200,20 +4224,27 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
|
|
|
4200
4224
|
);
|
|
4201
4225
|
} : (cb) => {
|
|
4202
4226
|
let typedDataStrategyArgs = dataStrategyArgs;
|
|
4227
|
+
let didCallHandler = false;
|
|
4203
4228
|
return runClientMiddlewarePipeline(
|
|
4204
4229
|
typedDataStrategyArgs,
|
|
4205
|
-
() =>
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
}
|
|
4230
|
+
() => {
|
|
4231
|
+
didCallHandler = true;
|
|
4232
|
+
return cb({
|
|
4233
|
+
...typedDataStrategyArgs,
|
|
4234
|
+
fetcherKey,
|
|
4235
|
+
unstable_runClientMiddleware: () => {
|
|
4236
|
+
throw new Error(
|
|
4237
|
+
"Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler"
|
|
4238
|
+
);
|
|
4239
|
+
}
|
|
4240
|
+
});
|
|
4241
|
+
},
|
|
4242
|
+
(error, routeId) => clientMiddlewareErrorHandler(
|
|
4243
|
+
error,
|
|
4244
|
+
routeId,
|
|
4245
|
+
matches,
|
|
4246
|
+
didCallHandler
|
|
4247
|
+
)
|
|
4217
4248
|
);
|
|
4218
4249
|
};
|
|
4219
4250
|
let results = await dataStrategyImpl({
|
|
@@ -4224,8 +4255,8 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
|
|
|
4224
4255
|
try {
|
|
4225
4256
|
await Promise.all(
|
|
4226
4257
|
matches.flatMap((m) => [
|
|
4227
|
-
_optionalChain([m, 'access',
|
|
4228
|
-
_optionalChain([m, 'access',
|
|
4258
|
+
_optionalChain([m, 'access', _47 => _47._lazyPromises, 'optionalAccess', _48 => _48.handler]),
|
|
4259
|
+
_optionalChain([m, 'access', _49 => _49._lazyPromises, 'optionalAccess', _50 => _50.route])
|
|
4229
4260
|
])
|
|
4230
4261
|
);
|
|
4231
4262
|
} catch (e) {
|
|
@@ -4370,19 +4401,19 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
|
|
|
4370
4401
|
return {
|
|
4371
4402
|
type: "error" /* error */,
|
|
4372
4403
|
error: result.data,
|
|
4373
|
-
statusCode: _optionalChain([result, 'access',
|
|
4374
|
-
headers: _optionalChain([result, 'access',
|
|
4404
|
+
statusCode: _optionalChain([result, 'access', _51 => _51.init, 'optionalAccess', _52 => _52.status]),
|
|
4405
|
+
headers: _optionalChain([result, 'access', _53 => _53.init, 'optionalAccess', _54 => _54.headers]) ? new Headers(result.init.headers) : void 0
|
|
4375
4406
|
};
|
|
4376
4407
|
}
|
|
4377
4408
|
return {
|
|
4378
4409
|
type: "error" /* error */,
|
|
4379
4410
|
error: new ErrorResponseImpl(
|
|
4380
|
-
_optionalChain([result, 'access',
|
|
4411
|
+
_optionalChain([result, 'access', _55 => _55.init, 'optionalAccess', _56 => _56.status]) || 500,
|
|
4381
4412
|
void 0,
|
|
4382
4413
|
result.data
|
|
4383
4414
|
),
|
|
4384
4415
|
statusCode: isRouteErrorResponse(result) ? result.status : void 0,
|
|
4385
|
-
headers: _optionalChain([result, 'access',
|
|
4416
|
+
headers: _optionalChain([result, 'access', _57 => _57.init, 'optionalAccess', _58 => _58.headers]) ? new Headers(result.init.headers) : void 0
|
|
4386
4417
|
};
|
|
4387
4418
|
}
|
|
4388
4419
|
return {
|
|
@@ -4395,8 +4426,8 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
|
|
|
4395
4426
|
return {
|
|
4396
4427
|
type: "data" /* data */,
|
|
4397
4428
|
data: result.data,
|
|
4398
|
-
statusCode: _optionalChain([result, 'access',
|
|
4399
|
-
headers: _optionalChain([result, 'access',
|
|
4429
|
+
statusCode: _optionalChain([result, 'access', _59 => _59.init, 'optionalAccess', _60 => _60.status]),
|
|
4430
|
+
headers: _optionalChain([result, 'access', _61 => _61.init, 'optionalAccess', _62 => _62.headers]) ? new Headers(result.init.headers) : void 0
|
|
4400
4431
|
};
|
|
4401
4432
|
}
|
|
4402
4433
|
return { type: "data" /* data */, data: result };
|
|
@@ -4545,7 +4576,7 @@ function processLoaderData(state, matches, results, pendingActionResult, revalid
|
|
|
4545
4576
|
let result = fetcherResults[key];
|
|
4546
4577
|
invariant(result, "Did not find corresponding fetcher result");
|
|
4547
4578
|
if (isErrorResult(result)) {
|
|
4548
|
-
let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess',
|
|
4579
|
+
let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess', _63 => _63.route, 'access', _64 => _64.id]));
|
|
4549
4580
|
if (!(errors && errors[boundaryMatch.route.id])) {
|
|
4550
4581
|
errors = {
|
|
4551
4582
|
...errors,
|
|
@@ -4682,8 +4713,8 @@ function dataWithResponseInitToResponse(data2) {
|
|
|
4682
4713
|
}
|
|
4683
4714
|
function dataWithResponseInitToErrorResponse(data2) {
|
|
4684
4715
|
return new ErrorResponseImpl(
|
|
4685
|
-
_nullishCoalesce(_optionalChain([data2, 'access',
|
|
4686
|
-
_nullishCoalesce(_optionalChain([data2, 'access',
|
|
4716
|
+
_nullishCoalesce(_optionalChain([data2, 'access', _65 => _65.init, 'optionalAccess', _66 => _66.status]), () => ( 500)),
|
|
4717
|
+
_nullishCoalesce(_optionalChain([data2, 'access', _67 => _67.init, 'optionalAccess', _68 => _68.statusText]), () => ( "Internal Server Error")),
|
|
4687
4718
|
data2.data
|
|
4688
4719
|
);
|
|
4689
4720
|
}
|
|
@@ -5722,7 +5753,7 @@ function getTurboStreamSingleFetchDataStrategy(getRouter, manifest, routeModules
|
|
|
5722
5753
|
return {
|
|
5723
5754
|
hasLoader: manifestRoute.hasLoader,
|
|
5724
5755
|
hasClientLoader: manifestRoute.hasClientLoader,
|
|
5725
|
-
hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess',
|
|
5756
|
+
hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess', _69 => _69.shouldRevalidate]))
|
|
5726
5757
|
};
|
|
5727
5758
|
},
|
|
5728
5759
|
fetchAndDecodeViaTurboStream,
|
|
@@ -5889,7 +5920,7 @@ async function bubbleMiddlewareErrors(singleFetchPromise, matches, routesParams,
|
|
|
5889
5920
|
let routeResult = fetchedData.routes[match.route.id];
|
|
5890
5921
|
if ("error" in routeResult) {
|
|
5891
5922
|
middlewareError = routeResult.error;
|
|
5892
|
-
if (_optionalChain([results, 'access',
|
|
5923
|
+
if (_optionalChain([results, 'access', _70 => _70[match.route.id], 'optionalAccess', _71 => _71.result]) == null) {
|
|
5893
5924
|
results[match.route.id] = {
|
|
5894
5925
|
type: "error",
|
|
5895
5926
|
result: middlewareError
|
|
@@ -6002,7 +6033,7 @@ async function fetchAndDecodeViaTurboStream(args, basename, targetRoutes) {
|
|
|
6002
6033
|
}
|
|
6003
6034
|
} else {
|
|
6004
6035
|
let typed = decoded.value;
|
|
6005
|
-
let routeId = _optionalChain([targetRoutes, 'optionalAccess',
|
|
6036
|
+
let routeId = _optionalChain([targetRoutes, 'optionalAccess', _72 => _72[0]]);
|
|
6006
6037
|
invariant2(routeId, "No routeId found for single fetch call decoding");
|
|
6007
6038
|
if ("redirect" in typed) {
|
|
6008
6039
|
data2 = { redirect: typed };
|
|
@@ -6313,7 +6344,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
6313
6344
|
if (locationArg) {
|
|
6314
6345
|
let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
|
|
6315
6346
|
invariant(
|
|
6316
|
-
parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access',
|
|
6347
|
+
parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access', _73 => _73.pathname, 'optionalAccess', _74 => _74.startsWith, 'call', _75 => _75(parentPathnameBase)]),
|
|
6317
6348
|
`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.`
|
|
6318
6349
|
);
|
|
6319
6350
|
location = parsedLocationArg;
|
|
@@ -6461,10 +6492,10 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
|
|
|
6461
6492
|
}
|
|
6462
6493
|
}
|
|
6463
6494
|
let renderedMatches = matches;
|
|
6464
|
-
let errors = _optionalChain([dataRouterState, 'optionalAccess',
|
|
6495
|
+
let errors = _optionalChain([dataRouterState, 'optionalAccess', _76 => _76.errors]);
|
|
6465
6496
|
if (errors != null) {
|
|
6466
6497
|
let errorIndex = renderedMatches.findIndex(
|
|
6467
|
-
(m) => m.route.id && _optionalChain([errors, 'optionalAccess',
|
|
6498
|
+
(m) => m.route.id && _optionalChain([errors, 'optionalAccess', _77 => _77[m.route.id]]) !== void 0
|
|
6468
6499
|
);
|
|
6469
6500
|
invariant(
|
|
6470
6501
|
errorIndex >= 0,
|
|
@@ -6641,15 +6672,15 @@ function useRouteError() {
|
|
|
6641
6672
|
if (error !== void 0) {
|
|
6642
6673
|
return error;
|
|
6643
6674
|
}
|
|
6644
|
-
return _optionalChain([state, 'access',
|
|
6675
|
+
return _optionalChain([state, 'access', _78 => _78.errors, 'optionalAccess', _79 => _79[routeId]]);
|
|
6645
6676
|
}
|
|
6646
6677
|
function useAsyncValue() {
|
|
6647
6678
|
let value = React3.useContext(AwaitContext);
|
|
6648
|
-
return _optionalChain([value, 'optionalAccess',
|
|
6679
|
+
return _optionalChain([value, 'optionalAccess', _80 => _80._data]);
|
|
6649
6680
|
}
|
|
6650
6681
|
function useAsyncError() {
|
|
6651
6682
|
let value = React3.useContext(AwaitContext);
|
|
6652
|
-
return _optionalChain([value, 'optionalAccess',
|
|
6683
|
+
return _optionalChain([value, 'optionalAccess', _81 => _81._error]);
|
|
6653
6684
|
}
|
|
6654
6685
|
var blockerId = 0;
|
|
6655
6686
|
function useBlocker(shouldBlock) {
|
|
@@ -6761,7 +6792,7 @@ function getKeyedLinksForMatches(matches, routeModules, manifest) {
|
|
|
6761
6792
|
let route = manifest.routes[match.route.id];
|
|
6762
6793
|
return [
|
|
6763
6794
|
route && route.css ? route.css.map((href) => ({ rel: "stylesheet", href })) : [],
|
|
6764
|
-
_optionalChain([module, 'optionalAccess',
|
|
6795
|
+
_optionalChain([module, 'optionalAccess', _82 => _82.links, 'optionalCall', _83 => _83()]) || []
|
|
6765
6796
|
];
|
|
6766
6797
|
}).flat(2);
|
|
6767
6798
|
let preloads = getModuleLinkHrefs(matches, manifest);
|
|
@@ -6862,7 +6893,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
|
|
|
6862
6893
|
// param change, /users/123 -> /users/456
|
|
6863
6894
|
currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path
|
|
6864
6895
|
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
6865
|
-
_optionalChain([currentMatches, 'access',
|
|
6896
|
+
_optionalChain([currentMatches, 'access', _84 => _84[index], 'access', _85 => _85.route, 'access', _86 => _86.path, 'optionalAccess', _87 => _87.endsWith, 'call', _88 => _88("*")]) && currentMatches[index].params["*"] !== match.params["*"]
|
|
6866
6897
|
);
|
|
6867
6898
|
};
|
|
6868
6899
|
if (mode === "assets") {
|
|
@@ -6885,7 +6916,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
|
|
|
6885
6916
|
location.pathname + location.search + location.hash,
|
|
6886
6917
|
window.origin
|
|
6887
6918
|
),
|
|
6888
|
-
currentParams: _optionalChain([currentMatches, 'access',
|
|
6919
|
+
currentParams: _optionalChain([currentMatches, 'access', _89 => _89[0], 'optionalAccess', _90 => _90.params]) || {},
|
|
6889
6920
|
nextUrl: new URL(page, window.origin),
|
|
6890
6921
|
nextParams: match.params,
|
|
6891
6922
|
defaultShouldRevalidate: true
|
|
@@ -7157,10 +7188,10 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7157
7188
|
)
|
|
7158
7189
|
});
|
|
7159
7190
|
let hasInitialData = initialState && initialState.loaderData && route.id in initialState.loaderData;
|
|
7160
|
-
let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess',
|
|
7191
|
+
let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess', _91 => _91.loaderData, 'optionalAccess', _92 => _92[route.id]]) : void 0;
|
|
7161
7192
|
let hasInitialError = initialState && initialState.errors && route.id in initialState.errors;
|
|
7162
|
-
let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess',
|
|
7163
|
-
let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access',
|
|
7193
|
+
let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess', _93 => _93.errors, 'optionalAccess', _94 => _94[route.id]]) : void 0;
|
|
7194
|
+
let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access', _95 => _95.clientLoader, 'optionalAccess', _96 => _96.hydrate]) === true || !route.hasLoader);
|
|
7164
7195
|
dataRoute.loader = async ({ request, params, context }, singleFetch) => {
|
|
7165
7196
|
try {
|
|
7166
7197
|
let result = await prefetchStylesAndCallHandler(async () => {
|
|
@@ -7457,7 +7488,7 @@ function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, routeDi
|
|
|
7457
7488
|
function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscovery, isSpaMode) {
|
|
7458
7489
|
React6.useEffect(() => {
|
|
7459
7490
|
if (!isFogOfWarEnabled(routeDiscovery, ssr) || // @ts-expect-error - TS doesn't know about this yet
|
|
7460
|
-
_optionalChain([window, 'access',
|
|
7491
|
+
_optionalChain([window, 'access', _97 => _97.navigator, 'optionalAccess', _98 => _98.connection, 'optionalAccess', _99 => _99.saveData]) === true) {
|
|
7461
7492
|
return;
|
|
7462
7493
|
}
|
|
7463
7494
|
function registerElement(el) {
|
|
@@ -7560,7 +7591,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
7560
7591
|
sessionStorage.removeItem(MANIFEST_VERSION_STORAGE_KEY);
|
|
7561
7592
|
serverPatches = await res.json();
|
|
7562
7593
|
} catch (e) {
|
|
7563
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
7594
|
+
if (_optionalChain([signal, 'optionalAccess', _100 => _100.aborted])) return;
|
|
7564
7595
|
throw e;
|
|
7565
7596
|
}
|
|
7566
7597
|
let knownRoutes = new Set(Object.keys(manifest.routes));
|
|
@@ -7801,7 +7832,7 @@ function PrefetchPageLinksImpl({
|
|
|
7801
7832
|
if (!manifestRoute || !manifestRoute.hasLoader) {
|
|
7802
7833
|
return;
|
|
7803
7834
|
}
|
|
7804
|
-
if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access',
|
|
7835
|
+
if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access', _101 => _101[m.route.id], 'optionalAccess', _102 => _102.shouldRevalidate])) {
|
|
7805
7836
|
foundOptOutRoute = true;
|
|
7806
7837
|
} else if (manifestRoute.hasClientLoader) {
|
|
7807
7838
|
foundOptOutRoute = true;
|
|
@@ -7875,7 +7906,7 @@ function Meta() {
|
|
|
7875
7906
|
error
|
|
7876
7907
|
};
|
|
7877
7908
|
matches[i] = match;
|
|
7878
|
-
if (_optionalChain([routeModule, 'optionalAccess',
|
|
7909
|
+
if (_optionalChain([routeModule, 'optionalAccess', _103 => _103.meta])) {
|
|
7879
7910
|
routeMeta = typeof routeModule.meta === "function" ? routeModule.meta({
|
|
7880
7911
|
data: data2,
|
|
7881
7912
|
loaderData: data2,
|
|
@@ -7971,7 +8002,7 @@ function Scripts(scriptProps) {
|
|
|
7971
8002
|
}
|
|
7972
8003
|
let streamScript = "window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());";
|
|
7973
8004
|
let contextScript = staticContext ? `window.__reactRouterContext = ${serverHandoffString};${streamScript}` : " ";
|
|
7974
|
-
let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access',
|
|
8005
|
+
let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access', _104 => _104.hmr, 'optionalAccess', _105 => _105.runtime]) ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
|
|
7975
8006
|
${matches.map((match, routeIndex) => {
|
|
7976
8007
|
let routeVarName = `route${routeIndex}`;
|
|
7977
8008
|
let manifestEntry = manifest.routes[match.route.id];
|
|
@@ -8201,7 +8232,7 @@ function BoundaryShell({
|
|
|
8201
8232
|
children
|
|
8202
8233
|
}) {
|
|
8203
8234
|
let { routeModules } = useFrameworkContext();
|
|
8204
|
-
if (_optionalChain([routeModules, 'access',
|
|
8235
|
+
if (_optionalChain([routeModules, 'access', _106 => _106.root, 'optionalAccess', _107 => _107.Layout]) && !isOutsideRemixApp) {
|
|
8205
8236
|
return children;
|
|
8206
8237
|
}
|
|
8207
8238
|
return /* @__PURE__ */ React8.createElement("html", { lang: "en" }, /* @__PURE__ */ React8.createElement("head", null, /* @__PURE__ */ React8.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ React8.createElement(
|