react-router 7.9.6-pre.0 → 7.9.6-pre.1
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 +6 -0
- package/dist/development/{chunk-TUTX3ERH.js → chunk-CYHICRRW.js} +25 -4
- package/dist/development/{chunk-7TW6LJC6.mjs → chunk-DKSAHU2I.mjs} +26 -5
- package/dist/{production/chunk-ZHTTD7UY.js → development/chunk-HSVNPM3C.js} +93 -93
- package/dist/{production/chunk-MKF3AQDO.js → development/chunk-OLIKX45O.js} +7 -7
- package/dist/{production/chunk-4MBU4DF6.mjs → development/chunk-RGKEVI2W.mjs} +2 -2
- package/dist/development/dom-export.js +26 -26
- 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 +25 -4
- package/dist/development/index-react-server.mjs +25 -4
- package/dist/development/index.js +76 -76
- 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-RBZEEJIK.js → chunk-2DNJUQK6.js} +25 -4
- package/dist/{development/chunk-IR7LYQCC.js → production/chunk-EDK3MRM6.js} +93 -93
- package/dist/{development/chunk-DB25NZIA.js → production/chunk-JLDESRHY.js} +7 -7
- package/dist/{development/chunk-P6ZEAD4C.mjs → production/chunk-LC2OWLJG.mjs} +2 -2
- package/dist/production/{chunk-GG2LAVOQ.mjs → chunk-LESYMMDQ.mjs} +26 -5
- package/dist/production/dom-export.js +26 -26
- 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 +25 -4
- package/dist/production/index-react-server.mjs +25 -4
- package/dist/production/index.js +76 -76
- 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
|
"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.6-pre.
|
|
2
|
+
* react-router v7.9.6-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkOLIKX45Ojs = require('./chunk-OLIKX45O.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -32,7 +32,7 @@ var _chunkDB25NZIAjs = require('./chunk-DB25NZIA.js');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkCYHICRRWjs = require('./chunk-CYHICRRW.js');
|
|
36
36
|
|
|
37
37
|
// lib/dom-export/dom-router-provider.tsx
|
|
38
38
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
@@ -204,7 +204,7 @@ function HydratedRouter(props) {
|
|
|
204
204
|
}, []);
|
|
205
205
|
React2.useEffect(() => {
|
|
206
206
|
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
|
207
|
-
document.querySelectorAll(`[${
|
|
207
|
+
document.querySelectorAll(`[${_chunkCYHICRRWjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
|
208
208
|
}
|
|
209
209
|
}, [criticalCss]);
|
|
210
210
|
let [location2, setLocation] = React2.useState(router.state.location);
|
|
@@ -373,10 +373,10 @@ function createRouterFromPayload({
|
|
|
373
373
|
};
|
|
374
374
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
375
375
|
globalVar.__reactRouterRouteModules = _nullishCoalesce(globalVar.__reactRouterRouteModules, () => ( {}));
|
|
376
|
-
|
|
376
|
+
_chunkOLIKX45Ojs.populateRSCRouteModules.call(void 0, globalVar.__reactRouterRouteModules, payload.matches);
|
|
377
377
|
let patches = /* @__PURE__ */ new Map();
|
|
378
378
|
_optionalChain([payload, 'access', _22 => _22.patches, 'optionalAccess', _23 => _23.forEach, 'call', _24 => _24((patch) => {
|
|
379
|
-
|
|
379
|
+
_chunkCYHICRRWjs.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
|
|
380
380
|
if (!patches.has(patch.parentId)) {
|
|
381
381
|
patches.set(patch.parentId, []);
|
|
382
382
|
}
|
|
@@ -398,12 +398,12 @@ function createRouterFromPayload({
|
|
|
398
398
|
}
|
|
399
399
|
return [route];
|
|
400
400
|
}, []);
|
|
401
|
-
globalVar.__reactRouterDataRouter =
|
|
401
|
+
globalVar.__reactRouterDataRouter = _chunkCYHICRRWjs.createRouter.call(void 0, {
|
|
402
402
|
routes,
|
|
403
403
|
getContext,
|
|
404
404
|
basename: payload.basename,
|
|
405
|
-
history:
|
|
406
|
-
hydrationData:
|
|
405
|
+
history: _chunkCYHICRRWjs.createBrowserHistory.call(void 0, ),
|
|
406
|
+
hydrationData: _chunkOLIKX45Ojs.getHydrationData.call(void 0, {
|
|
407
407
|
state: {
|
|
408
408
|
loaderData: payload.loaderData,
|
|
409
409
|
actionData: payload.actionData,
|
|
@@ -412,7 +412,7 @@ function createRouterFromPayload({
|
|
|
412
412
|
routes,
|
|
413
413
|
getRouteInfo: (routeId) => {
|
|
414
414
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
415
|
-
|
|
415
|
+
_chunkCYHICRRWjs.invariant.call(void 0, match, "Route not found in payload");
|
|
416
416
|
return {
|
|
417
417
|
clientLoader: match.clientLoader,
|
|
418
418
|
hasLoader: match.hasLoader,
|
|
@@ -510,9 +510,9 @@ function createRouterFromPayload({
|
|
|
510
510
|
routeModules: globalVar.__reactRouterRouteModules
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
var renderedRoutesContext =
|
|
513
|
+
var renderedRoutesContext = _chunkCYHICRRWjs.createContext.call(void 0, );
|
|
514
514
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
515
|
-
let dataStrategy =
|
|
515
|
+
let dataStrategy = _chunkCYHICRRWjs.getSingleFetchDataStrategyImpl.call(void 0,
|
|
516
516
|
getRouter,
|
|
517
517
|
(match) => {
|
|
518
518
|
let M = match;
|
|
@@ -566,20 +566,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
566
566
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
567
567
|
return async (args, basename, targetRoutes) => {
|
|
568
568
|
let { request, context } = args;
|
|
569
|
-
let url =
|
|
569
|
+
let url = _chunkCYHICRRWjs.singleFetchUrl.call(void 0, request.url, basename, "rsc");
|
|
570
570
|
if (request.method === "GET") {
|
|
571
|
-
url =
|
|
571
|
+
url = _chunkCYHICRRWjs.stripIndexParam.call(void 0, url);
|
|
572
572
|
if (targetRoutes) {
|
|
573
573
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
let res = await fetchImplementation(
|
|
577
|
-
new Request(url, await
|
|
577
|
+
new Request(url, await _chunkCYHICRRWjs.createRequestInit.call(void 0, request))
|
|
578
578
|
);
|
|
579
579
|
if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
|
|
580
|
-
throw new (0,
|
|
580
|
+
throw new (0, _chunkCYHICRRWjs.ErrorResponseImpl)(res.status, res.statusText, await res.text());
|
|
581
581
|
}
|
|
582
|
-
|
|
582
|
+
_chunkCYHICRRWjs.invariant.call(void 0, res.body, "No response body to decode");
|
|
583
583
|
try {
|
|
584
584
|
const payload = await createFromReadableStream(res.body, {
|
|
585
585
|
temporaryReferences: void 0
|
|
@@ -603,7 +603,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
603
603
|
}
|
|
604
604
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
605
605
|
let results = { routes: {} };
|
|
606
|
-
const dataKey =
|
|
606
|
+
const dataKey = _chunkCYHICRRWjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
607
607
|
for (let [routeId, data] of Object.entries(payload[dataKey] || {})) {
|
|
608
608
|
results.routes[routeId] = { data };
|
|
609
609
|
}
|
|
@@ -636,7 +636,7 @@ function RSCHydratedRouter({
|
|
|
636
636
|
[createFromReadableStream, payload, fetchImplementation, getContext]
|
|
637
637
|
);
|
|
638
638
|
React3.useEffect(() => {
|
|
639
|
-
|
|
639
|
+
_chunkCYHICRRWjs.setIsHydrated.call(void 0, );
|
|
640
640
|
}, []);
|
|
641
641
|
React3.useLayoutEffect(() => {
|
|
642
642
|
const globalVar = window;
|
|
@@ -723,7 +723,7 @@ function RSCHydratedRouter({
|
|
|
723
723
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
724
724
|
routeModules
|
|
725
725
|
};
|
|
726
|
-
return /* @__PURE__ */ React3.createElement(
|
|
726
|
+
return /* @__PURE__ */ React3.createElement(_chunkCYHICRRWjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkOLIKX45Ojs.RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React3.createElement(_chunkCYHICRRWjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(_chunkCYHICRRWjs.UNSTABLE_TransitionEnabledRouterProvider, { router: router2, flushSync: ReactDOM2.flushSync }))));
|
|
727
727
|
}
|
|
728
728
|
function createRouteFromServerManifest(match, payload) {
|
|
729
729
|
let hasInitialData = payload && match.id in payload.loaderData;
|
|
@@ -734,8 +734,8 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
734
734
|
// the server loader flow regardless of whether the client loader calls
|
|
735
735
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
736
736
|
match.hasComponent && !match.element;
|
|
737
|
-
|
|
738
|
-
|
|
737
|
+
_chunkCYHICRRWjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
738
|
+
_chunkOLIKX45Ojs.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
|
|
739
739
|
let dataRoute = {
|
|
740
740
|
id: match.id,
|
|
741
741
|
element: match.element,
|
|
@@ -785,7 +785,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
785
785
|
return await callSingleFetch(singleFetch);
|
|
786
786
|
}
|
|
787
787
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
788
|
-
throw
|
|
788
|
+
throw _chunkCYHICRRWjs.noActionDefinedError.call(void 0, "action", match.id);
|
|
789
789
|
},
|
|
790
790
|
path: match.path,
|
|
791
791
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -798,7 +798,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
798
798
|
hasShouldRevalidate: match.shouldRevalidate != null
|
|
799
799
|
};
|
|
800
800
|
if (typeof dataRoute.loader === "function") {
|
|
801
|
-
dataRoute.loader.hydrate =
|
|
801
|
+
dataRoute.loader.hydrate = _chunkCYHICRRWjs.shouldHydrateRouteLoader.call(void 0,
|
|
802
802
|
match.id,
|
|
803
803
|
match.clientLoader,
|
|
804
804
|
match.hasLoader,
|
|
@@ -808,7 +808,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
808
808
|
return dataRoute;
|
|
809
809
|
}
|
|
810
810
|
function callSingleFetch(singleFetch) {
|
|
811
|
-
|
|
811
|
+
_chunkCYHICRRWjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
812
812
|
return singleFetch();
|
|
813
813
|
}
|
|
814
814
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -816,7 +816,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
816
816
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
817
817
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
818
818
|
console.error(msg);
|
|
819
|
-
throw new (0,
|
|
819
|
+
throw new (0, _chunkCYHICRRWjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
822
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.6-pre.
|
|
2
|
+
* react-router v7.9.6-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
deserializeErrors,
|
|
15
15
|
getHydrationData,
|
|
16
16
|
populateRSCRouteModules
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RGKEVI2W.mjs";
|
|
18
18
|
import {
|
|
19
19
|
CRITICAL_CSS_DATA_ATTRIBUTE,
|
|
20
20
|
ErrorResponseImpl,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
singleFetchUrl,
|
|
44
44
|
stripIndexParam,
|
|
45
45
|
useFogOFWarDiscovery
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-DKSAHU2I.mjs";
|
|
47
47
|
|
|
48
48
|
// lib/dom-export/dom-router-provider.tsx
|
|
49
49
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
-
* react-router v7.9.6-pre.
|
|
2
|
+
* react-router v7.9.6-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkHSVNPM3Cjs = require('./chunk-HSVNPM3C.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -34,7 +34,7 @@ var _chunkIR7LYQCCjs = require('./chunk-IR7LYQCC.js');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkCYHICRRWjs = require('./chunk-CYHICRRW.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunkTUTX3ERHjs = require('./chunk-TUTX3ERH.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.BrowserRouter =
|
|
61
|
+
exports.BrowserRouter = _chunkHSVNPM3Cjs.BrowserRouter; exports.Form = _chunkHSVNPM3Cjs.Form; exports.HashRouter = _chunkHSVNPM3Cjs.HashRouter; exports.Link = _chunkHSVNPM3Cjs.Link; exports.Links = _chunkCYHICRRWjs.Links; exports.MemoryRouter = _chunkCYHICRRWjs.MemoryRouter; exports.Meta = _chunkCYHICRRWjs.Meta; exports.NavLink = _chunkHSVNPM3Cjs.NavLink; exports.Navigate = _chunkCYHICRRWjs.Navigate; exports.Outlet = _chunkCYHICRRWjs.Outlet; exports.Route = _chunkCYHICRRWjs.Route; exports.Router = _chunkCYHICRRWjs.Router; exports.RouterProvider = _chunkCYHICRRWjs.RouterProvider; exports.Routes = _chunkCYHICRRWjs.Routes; exports.ScrollRestoration = _chunkHSVNPM3Cjs.ScrollRestoration; exports.StaticRouter = _chunkHSVNPM3Cjs.StaticRouter; exports.StaticRouterProvider = _chunkHSVNPM3Cjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkCYHICRRWjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunkCYHICRRWjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkCYHICRRWjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkCYHICRRWjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkHSVNPM3Cjs.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.6-pre.
|
|
2
|
+
* react-router v7.9.6-pre.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
WithComponentProps,
|
|
33
33
|
WithErrorBoundaryProps,
|
|
34
34
|
WithHydrateFallbackProps
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-DKSAHU2I.mjs";
|
|
36
36
|
export {
|
|
37
37
|
BrowserRouter,
|
|
38
38
|
Form,
|
|
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
|
|
|
27
27
|
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* react-router v7.9.6-pre.
|
|
30
|
+
* react-router v7.9.6-pre.1
|
|
31
31
|
*
|
|
32
32
|
* Copyright (c) Remix Software Inc.
|
|
33
33
|
*
|
|
@@ -707,13 +707,36 @@ function prependBasename({
|
|
|
707
707
|
}) {
|
|
708
708
|
return pathname === "/" ? basename : joinPaths([basename, pathname]);
|
|
709
709
|
}
|
|
710
|
+
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
711
|
+
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
|
|
710
712
|
function resolvePath(to, fromPathname = "/") {
|
|
711
713
|
let {
|
|
712
714
|
pathname: toPathname,
|
|
713
715
|
search = "",
|
|
714
716
|
hash = ""
|
|
715
717
|
} = typeof to === "string" ? parsePath(to) : to;
|
|
716
|
-
let pathname
|
|
718
|
+
let pathname;
|
|
719
|
+
if (toPathname) {
|
|
720
|
+
if (isAbsoluteUrl(toPathname)) {
|
|
721
|
+
pathname = toPathname;
|
|
722
|
+
} else {
|
|
723
|
+
if (toPathname.includes("//")) {
|
|
724
|
+
let oldPathname = toPathname;
|
|
725
|
+
toPathname = toPathname.replace(/\/\/+/g, "/");
|
|
726
|
+
warning(
|
|
727
|
+
false,
|
|
728
|
+
`Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}`
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
if (toPathname.startsWith("/")) {
|
|
732
|
+
pathname = resolvePathname(toPathname.substring(1), "/");
|
|
733
|
+
} else {
|
|
734
|
+
pathname = resolvePathname(toPathname, fromPathname);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
} else {
|
|
738
|
+
pathname = fromPathname;
|
|
739
|
+
}
|
|
717
740
|
return {
|
|
718
741
|
pathname,
|
|
719
742
|
search: normalizeSearch(search),
|
|
@@ -866,8 +889,6 @@ var validRequestMethodsArr = [
|
|
|
866
889
|
];
|
|
867
890
|
var validRequestMethods = new Set(validRequestMethodsArr);
|
|
868
891
|
var redirectStatusCodes = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
869
|
-
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
870
|
-
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
|
|
871
892
|
var defaultMapRouteProperties = (route) => ({
|
|
872
893
|
hasErrorBoundary: Boolean(route.hasErrorBoundary)
|
|
873
894
|
});
|
|
@@ -6,7 +6,7 @@ export { BrowserRouter, Form, HashRouter, Link, Links, MemoryRouter, Meta, NavLi
|
|
|
6
6
|
import { serialize, parse } from 'cookie';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* react-router v7.9.6-pre.
|
|
9
|
+
* react-router v7.9.6-pre.1
|
|
10
10
|
*
|
|
11
11
|
* Copyright (c) Remix Software Inc.
|
|
12
12
|
*
|
|
@@ -686,13 +686,36 @@ function prependBasename({
|
|
|
686
686
|
}) {
|
|
687
687
|
return pathname === "/" ? basename : joinPaths([basename, pathname]);
|
|
688
688
|
}
|
|
689
|
+
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
690
|
+
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
|
|
689
691
|
function resolvePath(to, fromPathname = "/") {
|
|
690
692
|
let {
|
|
691
693
|
pathname: toPathname,
|
|
692
694
|
search = "",
|
|
693
695
|
hash = ""
|
|
694
696
|
} = typeof to === "string" ? parsePath(to) : to;
|
|
695
|
-
let pathname
|
|
697
|
+
let pathname;
|
|
698
|
+
if (toPathname) {
|
|
699
|
+
if (isAbsoluteUrl(toPathname)) {
|
|
700
|
+
pathname = toPathname;
|
|
701
|
+
} else {
|
|
702
|
+
if (toPathname.includes("//")) {
|
|
703
|
+
let oldPathname = toPathname;
|
|
704
|
+
toPathname = toPathname.replace(/\/\/+/g, "/");
|
|
705
|
+
warning(
|
|
706
|
+
false,
|
|
707
|
+
`Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}`
|
|
708
|
+
);
|
|
709
|
+
}
|
|
710
|
+
if (toPathname.startsWith("/")) {
|
|
711
|
+
pathname = resolvePathname(toPathname.substring(1), "/");
|
|
712
|
+
} else {
|
|
713
|
+
pathname = resolvePathname(toPathname, fromPathname);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
} else {
|
|
717
|
+
pathname = fromPathname;
|
|
718
|
+
}
|
|
696
719
|
return {
|
|
697
720
|
pathname,
|
|
698
721
|
search: normalizeSearch(search),
|
|
@@ -845,8 +868,6 @@ var validRequestMethodsArr = [
|
|
|
845
868
|
];
|
|
846
869
|
var validRequestMethods = new Set(validRequestMethodsArr);
|
|
847
870
|
var redirectStatusCodes = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
848
|
-
var ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
849
|
-
var isAbsoluteUrl = (url) => ABSOLUTE_URL_REGEX.test(url);
|
|
850
871
|
var defaultMapRouteProperties = (route) => ({
|
|
851
872
|
hasErrorBoundary: Boolean(route.hasErrorBoundary)
|
|
852
873
|
});
|