react-router 7.9.3 → 7.9.4
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 +105 -0
- package/dist/development/{chunk-EUCGRVHH.js → chunk-72XNTZCV.js} +134 -134
- package/dist/development/{chunk-LZYTN6SO.js → chunk-DI2QHYMJ.js} +28 -14
- package/dist/development/{chunk-NISHYRIK.mjs → chunk-OIYGIGL5.mjs} +16 -2
- package/dist/development/{chunk-65XJMMLO.mjs → chunk-WY5IRSCW.mjs} +8 -4
- package/dist/{production/context-BqL5Eckq.d.mts → development/context-DSyS5mLj.d.mts} +1 -1
- 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/{production/index-react-server-client-2EDmGlsZ.d.mts → development/index-react-server-client-BIz4AUNd.d.mts} +2 -2
- package/dist/development/{index-react-server-client-DKvU8YRr.d.ts → index-react-server-client-BbRcBjrA.d.ts} +1 -1
- 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.js +1 -1
- package/dist/development/index-react-server.mjs +1 -1
- package/dist/development/index.d.mts +16 -9
- package/dist/development/index.d.ts +14 -7
- package/dist/development/index.js +105 -99
- package/dist/development/index.mjs +5 -3
- package/dist/development/lib/types/internal.d.mts +3 -3
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/{production/register-DiOIlEq5.d.mts → development/register-C34pU-in.d.ts} +7 -1
- package/dist/development/{register-DiOIlEq5.d.mts → register-CI4bTprK.d.mts} +7 -1
- package/dist/development/{route-data-CDwqkzPE.d.mts → route-data-DZQOUSqV.d.mts} +1 -1
- package/dist/development/{routeModules-BmVo7q9e.d.ts → routeModules-D5iJ6JYT.d.ts} +1 -1
- package/dist/production/{chunk-VAVG4EWR.mjs → chunk-3TADTUL4.mjs} +16 -2
- package/dist/production/{chunk-GWORLVRM.js → chunk-4E5LHRQP.js} +28 -14
- package/dist/production/{chunk-LI6FX3G6.mjs → chunk-FR6HSPLK.mjs} +8 -4
- package/dist/production/{chunk-LHDU32KO.js → chunk-WNLQ53P5.js} +134 -134
- package/dist/{development/context-BqL5Eckq.d.mts → production/context-DSyS5mLj.d.mts} +1 -1
- 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/{development/index-react-server-client-2EDmGlsZ.d.mts → production/index-react-server-client-BIz4AUNd.d.mts} +2 -2
- package/dist/production/{index-react-server-client-DKvU8YRr.d.ts → index-react-server-client-BbRcBjrA.d.ts} +1 -1
- 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.js +1 -1
- package/dist/production/index-react-server.mjs +1 -1
- package/dist/production/index.d.mts +16 -9
- package/dist/production/index.d.ts +14 -7
- package/dist/production/index.js +105 -99
- package/dist/production/index.mjs +5 -3
- package/dist/production/lib/types/internal.d.mts +3 -3
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{register-DiOIlEq5.d.ts → register-C34pU-in.d.ts} +7 -1
- package/dist/{development/register-DiOIlEq5.d.ts → production/register-CI4bTprK.d.mts} +7 -1
- package/dist/production/{route-data-CDwqkzPE.d.mts → route-data-DZQOUSqV.d.mts} +1 -1
- package/dist/production/{routeModules-BmVo7q9e.d.ts → routeModules-D5iJ6JYT.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.4
|
|
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-WY5IRSCW.mjs";
|
|
35
35
|
import {
|
|
36
36
|
Action,
|
|
37
37
|
Await,
|
|
@@ -131,6 +131,7 @@ import {
|
|
|
131
131
|
usePrompt,
|
|
132
132
|
useResolvedPath,
|
|
133
133
|
useRevalidator,
|
|
134
|
+
useRoute,
|
|
134
135
|
useRouteError,
|
|
135
136
|
useRouteLoaderData,
|
|
136
137
|
useRoutes,
|
|
@@ -141,7 +142,7 @@ import {
|
|
|
141
142
|
withComponentProps,
|
|
142
143
|
withErrorBoundaryProps,
|
|
143
144
|
withHydrateFallbackProps
|
|
144
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-OIYGIGL5.mjs";
|
|
145
146
|
export {
|
|
146
147
|
Await,
|
|
147
148
|
BrowserRouter,
|
|
@@ -243,6 +244,7 @@ export {
|
|
|
243
244
|
routeRSCServerRequest as unstable_routeRSCServerRequest,
|
|
244
245
|
setDevServerHooks as unstable_setDevServerHooks,
|
|
245
246
|
usePrompt as unstable_usePrompt,
|
|
247
|
+
useRoute as unstable_useRoute,
|
|
246
248
|
useActionData,
|
|
247
249
|
useAsyncError,
|
|
248
250
|
useAsyncValue,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { R as RouteModule, L as LinkDescriptor, F as Func, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, C as ClientDataFunctionArgs, a as ServerDataFrom, N as Normalize, b as GetActionData } from '../../route-data-
|
|
2
|
-
import { L as Location, M as MiddlewareNextFunction, D as DataStrategyResult } from '../../context-
|
|
3
|
-
import { R as RouteFiles, P as Pages } from '../../register-
|
|
1
|
+
import { R as RouteModule, L as LinkDescriptor, F as Func, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, C as ClientDataFunctionArgs, a as ServerDataFrom, N as Normalize, b as GetActionData } from '../../route-data-DZQOUSqV.mjs';
|
|
2
|
+
import { L as Location, M as MiddlewareNextFunction, D as DataStrategyResult } from '../../context-DSyS5mLj.mjs';
|
|
3
|
+
import { R as RouteFiles, P as Pages } from '../../register-CI4bTprK.mjs';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
6
6
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteModule, L as LinkDescriptor, a as Location, F as Func, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, b as MiddlewareNextFunction, C as ClientDataFunctionArgs, D as DataStrategyResult, c as ServerDataFrom, N as Normalize, d as GetActionData } from '../../routeModules-
|
|
2
|
-
import { R as RouteFiles, P as Pages } from '../../register-
|
|
1
|
+
import { R as RouteModule, L as LinkDescriptor, a as Location, F as Func, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, b as MiddlewareNextFunction, C as ClientDataFunctionArgs, D as DataStrategyResult, c as ServerDataFrom, N as Normalize, d as GetActionData } from '../../routeModules-D5iJ6JYT.js';
|
|
2
|
+
import { R as RouteFiles, P as Pages } from '../../register-C34pU-in.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { R as RouteModule } from './routeModules-D5iJ6JYT.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
|
|
3
5
|
* React Router should handle this for you via type generation.
|
|
@@ -20,5 +22,9 @@ type AnyRouteFiles = Record<string, {
|
|
|
20
22
|
type RouteFiles = Register extends {
|
|
21
23
|
routeFiles: infer Registered extends AnyRouteFiles;
|
|
22
24
|
} ? Registered : AnyRouteFiles;
|
|
25
|
+
type AnyRouteModules = Record<string, RouteModule>;
|
|
26
|
+
type RouteModules = Register extends {
|
|
27
|
+
routeModules: infer Registered extends AnyRouteModules;
|
|
28
|
+
} ? Registered : AnyRouteModules;
|
|
23
29
|
|
|
24
|
-
export type { Pages as P, RouteFiles as R,
|
|
30
|
+
export type { Pages as P, RouteFiles as R, RouteModules as a, Register as b };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { R as RouteModule } from './route-data-DZQOUSqV.mjs';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
|
|
3
5
|
* React Router should handle this for you via type generation.
|
|
@@ -20,5 +22,9 @@ type AnyRouteFiles = Record<string, {
|
|
|
20
22
|
type RouteFiles = Register extends {
|
|
21
23
|
routeFiles: infer Registered extends AnyRouteFiles;
|
|
22
24
|
} ? Registered : AnyRouteFiles;
|
|
25
|
+
type AnyRouteModules = Record<string, RouteModule>;
|
|
26
|
+
type RouteModules = Register extends {
|
|
27
|
+
routeModules: infer Registered extends AnyRouteModules;
|
|
28
|
+
} ? Registered : AnyRouteModules;
|
|
23
29
|
|
|
24
|
-
export type { Pages as P, RouteFiles as R,
|
|
30
|
+
export type { Pages as P, RouteFiles as R, RouteModules as a, Register as b };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, ReactElement } from 'react';
|
|
2
|
-
import { A as ActionFunctionArgs, b as LoaderFunctionArgs, c as ActionFunction, d as LoaderFunction, P as Params, L as Location, e as DataRouteMatch, f as MiddlewareFunction, D as DataStrategyResult, S as ShouldRevalidateFunction, g as RouterContextProvider, h as DataWithResponseInit, i as MiddlewareEnabled } from './context-
|
|
2
|
+
import { A as ActionFunctionArgs, b as LoaderFunctionArgs, c as ActionFunction, d as LoaderFunction, P as Params, L as Location, e as DataRouteMatch, f as MiddlewareFunction, D as DataStrategyResult, S as ShouldRevalidateFunction, g as RouterContextProvider, h as DataWithResponseInit, i as MiddlewareEnabled } from './context-DSyS5mLj.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* An object of unknown type for route loaders and actions provided by the
|
|
@@ -2179,7 +2179,7 @@ interface RoutesProps {
|
|
|
2179
2179
|
* <Routes>
|
|
2180
2180
|
* <Route index element={<StepOne />} />
|
|
2181
2181
|
* <Route path="step-2" element={<StepTwo />} />
|
|
2182
|
-
* <Route path="step-3" element={<StepThree />}
|
|
2182
|
+
* <Route path="step-3" element={<StepThree />} />
|
|
2183
2183
|
* </Routes>
|
|
2184
2184
|
*
|
|
2185
2185
|
* @public
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.4
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -5552,6 +5552,19 @@ function warningOnce(key, cond, message) {
|
|
|
5552
5552
|
warning(false, message);
|
|
5553
5553
|
}
|
|
5554
5554
|
}
|
|
5555
|
+
function useRoute(...args) {
|
|
5556
|
+
const currentRouteId = useCurrentRouteId(
|
|
5557
|
+
"useRoute" /* UseRoute */
|
|
5558
|
+
);
|
|
5559
|
+
const id = args[0] ?? currentRouteId;
|
|
5560
|
+
const state = useDataRouterState("useRouteLoaderData" /* UseRouteLoaderData */);
|
|
5561
|
+
const route = state.matches.find(({ route: route2 }) => route2.id === id);
|
|
5562
|
+
if (route === void 0) return void 0;
|
|
5563
|
+
return {
|
|
5564
|
+
loaderData: state.loaderData[id],
|
|
5565
|
+
actionData: state.actionData?.[id]
|
|
5566
|
+
};
|
|
5567
|
+
}
|
|
5555
5568
|
|
|
5556
5569
|
// lib/components.tsx
|
|
5557
5570
|
import * as React3 from "react";
|
|
@@ -9113,7 +9126,7 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
9113
9126
|
try {
|
|
9114
9127
|
if (isBrowser) {
|
|
9115
9128
|
window.__reactRouterVersion = // @ts-expect-error
|
|
9116
|
-
"7.9.
|
|
9129
|
+
"7.9.4";
|
|
9117
9130
|
}
|
|
9118
9131
|
} catch (e) {
|
|
9119
9132
|
}
|
|
@@ -10271,6 +10284,7 @@ export {
|
|
|
10271
10284
|
useAsyncValue,
|
|
10272
10285
|
useAsyncError,
|
|
10273
10286
|
useBlocker,
|
|
10287
|
+
useRoute,
|
|
10274
10288
|
warnOnce,
|
|
10275
10289
|
mapRouteProperties,
|
|
10276
10290
|
hydrationRouteProperties,
|
|
@@ -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.4
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -6730,6 +6730,19 @@ function warningOnce(key, cond, message) {
|
|
|
6730
6730
|
warning(false, message);
|
|
6731
6731
|
}
|
|
6732
6732
|
}
|
|
6733
|
+
function useRoute(...args) {
|
|
6734
|
+
const currentRouteId = useCurrentRouteId(
|
|
6735
|
+
"useRoute" /* UseRoute */
|
|
6736
|
+
);
|
|
6737
|
+
const id = _nullishCoalesce(args[0], () => ( currentRouteId));
|
|
6738
|
+
const state = useDataRouterState("useRouteLoaderData" /* UseRouteLoaderData */);
|
|
6739
|
+
const route = state.matches.find(({ route: route2 }) => route2.id === id);
|
|
6740
|
+
if (route === void 0) return void 0;
|
|
6741
|
+
return {
|
|
6742
|
+
loaderData: state.loaderData[id],
|
|
6743
|
+
actionData: _optionalChain([state, 'access', _79 => _79.actionData, 'optionalAccess', _80 => _80[id]])
|
|
6744
|
+
};
|
|
6745
|
+
}
|
|
6733
6746
|
|
|
6734
6747
|
// lib/dom/ssr/errorBoundaries.tsx
|
|
6735
6748
|
|
|
@@ -6772,7 +6785,7 @@ function getKeyedLinksForMatches(matches, routeModules, manifest) {
|
|
|
6772
6785
|
let route = manifest.routes[match.route.id];
|
|
6773
6786
|
return [
|
|
6774
6787
|
route && route.css ? route.css.map((href) => ({ rel: "stylesheet", href })) : [],
|
|
6775
|
-
_optionalChain([module, 'optionalAccess',
|
|
6788
|
+
_optionalChain([module, 'optionalAccess', _81 => _81.links, 'optionalCall', _82 => _82()]) || []
|
|
6776
6789
|
];
|
|
6777
6790
|
}).flat(2);
|
|
6778
6791
|
let preloads = getModuleLinkHrefs(matches, manifest);
|
|
@@ -6873,7 +6886,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
|
|
|
6873
6886
|
// param change, /users/123 -> /users/456
|
|
6874
6887
|
currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path
|
|
6875
6888
|
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
6876
|
-
_optionalChain([currentMatches, 'access',
|
|
6889
|
+
_optionalChain([currentMatches, 'access', _83 => _83[index], 'access', _84 => _84.route, 'access', _85 => _85.path, 'optionalAccess', _86 => _86.endsWith, 'call', _87 => _87("*")]) && currentMatches[index].params["*"] !== match.params["*"]
|
|
6877
6890
|
);
|
|
6878
6891
|
};
|
|
6879
6892
|
if (mode === "assets") {
|
|
@@ -6896,7 +6909,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
|
|
|
6896
6909
|
location.pathname + location.search + location.hash,
|
|
6897
6910
|
window.origin
|
|
6898
6911
|
),
|
|
6899
|
-
currentParams: _optionalChain([currentMatches, 'access',
|
|
6912
|
+
currentParams: _optionalChain([currentMatches, 'access', _88 => _88[0], 'optionalAccess', _89 => _89.params]) || {},
|
|
6900
6913
|
nextUrl: new URL(page, window.origin),
|
|
6901
6914
|
nextParams: match.params,
|
|
6902
6915
|
defaultShouldRevalidate: true
|
|
@@ -7168,10 +7181,10 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7168
7181
|
)
|
|
7169
7182
|
});
|
|
7170
7183
|
let hasInitialData = initialState && initialState.loaderData && route.id in initialState.loaderData;
|
|
7171
|
-
let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess',
|
|
7184
|
+
let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess', _90 => _90.loaderData, 'optionalAccess', _91 => _91[route.id]]) : void 0;
|
|
7172
7185
|
let hasInitialError = initialState && initialState.errors && route.id in initialState.errors;
|
|
7173
|
-
let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess',
|
|
7174
|
-
let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access',
|
|
7186
|
+
let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess', _92 => _92.errors, 'optionalAccess', _93 => _93[route.id]]) : void 0;
|
|
7187
|
+
let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access', _94 => _94.clientLoader, 'optionalAccess', _95 => _95.hydrate]) === true || !route.hasLoader);
|
|
7175
7188
|
dataRoute.loader = async ({ request, params, context }, singleFetch) => {
|
|
7176
7189
|
try {
|
|
7177
7190
|
let result = await prefetchStylesAndCallHandler(async () => {
|
|
@@ -7465,7 +7478,7 @@ function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, routeDi
|
|
|
7465
7478
|
function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscovery, isSpaMode) {
|
|
7466
7479
|
React6.useEffect(() => {
|
|
7467
7480
|
if (!isFogOfWarEnabled(routeDiscovery, ssr) || // @ts-expect-error - TS doesn't know about this yet
|
|
7468
|
-
_optionalChain([window, 'access',
|
|
7481
|
+
_optionalChain([window, 'access', _96 => _96.navigator, 'optionalAccess', _97 => _97.connection, 'optionalAccess', _98 => _98.saveData]) === true) {
|
|
7469
7482
|
return;
|
|
7470
7483
|
}
|
|
7471
7484
|
function registerElement(el) {
|
|
@@ -7574,7 +7587,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
7574
7587
|
}
|
|
7575
7588
|
serverPatches = await res.json();
|
|
7576
7589
|
} catch (e) {
|
|
7577
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
7590
|
+
if (_optionalChain([signal, 'optionalAccess', _99 => _99.aborted])) return;
|
|
7578
7591
|
throw e;
|
|
7579
7592
|
}
|
|
7580
7593
|
let knownRoutes = new Set(Object.keys(manifest.routes));
|
|
@@ -7815,7 +7828,7 @@ function PrefetchPageLinksImpl({
|
|
|
7815
7828
|
if (!manifestRoute || !manifestRoute.hasLoader) {
|
|
7816
7829
|
return;
|
|
7817
7830
|
}
|
|
7818
|
-
if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access',
|
|
7831
|
+
if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access', _100 => _100[m.route.id], 'optionalAccess', _101 => _101.shouldRevalidate])) {
|
|
7819
7832
|
foundOptOutRoute = true;
|
|
7820
7833
|
} else if (manifestRoute.hasClientLoader) {
|
|
7821
7834
|
foundOptOutRoute = true;
|
|
@@ -7889,7 +7902,7 @@ function Meta() {
|
|
|
7889
7902
|
error
|
|
7890
7903
|
};
|
|
7891
7904
|
matches[i] = match;
|
|
7892
|
-
if (_optionalChain([routeModule, 'optionalAccess',
|
|
7905
|
+
if (_optionalChain([routeModule, 'optionalAccess', _102 => _102.meta])) {
|
|
7893
7906
|
routeMeta = typeof routeModule.meta === "function" ? routeModule.meta({
|
|
7894
7907
|
data: data2,
|
|
7895
7908
|
loaderData: data2,
|
|
@@ -7988,7 +8001,7 @@ function Scripts(scriptProps) {
|
|
|
7988
8001
|
}
|
|
7989
8002
|
let streamScript = "window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());";
|
|
7990
8003
|
let contextScript = staticContext ? `window.__reactRouterContext = ${serverHandoffString};${streamScript}` : " ";
|
|
7991
|
-
let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access',
|
|
8004
|
+
let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access', _103 => _103.hmr, 'optionalAccess', _104 => _104.runtime]) ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
|
|
7992
8005
|
${matches.map((match, routeIndex) => {
|
|
7993
8006
|
let routeVarName = `route${routeIndex}`;
|
|
7994
8007
|
let manifestEntry = manifest.routes[match.route.id];
|
|
@@ -8218,7 +8231,7 @@ function BoundaryShell({
|
|
|
8218
8231
|
children
|
|
8219
8232
|
}) {
|
|
8220
8233
|
let { routeModules } = useFrameworkContext();
|
|
8221
|
-
if (_optionalChain([routeModules, 'access',
|
|
8234
|
+
if (_optionalChain([routeModules, 'access', _105 => _105.root, 'optionalAccess', _106 => _106.Layout]) && !isOutsideRemixApp) {
|
|
8222
8235
|
return children;
|
|
8223
8236
|
}
|
|
8224
8237
|
return /* @__PURE__ */ React8.createElement("html", { lang: "en" }, /* @__PURE__ */ React8.createElement("head", null, /* @__PURE__ */ React8.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ React8.createElement(
|
|
@@ -8333,4 +8346,5 @@ function BoundaryShell({
|
|
|
8333
8346
|
|
|
8334
8347
|
|
|
8335
8348
|
|
|
8336
|
-
|
|
8349
|
+
|
|
8350
|
+
exports.Action = Action; exports.createMemoryHistory = createMemoryHistory; exports.createBrowserHistory = createBrowserHistory; exports.createHashHistory = createHashHistory; exports.invariant = invariant; exports.warning = warning; exports.createPath = createPath; exports.parsePath = parsePath; exports.createContext = createContext; exports.RouterContextProvider = RouterContextProvider; exports.convertRoutesToDataRoutes = convertRoutesToDataRoutes; exports.matchRoutes = matchRoutes; exports.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.escapeHtml = escapeHtml; 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.AwaitContextProvider = AwaitContextProvider; 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.useRoute = useRoute; 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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.4
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
withComponentProps,
|
|
61
61
|
withErrorBoundaryProps,
|
|
62
62
|
withHydrateFallbackProps
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-3TADTUL4.mjs";
|
|
64
64
|
|
|
65
65
|
// lib/dom/ssr/server.tsx
|
|
66
66
|
import * as React from "react";
|
|
@@ -1873,7 +1873,7 @@ function createCallServer({
|
|
|
1873
1873
|
globalVar.__reactRouterDataRouter.__setPendingRerender(
|
|
1874
1874
|
Promise.resolve(payloadPromise).then(async (payload) => {
|
|
1875
1875
|
if (payload.type === "redirect") {
|
|
1876
|
-
if (payload.reload) {
|
|
1876
|
+
if (payload.reload || isExternalLocation(payload.location)) {
|
|
1877
1877
|
window.location.href = payload.location;
|
|
1878
1878
|
return () => {
|
|
1879
1879
|
};
|
|
@@ -1890,7 +1890,7 @@ function createCallServer({
|
|
|
1890
1890
|
const rerender = await payload.rerender;
|
|
1891
1891
|
if (rerender && landedActionId < actionId && globalVar.__routerActionID <= actionId) {
|
|
1892
1892
|
if (rerender.type === "redirect") {
|
|
1893
|
-
if (rerender.reload) {
|
|
1893
|
+
if (rerender.reload || isExternalLocation(rerender.location)) {
|
|
1894
1894
|
window.location.href = rerender.location;
|
|
1895
1895
|
return;
|
|
1896
1896
|
}
|
|
@@ -2460,6 +2460,10 @@ function debounce(callback, wait) {
|
|
|
2460
2460
|
timeoutId = window.setTimeout(() => callback(...args), wait);
|
|
2461
2461
|
};
|
|
2462
2462
|
}
|
|
2463
|
+
function isExternalLocation(location2) {
|
|
2464
|
+
const newLocation = new URL(location2, window.location.href);
|
|
2465
|
+
return newLocation.origin !== window.location.origin;
|
|
2466
|
+
}
|
|
2463
2467
|
|
|
2464
2468
|
// lib/rsc/server.ssr.tsx
|
|
2465
2469
|
import * as React5 from "react";
|