react-router 7.9.1 → 7.9.2-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 +19 -9
- package/dist/development/{chunk-PW3F6ATG.js → chunk-ED2JHW2I.js} +102 -70
- package/dist/development/{chunk-B7RQU5TL.mjs → chunk-EPSRV6KC.mjs} +64 -26
- package/dist/{production/chunk-RCAZODXZ.mjs → development/chunk-PVJ3J6E6.mjs} +94 -9
- package/dist/{production/chunk-3SXVZXGI.js → development/chunk-VM65TX2A.js} +138 -132
- package/dist/development/{context-CIdFp11b.d.mts → context-BqL5Eckq.d.mts} +20 -0
- package/dist/development/dom-export.d.mts +1 -1
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/{index-react-server-client-BeVfPpWg.d.mts → index-react-server-client-2EDmGlsZ.d.mts} +40 -24
- package/dist/{production/index-react-server-client-BYr9g50r.d.ts → development/index-react-server-client-DKvU8YRr.d.ts} +39 -23
- package/dist/development/index-react-server-client.d.mts +3 -3
- 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 +10 -0
- package/dist/development/index-react-server.d.ts +10 -0
- package/dist/development/index-react-server.js +3 -3
- package/dist/development/index-react-server.mjs +3 -3
- package/dist/development/index.d.mts +16 -12
- package/dist/development/index.d.ts +14 -10
- package/dist/development/index.js +190 -105
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +1 -1
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{route-data-Bpm4liR_.d.mts → route-data-CDwqkzPE.d.mts} +1 -1
- package/dist/{production/routeModules-DnUHijGz.d.ts → development/routeModules-BmVo7q9e.d.ts} +20 -0
- package/dist/production/{chunk-HMYSPRGR.js → chunk-22I2H6CR.js} +102 -70
- package/dist/production/{chunk-P25HWPOZ.mjs → chunk-662O2YDJ.mjs} +64 -26
- package/dist/{development/chunk-SKNKB5VI.mjs → production/chunk-HAV7J4RO.mjs} +94 -9
- package/dist/{development/chunk-LWNHKVDL.js → production/chunk-K4BWIVAI.js} +138 -132
- package/dist/production/{context-CIdFp11b.d.mts → context-BqL5Eckq.d.mts} +20 -0
- package/dist/production/dom-export.d.mts +1 -1
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/{index-react-server-client-BeVfPpWg.d.mts → index-react-server-client-2EDmGlsZ.d.mts} +40 -24
- package/dist/{development/index-react-server-client-BYr9g50r.d.ts → production/index-react-server-client-DKvU8YRr.d.ts} +39 -23
- package/dist/production/index-react-server-client.d.mts +3 -3
- 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 +10 -0
- package/dist/production/index-react-server.d.ts +10 -0
- package/dist/production/index-react-server.js +3 -3
- package/dist/production/index-react-server.mjs +3 -3
- package/dist/production/index.d.mts +16 -12
- package/dist/production/index.d.ts +14 -10
- package/dist/production/index.js +190 -105
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +1 -1
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{route-data-Bpm4liR_.d.mts → route-data-CDwqkzPE.d.mts} +1 -1
- package/dist/{development/routeModules-DnUHijGz.d.ts → production/routeModules-BmVo7q9e.d.ts} +20 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
+
## 7.9.2-pre.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- - Update client-side router to run client `middleware` on initial load even if no loaders exist ([#14348](https://github.com/remix-run/react-router/pull/14348))
|
|
8
|
+
- Update `createRoutesStub` to run route middleware
|
|
9
|
+
- You will need to set the `<RoutesStub future={{ v8_middleware: true }} />` flag to enable the proper `context` type
|
|
10
|
+
- Update Lazy Route Discovery manifest requests to use a singular comma-separated `paths` query param instead of repeated `p` query params ([#14321](https://github.com/remix-run/react-router/pull/14321))
|
|
11
|
+
- This is because Cloudflare has a hard limit of 100 URL search param key/value pairs when used as a key for caching purposes
|
|
12
|
+
- If more that 100 paths were included, the cache key would be incomplete and could produce false-positive cache hits
|
|
13
|
+
|
|
14
|
+
- [UNSTABLE] Add `fetcher.unstable_reset()` API ([#14206](https://github.com/remix-run/react-router/pull/14206))
|
|
15
|
+
- Made useOutlet element reference have stable identity in-between route chages ([#13382](https://github.com/remix-run/react-router/pull/13382))
|
|
16
|
+
- In RSC Data Mode, handle SSR'd client errors and re-try in the browser ([#14342](https://github.com/remix-run/react-router/pull/14342))
|
|
17
|
+
- Support `middleware` prop on `<Route>` for usage with a data router via `createRoutesFromElements` ([#14357](https://github.com/remix-run/react-router/pull/14357))
|
|
18
|
+
- Handle encoded question mark and hash characters in ancestor splat routes ([#14249](https://github.com/remix-run/react-router/pull/14249))
|
|
19
|
+
- Fail gracefully on manifest version mismatch logic if `sessionStorage` access is blocked ([#14335](https://github.com/remix-run/react-router/pull/14335))
|
|
20
|
+
|
|
3
21
|
## 7.9.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -13,7 +31,6 @@
|
|
|
13
31
|
- Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
|
|
14
32
|
|
|
15
33
|
We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
|
|
16
|
-
|
|
17
34
|
- [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
|
|
18
35
|
- [`createContext`](https://reactrouter.com/api/utils/createContext)
|
|
19
36
|
- `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
|
|
@@ -40,7 +57,7 @@
|
|
|
40
57
|
|
|
41
58
|
- \[UNSTABLE] Add `<RouterProvider unstable_onError>`/`<HydratedRouter unstable_onError>` prop for client side error reporting ([#14162](https://github.com/remix-run/react-router/pull/14162))
|
|
42
59
|
|
|
43
|
-
- server action revalidation opt out via $
|
|
60
|
+
- server action revalidation opt out via $SKIP_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
|
|
44
61
|
|
|
45
62
|
- Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530))
|
|
46
63
|
|
|
@@ -89,7 +106,6 @@
|
|
|
89
106
|
- Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
|
|
90
107
|
|
|
91
108
|
- Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
|
|
92
|
-
|
|
93
109
|
- When an `ErrorBoundary` is being rendered, not all active matches will have loader data available, since it may have been their `loader` that threw to trigger the boundary
|
|
94
110
|
- The `UIMatch.data` type was not correctly handing this and would always reflect the presence of data, leading to the unexpected runtime errors when an `ErrorBoundary` was rendered
|
|
95
111
|
- ⚠️ This may cause some type errors to show up in your code for unguarded `match.data` accesses - you should properly guard for `undefined` values in those scenarios.
|
|
@@ -123,7 +139,6 @@
|
|
|
123
139
|
- \[UNSTABLE] When middleware is enabled, make the `context` parameter read-only (via `Readonly<unstable_RouterContextProvider>`) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware. ([#14097](https://github.com/remix-run/react-router/pull/14097))
|
|
124
140
|
|
|
125
141
|
- \[UNSTABLE] Rename and alter the signature/functionality of the `unstable_respond` API in `staticHandler.query`/`staticHandler.queryRoute` ([#14103](https://github.com/remix-run/react-router/pull/14103))
|
|
126
|
-
|
|
127
142
|
- The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
|
|
128
143
|
- The main functional change is that instead of running the loaders/actions before calling `unstable_respond` and handing you the result, we now pass a `query`/`queryRoute` function as a parameter and you execute the loaders/actions inside your callback, giving you full access to pre-processing and error handling
|
|
129
144
|
- The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
|
|
@@ -769,7 +784,6 @@
|
|
|
769
784
|
```
|
|
770
785
|
|
|
771
786
|
Similar to server-side requests, a fresh `context` will be created per navigation (or `fetcher` call). If you have initial data you'd like to populate in the context for every request, you can provide an `unstable_getContext` function at the root of your app:
|
|
772
|
-
|
|
773
787
|
- Library mode - `createBrowserRouter(routes, { unstable_getContext })`
|
|
774
788
|
- Framework mode - `<HydratedRouter unstable_getContext>`
|
|
775
789
|
|
|
@@ -957,7 +971,6 @@ _No changes_
|
|
|
957
971
|
- Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
|
|
958
972
|
|
|
959
973
|
- For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837))
|
|
960
|
-
|
|
961
974
|
- `createCookie`
|
|
962
975
|
- `createCookieSessionStorage`
|
|
963
976
|
- `createMemorySessionStorage`
|
|
@@ -966,7 +979,6 @@ _No changes_
|
|
|
966
979
|
For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html)
|
|
967
980
|
|
|
968
981
|
Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
|
|
969
|
-
|
|
970
982
|
- `createCookieFactory`
|
|
971
983
|
- `createSessionStorageFactory`
|
|
972
984
|
- `createCookieSessionStorageFactory`
|
|
@@ -1122,7 +1134,6 @@ _No changes_
|
|
|
1122
1134
|
```
|
|
1123
1135
|
|
|
1124
1136
|
This initial implementation targets type inference for:
|
|
1125
|
-
|
|
1126
1137
|
- `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
|
|
1127
1138
|
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
|
|
1128
1139
|
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
|
|
@@ -1137,7 +1148,6 @@ _No changes_
|
|
|
1137
1148
|
```
|
|
1138
1149
|
|
|
1139
1150
|
Check out our docs for more:
|
|
1140
|
-
|
|
1141
1151
|
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
|
|
1142
1152
|
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
|
|
1143
1153
|
|
|
@@ -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.9.
|
|
2
|
+
* react-router v7.9.2-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -1054,7 +1054,7 @@ function createRouter(init) {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
} else if (initialMatches.some((m) => m.route.lazy)) {
|
|
1056
1056
|
initialized = false;
|
|
1057
|
-
} else if (!initialMatches.some((m) => m.route
|
|
1057
|
+
} else if (!initialMatches.some((m) => routeHasLoaderOrMiddleware(m.route))) {
|
|
1058
1058
|
initialized = true;
|
|
1059
1059
|
} else {
|
|
1060
1060
|
let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;
|
|
@@ -1756,7 +1756,9 @@ function createRouter(init) {
|
|
|
1756
1756
|
pendingActionResult
|
|
1757
1757
|
);
|
|
1758
1758
|
pendingNavigationLoadId = ++incrementingLoadId;
|
|
1759
|
-
if (!init.dataStrategy && !dsMatches.some((m) => m.shouldLoad) && !dsMatches.some(
|
|
1759
|
+
if (!init.dataStrategy && !dsMatches.some((m) => m.shouldLoad) && !dsMatches.some(
|
|
1760
|
+
(m) => m.route.middleware && m.route.middleware.length > 0
|
|
1761
|
+
) && revalidatingFetchers.length === 0) {
|
|
1760
1762
|
let updatedFetchers2 = markFetchRedirectsDone();
|
|
1761
1763
|
completeNavigation(
|
|
1762
1764
|
location,
|
|
@@ -2437,6 +2439,10 @@ function createRouter(init) {
|
|
|
2437
2439
|
}
|
|
2438
2440
|
return state.fetchers.get(key) || IDLE_FETCHER;
|
|
2439
2441
|
}
|
|
2442
|
+
function resetFetcher(key, opts) {
|
|
2443
|
+
abortFetcher(key, _optionalChain([opts, 'optionalAccess', _15 => _15.reason]));
|
|
2444
|
+
updateFetcherState(key, getDoneFetcher(null));
|
|
2445
|
+
}
|
|
2440
2446
|
function deleteFetcher(key) {
|
|
2441
2447
|
let fetcher = state.fetchers.get(key);
|
|
2442
2448
|
if (fetchControllers.has(key) && !(fetcher && fetcher.state === "loading" && fetchReloadIds.has(key))) {
|
|
@@ -2459,10 +2465,10 @@ function createRouter(init) {
|
|
|
2459
2465
|
}
|
|
2460
2466
|
updateState({ fetchers: new Map(state.fetchers) });
|
|
2461
2467
|
}
|
|
2462
|
-
function abortFetcher(key) {
|
|
2468
|
+
function abortFetcher(key, reason) {
|
|
2463
2469
|
let controller = fetchControllers.get(key);
|
|
2464
2470
|
if (controller) {
|
|
2465
|
-
controller.abort();
|
|
2471
|
+
controller.abort(reason);
|
|
2466
2472
|
fetchControllers.delete(key);
|
|
2467
2473
|
}
|
|
2468
2474
|
}
|
|
@@ -2726,6 +2732,7 @@ function createRouter(init) {
|
|
|
2726
2732
|
createHref: (to) => init.history.createHref(to),
|
|
2727
2733
|
encodeLocation: (to) => init.history.encodeLocation(to),
|
|
2728
2734
|
getFetcher,
|
|
2735
|
+
resetFetcher,
|
|
2729
2736
|
deleteFetcher: queueFetcherForDeletion,
|
|
2730
2737
|
dispose,
|
|
2731
2738
|
getBlocker,
|
|
@@ -2748,7 +2755,7 @@ function createStaticHandler(routes, opts) {
|
|
|
2748
2755
|
);
|
|
2749
2756
|
let manifest = {};
|
|
2750
2757
|
let basename = (opts ? opts.basename : null) || "/";
|
|
2751
|
-
let mapRouteProperties = _optionalChain([opts, 'optionalAccess',
|
|
2758
|
+
let mapRouteProperties = _optionalChain([opts, 'optionalAccess', _16 => _16.mapRouteProperties]) || defaultMapRouteProperties;
|
|
2752
2759
|
let dataRoutes = convertRoutesToDataRoutes(
|
|
2753
2760
|
routes,
|
|
2754
2761
|
mapRouteProperties,
|
|
@@ -2881,9 +2888,9 @@ function createStaticHandler(routes, opts) {
|
|
|
2881
2888
|
} else {
|
|
2882
2889
|
let boundaryRouteId = skipLoaderErrorBubbling ? routeId : findNearestBoundary(
|
|
2883
2890
|
matches,
|
|
2884
|
-
_optionalChain([matches, 'access',
|
|
2891
|
+
_optionalChain([matches, 'access', _17 => _17.find, 'call', _18 => _18(
|
|
2885
2892
|
(m) => m.route.id === routeId || m.route.loader
|
|
2886
|
-
), 'optionalAccess',
|
|
2893
|
+
), 'optionalAccess', _19 => _19.route, 'access', _20 => _20.id]) || routeId
|
|
2887
2894
|
).route.id;
|
|
2888
2895
|
let staticContext = {
|
|
2889
2896
|
matches,
|
|
@@ -3215,11 +3222,11 @@ function createStaticHandler(routes, opts) {
|
|
|
3215
3222
|
}
|
|
3216
3223
|
async function loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, filterMatchesToLoad, pendingActionResult) {
|
|
3217
3224
|
let isRouteRequest = routeMatch != null;
|
|
3218
|
-
if (isRouteRequest && !_optionalChain([routeMatch, 'optionalAccess',
|
|
3225
|
+
if (isRouteRequest && !_optionalChain([routeMatch, 'optionalAccess', _21 => _21.route, 'access', _22 => _22.loader]) && !_optionalChain([routeMatch, 'optionalAccess', _23 => _23.route, 'access', _24 => _24.lazy])) {
|
|
3219
3226
|
throw getInternalRouterError(400, {
|
|
3220
3227
|
method: request.method,
|
|
3221
3228
|
pathname: new URL(request.url).pathname,
|
|
3222
|
-
routeId: _optionalChain([routeMatch, 'optionalAccess',
|
|
3229
|
+
routeId: _optionalChain([routeMatch, 'optionalAccess', _25 => _25.route, 'access', _26 => _26.id])
|
|
3223
3230
|
});
|
|
3224
3231
|
}
|
|
3225
3232
|
let dsMatches;
|
|
@@ -3527,7 +3534,7 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties, manifest,
|
|
|
3527
3534
|
let shouldSkipRevalidation = actionStatus && actionStatus >= 400;
|
|
3528
3535
|
let baseShouldRevalidateArgs = {
|
|
3529
3536
|
currentUrl,
|
|
3530
|
-
currentParams: _optionalChain([state, 'access',
|
|
3537
|
+
currentParams: _optionalChain([state, 'access', _27 => _27.matches, 'access', _28 => _28[0], 'optionalAccess', _29 => _29.params]) || {},
|
|
3531
3538
|
nextUrl,
|
|
3532
3539
|
nextParams: matches[0].params,
|
|
3533
3540
|
...submission,
|
|
@@ -3541,7 +3548,7 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties, manifest,
|
|
|
3541
3548
|
forceShouldLoad = false;
|
|
3542
3549
|
} else if (route.lazy) {
|
|
3543
3550
|
forceShouldLoad = true;
|
|
3544
|
-
} else if (route
|
|
3551
|
+
} else if (!routeHasLoaderOrMiddleware(route)) {
|
|
3545
3552
|
forceShouldLoad = false;
|
|
3546
3553
|
} else if (initialHydration) {
|
|
3547
3554
|
forceShouldLoad = shouldLoadRouteOnHydration(
|
|
@@ -3673,11 +3680,14 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties, manifest,
|
|
|
3673
3680
|
});
|
|
3674
3681
|
return { dsMatches, revalidatingFetchers };
|
|
3675
3682
|
}
|
|
3683
|
+
function routeHasLoaderOrMiddleware(route) {
|
|
3684
|
+
return route.loader != null || route.middleware != null && route.middleware.length > 0;
|
|
3685
|
+
}
|
|
3676
3686
|
function shouldLoadRouteOnHydration(route, loaderData, errors) {
|
|
3677
3687
|
if (route.lazy) {
|
|
3678
3688
|
return true;
|
|
3679
3689
|
}
|
|
3680
|
-
if (!route
|
|
3690
|
+
if (!routeHasLoaderOrMiddleware(route)) {
|
|
3681
3691
|
return false;
|
|
3682
3692
|
}
|
|
3683
3693
|
let hasData = loaderData != null && route.id in loaderData;
|
|
@@ -3748,7 +3758,7 @@ function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRoutePrope
|
|
|
3748
3758
|
let newRoutes = convertRoutesToDataRoutes(
|
|
3749
3759
|
uniqueChildren,
|
|
3750
3760
|
mapRouteProperties,
|
|
3751
|
-
[routeId || "_", "patch", String(_optionalChain([childrenToPatch, 'optionalAccess',
|
|
3761
|
+
[routeId || "_", "patch", String(_optionalChain([childrenToPatch, 'optionalAccess', _30 => _30.length]) || "0")],
|
|
3752
3762
|
manifest
|
|
3753
3763
|
);
|
|
3754
3764
|
childrenToPatch.push(...newRoutes);
|
|
@@ -3785,7 +3795,7 @@ function isSameRoute(newRoute, existingRoute) {
|
|
|
3785
3795
|
return true;
|
|
3786
3796
|
}
|
|
3787
3797
|
return newRoute.children.every(
|
|
3788
|
-
(aChild, i) => _optionalChain([existingRoute, 'access',
|
|
3798
|
+
(aChild, i) => _optionalChain([existingRoute, 'access', _31 => _31.children, 'optionalAccess', _32 => _32.some, 'call', _33 => _33((bChild) => isSameRoute(aChild, bChild))])
|
|
3789
3799
|
);
|
|
3790
3800
|
}
|
|
3791
3801
|
var lazyRoutePropertyCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -3933,9 +3943,9 @@ function loadLazyRoute(route, type, manifest, mapRouteProperties, lazyRoutePrope
|
|
|
3933
3943
|
}
|
|
3934
3944
|
let lazyRoutePromise = lazyPropertyPromises.length > 0 ? Promise.all(lazyPropertyPromises).then(() => {
|
|
3935
3945
|
}) : void 0;
|
|
3936
|
-
_optionalChain([lazyRoutePromise, 'optionalAccess',
|
|
3946
|
+
_optionalChain([lazyRoutePromise, 'optionalAccess', _34 => _34.catch, 'call', _35 => _35(() => {
|
|
3937
3947
|
})]);
|
|
3938
|
-
_optionalChain([lazyHandlerPromise, 'optionalAccess',
|
|
3948
|
+
_optionalChain([lazyHandlerPromise, 'optionalAccess', _36 => _36.catch, 'call', _37 => _37(() => {
|
|
3939
3949
|
})]);
|
|
3940
3950
|
return {
|
|
3941
3951
|
lazyRoutePromise,
|
|
@@ -4006,9 +4016,15 @@ function runClientMiddlewarePipeline(args, handler) {
|
|
|
4006
4016
|
let { matches } = args;
|
|
4007
4017
|
let maxBoundaryIdx = Math.min(
|
|
4008
4018
|
// Throwing route
|
|
4009
|
-
|
|
4019
|
+
Math.max(
|
|
4020
|
+
matches.findIndex((m) => m.route.id === routeId),
|
|
4021
|
+
0
|
|
4022
|
+
),
|
|
4010
4023
|
// or the shallowest route that needs to load data
|
|
4011
|
-
|
|
4024
|
+
Math.max(
|
|
4025
|
+
matches.findIndex((m) => m.unstable_shouldCallHandler()),
|
|
4026
|
+
0
|
|
4027
|
+
)
|
|
4012
4028
|
);
|
|
4013
4029
|
let boundaryRouteId = findNearestBoundary(
|
|
4014
4030
|
matches,
|
|
@@ -4136,8 +4152,8 @@ function getDataStrategyMatch(mapRouteProperties, manifest, request, match, lazy
|
|
|
4136
4152
|
return callLoaderOrAction({
|
|
4137
4153
|
request,
|
|
4138
4154
|
match,
|
|
4139
|
-
lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess',
|
|
4140
|
-
lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess',
|
|
4155
|
+
lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess', _38 => _38.handler]),
|
|
4156
|
+
lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess', _39 => _39.route]),
|
|
4141
4157
|
handlerOverride,
|
|
4142
4158
|
scopedContext
|
|
4143
4159
|
});
|
|
@@ -4177,8 +4193,8 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, m
|
|
|
4177
4193
|
});
|
|
4178
4194
|
}
|
|
4179
4195
|
async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherKey, scopedContext, isStaticHandler) {
|
|
4180
|
-
if (matches.some((m) => _optionalChain([m, 'access',
|
|
4181
|
-
await Promise.all(matches.map((m) => _optionalChain([m, 'access',
|
|
4196
|
+
if (matches.some((m) => _optionalChain([m, 'access', _40 => _40._lazyPromises, 'optionalAccess', _41 => _41.middleware]))) {
|
|
4197
|
+
await Promise.all(matches.map((m) => _optionalChain([m, 'access', _42 => _42._lazyPromises, 'optionalAccess', _43 => _43.middleware])));
|
|
4182
4198
|
}
|
|
4183
4199
|
let dataStrategyArgs = {
|
|
4184
4200
|
request,
|
|
@@ -4212,8 +4228,8 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
|
|
|
4212
4228
|
try {
|
|
4213
4229
|
await Promise.all(
|
|
4214
4230
|
matches.flatMap((m) => [
|
|
4215
|
-
_optionalChain([m, 'access',
|
|
4216
|
-
_optionalChain([m, 'access',
|
|
4231
|
+
_optionalChain([m, 'access', _44 => _44._lazyPromises, 'optionalAccess', _45 => _45.handler]),
|
|
4232
|
+
_optionalChain([m, 'access', _46 => _46._lazyPromises, 'optionalAccess', _47 => _47.route])
|
|
4217
4233
|
])
|
|
4218
4234
|
);
|
|
4219
4235
|
} catch (e) {
|
|
@@ -4356,19 +4372,19 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
|
|
|
4356
4372
|
return {
|
|
4357
4373
|
type: "error" /* error */,
|
|
4358
4374
|
error: result.data,
|
|
4359
|
-
statusCode: _optionalChain([result, 'access',
|
|
4360
|
-
headers: _optionalChain([result, 'access',
|
|
4375
|
+
statusCode: _optionalChain([result, 'access', _48 => _48.init, 'optionalAccess', _49 => _49.status]),
|
|
4376
|
+
headers: _optionalChain([result, 'access', _50 => _50.init, 'optionalAccess', _51 => _51.headers]) ? new Headers(result.init.headers) : void 0
|
|
4361
4377
|
};
|
|
4362
4378
|
}
|
|
4363
4379
|
return {
|
|
4364
4380
|
type: "error" /* error */,
|
|
4365
4381
|
error: new ErrorResponseImpl(
|
|
4366
|
-
_optionalChain([result, 'access',
|
|
4382
|
+
_optionalChain([result, 'access', _52 => _52.init, 'optionalAccess', _53 => _53.status]) || 500,
|
|
4367
4383
|
void 0,
|
|
4368
4384
|
result.data
|
|
4369
4385
|
),
|
|
4370
4386
|
statusCode: isRouteErrorResponse(result) ? result.status : void 0,
|
|
4371
|
-
headers: _optionalChain([result, 'access',
|
|
4387
|
+
headers: _optionalChain([result, 'access', _54 => _54.init, 'optionalAccess', _55 => _55.headers]) ? new Headers(result.init.headers) : void 0
|
|
4372
4388
|
};
|
|
4373
4389
|
}
|
|
4374
4390
|
return {
|
|
@@ -4381,8 +4397,8 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
|
|
|
4381
4397
|
return {
|
|
4382
4398
|
type: "data" /* data */,
|
|
4383
4399
|
data: result.data,
|
|
4384
|
-
statusCode: _optionalChain([result, 'access',
|
|
4385
|
-
headers: _optionalChain([result, 'access',
|
|
4400
|
+
statusCode: _optionalChain([result, 'access', _56 => _56.init, 'optionalAccess', _57 => _57.status]),
|
|
4401
|
+
headers: _optionalChain([result, 'access', _58 => _58.init, 'optionalAccess', _59 => _59.headers]) ? new Headers(result.init.headers) : void 0
|
|
4386
4402
|
};
|
|
4387
4403
|
}
|
|
4388
4404
|
return { type: "data" /* data */, data: result };
|
|
@@ -4531,7 +4547,7 @@ function processLoaderData(state, matches, results, pendingActionResult, revalid
|
|
|
4531
4547
|
let result = fetcherResults[key];
|
|
4532
4548
|
invariant(result, "Did not find corresponding fetcher result");
|
|
4533
4549
|
if (isErrorResult(result)) {
|
|
4534
|
-
let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess',
|
|
4550
|
+
let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess', _60 => _60.route, 'access', _61 => _61.id]));
|
|
4535
4551
|
if (!(errors && errors[boundaryMatch.route.id])) {
|
|
4536
4552
|
errors = {
|
|
4537
4553
|
...errors,
|
|
@@ -4665,8 +4681,8 @@ function dataWithResponseInitToResponse(data2) {
|
|
|
4665
4681
|
}
|
|
4666
4682
|
function dataWithResponseInitToErrorResponse(data2) {
|
|
4667
4683
|
return new ErrorResponseImpl(
|
|
4668
|
-
_nullishCoalesce(_optionalChain([data2, 'access',
|
|
4669
|
-
_nullishCoalesce(_optionalChain([data2, 'access',
|
|
4684
|
+
_nullishCoalesce(_optionalChain([data2, 'access', _62 => _62.init, 'optionalAccess', _63 => _63.status]), () => ( 500)),
|
|
4685
|
+
_nullishCoalesce(_optionalChain([data2, 'access', _64 => _64.init, 'optionalAccess', _65 => _65.statusText]), () => ( "Internal Server Error")),
|
|
4670
4686
|
data2.data
|
|
4671
4687
|
);
|
|
4672
4688
|
}
|
|
@@ -5698,7 +5714,7 @@ function getTurboStreamSingleFetchDataStrategy(getRouter, manifest, routeModules
|
|
|
5698
5714
|
return {
|
|
5699
5715
|
hasLoader: manifestRoute.hasLoader,
|
|
5700
5716
|
hasClientLoader: manifestRoute.hasClientLoader,
|
|
5701
|
-
hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess',
|
|
5717
|
+
hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess', _66 => _66.shouldRevalidate]))
|
|
5702
5718
|
};
|
|
5703
5719
|
},
|
|
5704
5720
|
fetchAndDecodeViaTurboStream,
|
|
@@ -5865,7 +5881,7 @@ async function bubbleMiddlewareErrors(singleFetchPromise, matches, routesParams,
|
|
|
5865
5881
|
let routeResult = fetchedData.routes[match.route.id];
|
|
5866
5882
|
if ("error" in routeResult) {
|
|
5867
5883
|
middlewareError = routeResult.error;
|
|
5868
|
-
if (_optionalChain([results, 'access',
|
|
5884
|
+
if (_optionalChain([results, 'access', _67 => _67[match.route.id], 'optionalAccess', _68 => _68.result]) == null) {
|
|
5869
5885
|
results[match.route.id] = {
|
|
5870
5886
|
type: "error",
|
|
5871
5887
|
result: middlewareError
|
|
@@ -5978,7 +5994,7 @@ async function fetchAndDecodeViaTurboStream(args, basename, targetRoutes) {
|
|
|
5978
5994
|
}
|
|
5979
5995
|
} else {
|
|
5980
5996
|
let typed = decoded.value;
|
|
5981
|
-
let routeId = _optionalChain([targetRoutes, 'optionalAccess',
|
|
5997
|
+
let routeId = _optionalChain([targetRoutes, 'optionalAccess', _69 => _69[0]]);
|
|
5982
5998
|
invariant2(routeId, "No routeId found for single fetch call decoding");
|
|
5983
5999
|
if ("redirect" in typed) {
|
|
5984
6000
|
data2 = { redirect: typed };
|
|
@@ -6234,10 +6250,10 @@ function useOutletContext() {
|
|
|
6234
6250
|
}
|
|
6235
6251
|
function useOutlet(context) {
|
|
6236
6252
|
let outlet = React3.useContext(RouteContext).outlet;
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6253
|
+
return React3.useMemo(
|
|
6254
|
+
() => outlet && /* @__PURE__ */ React3.createElement(OutletContext.Provider, { value: context }, outlet),
|
|
6255
|
+
[outlet, context]
|
|
6256
|
+
);
|
|
6241
6257
|
}
|
|
6242
6258
|
function useParams() {
|
|
6243
6259
|
let { matches } = React3.useContext(RouteContext);
|
|
@@ -6290,7 +6306,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
6290
6306
|
if (locationArg) {
|
|
6291
6307
|
let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
|
|
6292
6308
|
invariant(
|
|
6293
|
-
parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access',
|
|
6309
|
+
parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access', _70 => _70.pathname, 'optionalAccess', _71 => _71.startsWith, 'call', _72 => _72(parentPathnameBase)]),
|
|
6294
6310
|
`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.`
|
|
6295
6311
|
);
|
|
6296
6312
|
location = parsedLocationArg;
|
|
@@ -6321,13 +6337,23 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
6321
6337
|
params: Object.assign({}, parentParams, match.params),
|
|
6322
6338
|
pathname: joinPaths([
|
|
6323
6339
|
parentPathnameBase,
|
|
6324
|
-
// Re-encode pathnames that were decoded inside matchRoutes
|
|
6325
|
-
|
|
6340
|
+
// Re-encode pathnames that were decoded inside matchRoutes.
|
|
6341
|
+
// Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
|
|
6342
|
+
// `new URL()` internally and we need to prevent it from treating
|
|
6343
|
+
// them as separators
|
|
6344
|
+
navigator.encodeLocation ? navigator.encodeLocation(
|
|
6345
|
+
match.pathname.replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
6346
|
+
).pathname : match.pathname
|
|
6326
6347
|
]),
|
|
6327
6348
|
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([
|
|
6328
6349
|
parentPathnameBase,
|
|
6329
6350
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
6330
|
-
|
|
6351
|
+
// Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
|
|
6352
|
+
// `new URL()` internally and we need to prevent it from treating
|
|
6353
|
+
// them as separators
|
|
6354
|
+
navigator.encodeLocation ? navigator.encodeLocation(
|
|
6355
|
+
match.pathnameBase.replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
6356
|
+
).pathname : match.pathnameBase
|
|
6331
6357
|
])
|
|
6332
6358
|
})
|
|
6333
6359
|
),
|
|
@@ -6442,10 +6468,10 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, uns
|
|
|
6442
6468
|
}
|
|
6443
6469
|
}
|
|
6444
6470
|
let renderedMatches = matches;
|
|
6445
|
-
let errors = _optionalChain([dataRouterState, 'optionalAccess',
|
|
6471
|
+
let errors = _optionalChain([dataRouterState, 'optionalAccess', _73 => _73.errors]);
|
|
6446
6472
|
if (errors != null) {
|
|
6447
6473
|
let errorIndex = renderedMatches.findIndex(
|
|
6448
|
-
(m) => m.route.id && _optionalChain([errors, 'optionalAccess',
|
|
6474
|
+
(m) => m.route.id && _optionalChain([errors, 'optionalAccess', _74 => _74[m.route.id]]) !== void 0
|
|
6449
6475
|
);
|
|
6450
6476
|
invariant(
|
|
6451
6477
|
errorIndex >= 0,
|
|
@@ -6623,15 +6649,15 @@ function useRouteError() {
|
|
|
6623
6649
|
if (error !== void 0) {
|
|
6624
6650
|
return error;
|
|
6625
6651
|
}
|
|
6626
|
-
return _optionalChain([state, 'access',
|
|
6652
|
+
return _optionalChain([state, 'access', _75 => _75.errors, 'optionalAccess', _76 => _76[routeId]]);
|
|
6627
6653
|
}
|
|
6628
6654
|
function useAsyncValue() {
|
|
6629
6655
|
let value = React3.useContext(AwaitContext);
|
|
6630
|
-
return _optionalChain([value, 'optionalAccess',
|
|
6656
|
+
return _optionalChain([value, 'optionalAccess', _77 => _77._data]);
|
|
6631
6657
|
}
|
|
6632
6658
|
function useAsyncError() {
|
|
6633
6659
|
let value = React3.useContext(AwaitContext);
|
|
6634
|
-
return _optionalChain([value, 'optionalAccess',
|
|
6660
|
+
return _optionalChain([value, 'optionalAccess', _78 => _78._error]);
|
|
6635
6661
|
}
|
|
6636
6662
|
var blockerId = 0;
|
|
6637
6663
|
function useBlocker(shouldBlock) {
|
|
@@ -6743,7 +6769,7 @@ function getKeyedLinksForMatches(matches, routeModules, manifest) {
|
|
|
6743
6769
|
let route = manifest.routes[match.route.id];
|
|
6744
6770
|
return [
|
|
6745
6771
|
route && route.css ? route.css.map((href) => ({ rel: "stylesheet", href })) : [],
|
|
6746
|
-
_optionalChain([module, 'optionalAccess',
|
|
6772
|
+
_optionalChain([module, 'optionalAccess', _79 => _79.links, 'optionalCall', _80 => _80()]) || []
|
|
6747
6773
|
];
|
|
6748
6774
|
}).flat(2);
|
|
6749
6775
|
let preloads = getModuleLinkHrefs(matches, manifest);
|
|
@@ -6844,7 +6870,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
|
|
|
6844
6870
|
// param change, /users/123 -> /users/456
|
|
6845
6871
|
currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path
|
|
6846
6872
|
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
6847
|
-
_optionalChain([currentMatches, 'access',
|
|
6873
|
+
_optionalChain([currentMatches, 'access', _81 => _81[index], 'access', _82 => _82.route, 'access', _83 => _83.path, 'optionalAccess', _84 => _84.endsWith, 'call', _85 => _85("*")]) && currentMatches[index].params["*"] !== match.params["*"]
|
|
6848
6874
|
);
|
|
6849
6875
|
};
|
|
6850
6876
|
if (mode === "assets") {
|
|
@@ -6867,7 +6893,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
|
|
|
6867
6893
|
location.pathname + location.search + location.hash,
|
|
6868
6894
|
window.origin
|
|
6869
6895
|
),
|
|
6870
|
-
currentParams: _optionalChain([currentMatches, 'access',
|
|
6896
|
+
currentParams: _optionalChain([currentMatches, 'access', _86 => _86[0], 'optionalAccess', _87 => _87.params]) || {},
|
|
6871
6897
|
nextUrl: new URL(page, window.origin),
|
|
6872
6898
|
nextParams: match.params,
|
|
6873
6899
|
defaultShouldRevalidate: true
|
|
@@ -7139,10 +7165,10 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7139
7165
|
)
|
|
7140
7166
|
});
|
|
7141
7167
|
let hasInitialData = initialState && initialState.loaderData && route.id in initialState.loaderData;
|
|
7142
|
-
let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess',
|
|
7168
|
+
let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess', _88 => _88.loaderData, 'optionalAccess', _89 => _89[route.id]]) : void 0;
|
|
7143
7169
|
let hasInitialError = initialState && initialState.errors && route.id in initialState.errors;
|
|
7144
|
-
let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess',
|
|
7145
|
-
let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access',
|
|
7170
|
+
let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess', _90 => _90.errors, 'optionalAccess', _91 => _91[route.id]]) : void 0;
|
|
7171
|
+
let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access', _92 => _92.clientLoader, 'optionalAccess', _93 => _93.hydrate]) === true || !route.hasLoader);
|
|
7146
7172
|
dataRoute.loader = async ({ request, params, context }, singleFetch) => {
|
|
7147
7173
|
try {
|
|
7148
7174
|
let result = await prefetchStylesAndCallHandler(async () => {
|
|
@@ -7436,7 +7462,7 @@ function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, routeDi
|
|
|
7436
7462
|
function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscovery, isSpaMode) {
|
|
7437
7463
|
React6.useEffect(() => {
|
|
7438
7464
|
if (!isFogOfWarEnabled(routeDiscovery, ssr) || // @ts-expect-error - TS doesn't know about this yet
|
|
7439
|
-
_optionalChain([window, 'access',
|
|
7465
|
+
_optionalChain([window, 'access', _94 => _94.navigator, 'optionalAccess', _95 => _95.connection, 'optionalAccess', _96 => _96.saveData]) === true) {
|
|
7440
7466
|
return;
|
|
7441
7467
|
}
|
|
7442
7468
|
function registerElement(el) {
|
|
@@ -7499,7 +7525,7 @@ function getManifestPath(_manifestPath, basename) {
|
|
|
7499
7525
|
var MANIFEST_VERSION_STORAGE_KEY = "react-router-manifest-version";
|
|
7500
7526
|
async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, routeModules, ssr, isSpaMode, basename, manifestPath, patchRoutes, signal) {
|
|
7501
7527
|
const searchParams = new URLSearchParams();
|
|
7502
|
-
paths.sort().
|
|
7528
|
+
searchParams.set("paths", paths.sort().join(","));
|
|
7503
7529
|
searchParams.set("version", manifest.version);
|
|
7504
7530
|
let url = new URL(
|
|
7505
7531
|
getManifestPath(manifestPath, basename),
|
|
@@ -7522,13 +7548,16 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
7522
7548
|
);
|
|
7523
7549
|
return;
|
|
7524
7550
|
}
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7551
|
+
try {
|
|
7552
|
+
if (sessionStorage.getItem(MANIFEST_VERSION_STORAGE_KEY) === manifest.version) {
|
|
7553
|
+
console.error(
|
|
7554
|
+
"Unable to discover routes due to manifest version mismatch."
|
|
7555
|
+
);
|
|
7556
|
+
return;
|
|
7557
|
+
}
|
|
7558
|
+
sessionStorage.setItem(MANIFEST_VERSION_STORAGE_KEY, manifest.version);
|
|
7559
|
+
} catch (e2) {
|
|
7530
7560
|
}
|
|
7531
|
-
sessionStorage.setItem(MANIFEST_VERSION_STORAGE_KEY, manifest.version);
|
|
7532
7561
|
window.location.href = errorReloadPath;
|
|
7533
7562
|
console.warn("Detected manifest version mismatch, reloading...");
|
|
7534
7563
|
await new Promise(() => {
|
|
@@ -7536,10 +7565,13 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
7536
7565
|
} else if (res.status >= 400) {
|
|
7537
7566
|
throw new Error(await res.text());
|
|
7538
7567
|
}
|
|
7539
|
-
|
|
7568
|
+
try {
|
|
7569
|
+
sessionStorage.removeItem(MANIFEST_VERSION_STORAGE_KEY);
|
|
7570
|
+
} catch (e3) {
|
|
7571
|
+
}
|
|
7540
7572
|
serverPatches = await res.json();
|
|
7541
7573
|
} catch (e) {
|
|
7542
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
7574
|
+
if (_optionalChain([signal, 'optionalAccess', _97 => _97.aborted])) return;
|
|
7543
7575
|
throw e;
|
|
7544
7576
|
}
|
|
7545
7577
|
let knownRoutes = new Set(Object.keys(manifest.routes));
|
|
@@ -7780,7 +7812,7 @@ function PrefetchPageLinksImpl({
|
|
|
7780
7812
|
if (!manifestRoute || !manifestRoute.hasLoader) {
|
|
7781
7813
|
return;
|
|
7782
7814
|
}
|
|
7783
|
-
if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access',
|
|
7815
|
+
if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access', _98 => _98[m.route.id], 'optionalAccess', _99 => _99.shouldRevalidate])) {
|
|
7784
7816
|
foundOptOutRoute = true;
|
|
7785
7817
|
} else if (manifestRoute.hasClientLoader) {
|
|
7786
7818
|
foundOptOutRoute = true;
|
|
@@ -7854,7 +7886,7 @@ function Meta() {
|
|
|
7854
7886
|
error
|
|
7855
7887
|
};
|
|
7856
7888
|
matches[i] = match;
|
|
7857
|
-
if (_optionalChain([routeModule, 'optionalAccess',
|
|
7889
|
+
if (_optionalChain([routeModule, 'optionalAccess', _100 => _100.meta])) {
|
|
7858
7890
|
routeMeta = typeof routeModule.meta === "function" ? routeModule.meta({
|
|
7859
7891
|
data: data2,
|
|
7860
7892
|
loaderData: data2,
|
|
@@ -7953,7 +7985,7 @@ function Scripts(scriptProps) {
|
|
|
7953
7985
|
}
|
|
7954
7986
|
let streamScript = "window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());";
|
|
7955
7987
|
let contextScript = staticContext ? `window.__reactRouterContext = ${serverHandoffString};${streamScript}` : " ";
|
|
7956
|
-
let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access',
|
|
7988
|
+
let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access', _101 => _101.hmr, 'optionalAccess', _102 => _102.runtime]) ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
|
|
7957
7989
|
${matches.map((match, routeIndex) => {
|
|
7958
7990
|
let routeVarName = `route${routeIndex}`;
|
|
7959
7991
|
let manifestEntry = manifest.routes[match.route.id];
|
|
@@ -8183,7 +8215,7 @@ function BoundaryShell({
|
|
|
8183
8215
|
children
|
|
8184
8216
|
}) {
|
|
8185
8217
|
let { routeModules } = useFrameworkContext();
|
|
8186
|
-
if (_optionalChain([routeModules, 'access',
|
|
8218
|
+
if (_optionalChain([routeModules, 'access', _103 => _103.root, 'optionalAccess', _104 => _104.Layout]) && !isOutsideRemixApp) {
|
|
8187
8219
|
return children;
|
|
8188
8220
|
}
|
|
8189
8221
|
return /* @__PURE__ */ React8.createElement("html", { lang: "en" }, /* @__PURE__ */ React8.createElement("head", null, /* @__PURE__ */ React8.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ React8.createElement(
|