react-router 7.18.0 → 7.18.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/{production/chunk-3Z6WS2WZ.js → development/chunk-EVX4J2F5.js} +7 -7
- package/dist/development/{chunk-YL5M26XI.js → chunk-G5KIBF6U.js} +103 -103
- package/dist/development/{chunk-E4MTK73K.mjs → chunk-IJF3QNGC.mjs} +2 -2
- package/dist/development/{chunk-4ZMWKKQ3.mjs → chunk-KS7C4IRE.mjs} +2 -2
- package/dist/development/{chunk-U7ORXROY.js → chunk-SA4DP3SF.js} +1 -1
- package/dist/development/dom-export.js +32 -32
- 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 +90 -90
- 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-EGOTSXNH.mjs → chunk-3MA7PLKB.mjs} +2 -2
- package/dist/production/{chunk-M7NGGUU6.mjs → chunk-3WDNQUW5.mjs} +2 -2
- package/dist/{development/chunk-WW7PN6QI.js → production/chunk-GOIER6ML.js} +7 -7
- package/dist/production/{chunk-IUPBOWYO.js → chunk-IEF7VMTA.js} +1 -1
- package/dist/production/{chunk-BIP66BKV.js → chunk-WICLSFKL.js} +103 -103
- package/dist/production/dom-export.js +32 -32
- 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 +90 -90
- 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/docs/how-to/status.md +1 -1
- package/docs/upgrading/future.md +222 -12
- package/docs/upgrading/remix.md +2 -2
- 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.18.
|
|
2
|
+
* react-router v7.18.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 _chunkGOIER6MLjs = require('./chunk-GOIER6ML.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -37,7 +37,7 @@ var _chunk3Z6WS2WZjs = require('./chunk-3Z6WS2WZ.js');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkIEF7VMTAjs = require('./chunk-IEF7VMTA.js');
|
|
41
41
|
|
|
42
42
|
// lib/dom-export/dom-router-provider.tsx
|
|
43
43
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
@@ -213,7 +213,7 @@ function HydratedRouter(props) {
|
|
|
213
213
|
}, []);
|
|
214
214
|
React2.useEffect(() => {
|
|
215
215
|
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
|
216
|
-
document.querySelectorAll(`[${
|
|
216
|
+
document.querySelectorAll(`[${_chunkIEF7VMTAjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
|
217
217
|
}
|
|
218
218
|
}, [criticalCss]);
|
|
219
219
|
let [location2, setLocation] = React2.useState(router.state.location);
|
|
@@ -308,7 +308,7 @@ function createCallServer({
|
|
|
308
308
|
if (payload.type === "redirect") {
|
|
309
309
|
let location2 = normalizeRedirectLocation(payload.location);
|
|
310
310
|
if (payload.reload || isExternalLocation(location2)) {
|
|
311
|
-
if (
|
|
311
|
+
if (_chunkIEF7VMTAjs.hasInvalidProtocol.call(void 0, location2)) {
|
|
312
312
|
throw new Error("Invalid redirect location");
|
|
313
313
|
}
|
|
314
314
|
window.location.href = location2;
|
|
@@ -329,7 +329,7 @@ function createCallServer({
|
|
|
329
329
|
if (rerender.type === "redirect") {
|
|
330
330
|
let location2 = normalizeRedirectLocation(rerender.location);
|
|
331
331
|
if (rerender.reload || isExternalLocation(location2)) {
|
|
332
|
-
if (
|
|
332
|
+
if (_chunkIEF7VMTAjs.hasInvalidProtocol.call(void 0, location2)) {
|
|
333
333
|
throw new Error("Invalid redirect location");
|
|
334
334
|
}
|
|
335
335
|
window.location.href = location2;
|
|
@@ -394,7 +394,7 @@ function createRouterFromPayload({
|
|
|
394
394
|
};
|
|
395
395
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
396
396
|
globalVar.__reactRouterRouteModules = _nullishCoalesce(globalVar.__reactRouterRouteModules, () => ( {}));
|
|
397
|
-
|
|
397
|
+
_chunkGOIER6MLjs.populateRSCRouteModules.call(void 0, globalVar.__reactRouterRouteModules, payload.matches);
|
|
398
398
|
let routes = payload.matches.reduceRight((previous, match) => {
|
|
399
399
|
const route = createRouteFromServerManifest(
|
|
400
400
|
match,
|
|
@@ -408,12 +408,12 @@ function createRouterFromPayload({
|
|
|
408
408
|
return [route];
|
|
409
409
|
}, []);
|
|
410
410
|
let applyPatchesPromise;
|
|
411
|
-
globalVar.__reactRouterDataRouter =
|
|
411
|
+
globalVar.__reactRouterDataRouter = _chunkIEF7VMTAjs.createRouter.call(void 0, {
|
|
412
412
|
routes,
|
|
413
413
|
getContext,
|
|
414
414
|
basename: payload.basename,
|
|
415
|
-
history:
|
|
416
|
-
hydrationData:
|
|
415
|
+
history: _chunkIEF7VMTAjs.createBrowserHistory.call(void 0, ),
|
|
416
|
+
hydrationData: _chunkGOIER6MLjs.getHydrationData.call(void 0, {
|
|
417
417
|
state: {
|
|
418
418
|
loaderData: payload.loaderData,
|
|
419
419
|
actionData: payload.actionData,
|
|
@@ -422,7 +422,7 @@ function createRouterFromPayload({
|
|
|
422
422
|
routes,
|
|
423
423
|
getRouteInfo: (routeId) => {
|
|
424
424
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
425
|
-
|
|
425
|
+
_chunkIEF7VMTAjs.invariant.call(void 0, match, "Route not found in payload");
|
|
426
426
|
return {
|
|
427
427
|
clientLoader: match.clientLoader,
|
|
428
428
|
hasLoader: match.hasLoader,
|
|
@@ -537,9 +537,9 @@ function createRouterFromPayload({
|
|
|
537
537
|
routeModules: globalVar.__reactRouterRouteModules
|
|
538
538
|
};
|
|
539
539
|
}
|
|
540
|
-
var renderedRoutesContext =
|
|
540
|
+
var renderedRoutesContext = _chunkIEF7VMTAjs.createContext.call(void 0, );
|
|
541
541
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
542
|
-
let dataStrategy =
|
|
542
|
+
let dataStrategy = _chunkIEF7VMTAjs.getSingleFetchDataStrategyImpl.call(void 0,
|
|
543
543
|
getRouter,
|
|
544
544
|
(match) => {
|
|
545
545
|
let M = match;
|
|
@@ -596,20 +596,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
596
596
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
597
597
|
return async (args, basename, trailingSlashAware, targetRoutes) => {
|
|
598
598
|
let { request, context } = args;
|
|
599
|
-
let url =
|
|
599
|
+
let url = _chunkIEF7VMTAjs.singleFetchUrl.call(void 0, request.url, basename, trailingSlashAware, "rsc");
|
|
600
600
|
if (request.method === "GET") {
|
|
601
|
-
url =
|
|
601
|
+
url = _chunkIEF7VMTAjs.stripIndexParam.call(void 0, url);
|
|
602
602
|
if (targetRoutes) {
|
|
603
603
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
let res = await fetchImplementation(
|
|
607
|
-
new Request(url, await
|
|
607
|
+
new Request(url, await _chunkIEF7VMTAjs.createRequestInit.call(void 0, request))
|
|
608
608
|
);
|
|
609
609
|
if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
|
|
610
|
-
throw new (0,
|
|
610
|
+
throw new (0, _chunkIEF7VMTAjs.ErrorResponseImpl)(res.status, res.statusText, await res.text());
|
|
611
611
|
}
|
|
612
|
-
|
|
612
|
+
_chunkIEF7VMTAjs.invariant.call(void 0, res.body, "No response body to decode");
|
|
613
613
|
try {
|
|
614
614
|
const payload = await createFromReadableStream(res.body, {
|
|
615
615
|
temporaryReferences: void 0
|
|
@@ -633,7 +633,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
633
633
|
}
|
|
634
634
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
635
635
|
let results = { routes: {} };
|
|
636
|
-
const dataKey =
|
|
636
|
+
const dataKey = _chunkIEF7VMTAjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
637
637
|
for (let [routeId, data] of Object.entries(payload[dataKey] || {})) {
|
|
638
638
|
results.routes[routeId] = { data };
|
|
639
639
|
}
|
|
@@ -666,7 +666,7 @@ function RSCHydratedRouter({
|
|
|
666
666
|
[createFromReadableStream, payload, fetchImplementation, getContext]
|
|
667
667
|
);
|
|
668
668
|
React3.useEffect(() => {
|
|
669
|
-
|
|
669
|
+
_chunkIEF7VMTAjs.setIsHydrated.call(void 0, );
|
|
670
670
|
}, []);
|
|
671
671
|
React3.useLayoutEffect(() => {
|
|
672
672
|
const globalVar = window;
|
|
@@ -774,8 +774,8 @@ function RSCHydratedRouter({
|
|
|
774
774
|
},
|
|
775
775
|
routeModules
|
|
776
776
|
};
|
|
777
|
-
return /* @__PURE__ */ React3.createElement(
|
|
778
|
-
|
|
777
|
+
return /* @__PURE__ */ React3.createElement(_chunkIEF7VMTAjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkGOIER6MLjs.RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(_chunkIEF7VMTAjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
|
778
|
+
_chunkIEF7VMTAjs.RouterProvider,
|
|
779
779
|
{
|
|
780
780
|
router: transitionEnabledRouter,
|
|
781
781
|
flushSync: ReactDOM2.flushSync
|
|
@@ -791,8 +791,8 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
791
791
|
// the server loader flow regardless of whether the client loader calls
|
|
792
792
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
793
793
|
match.hasComponent && !match.element;
|
|
794
|
-
|
|
795
|
-
|
|
794
|
+
_chunkIEF7VMTAjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
795
|
+
_chunkGOIER6MLjs.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
|
|
796
796
|
let dataRoute = {
|
|
797
797
|
id: match.id,
|
|
798
798
|
element: match.element,
|
|
@@ -840,7 +840,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
840
840
|
return await callSingleFetch(singleFetch);
|
|
841
841
|
}
|
|
842
842
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
843
|
-
throw
|
|
843
|
+
throw _chunkIEF7VMTAjs.noActionDefinedError.call(void 0, "action", match.id);
|
|
844
844
|
},
|
|
845
845
|
path: match.path,
|
|
846
846
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -852,7 +852,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
852
852
|
hasClientAction: match.clientAction != null
|
|
853
853
|
};
|
|
854
854
|
if (typeof dataRoute.loader === "function") {
|
|
855
|
-
dataRoute.loader.hydrate =
|
|
855
|
+
dataRoute.loader.hydrate = _chunkIEF7VMTAjs.shouldHydrateRouteLoader.call(void 0,
|
|
856
856
|
match.id,
|
|
857
857
|
match.clientLoader,
|
|
858
858
|
match.hasLoader,
|
|
@@ -862,7 +862,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
862
862
|
return dataRoute;
|
|
863
863
|
}
|
|
864
864
|
function callSingleFetch(singleFetch) {
|
|
865
|
-
|
|
865
|
+
_chunkIEF7VMTAjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
866
866
|
return singleFetch();
|
|
867
867
|
}
|
|
868
868
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -870,7 +870,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
870
870
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
871
871
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
872
872
|
console.error(msg);
|
|
873
|
-
throw new (0,
|
|
873
|
+
throw new (0, _chunkIEF7VMTAjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
876
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -893,12 +893,12 @@ function getManifestUrl(paths) {
|
|
|
893
893
|
return url;
|
|
894
894
|
}
|
|
895
895
|
async function fetchAndApplyManifestPatches(paths, createFromReadableStream, fetchImplementation, signal) {
|
|
896
|
-
paths =
|
|
896
|
+
paths = _chunkIEF7VMTAjs.getPathsWithAncestors.call(void 0, paths);
|
|
897
897
|
let url = getManifestUrl(paths);
|
|
898
898
|
if (url == null) {
|
|
899
899
|
return;
|
|
900
900
|
}
|
|
901
|
-
if (url.toString().length >
|
|
901
|
+
if (url.toString().length > _chunkIEF7VMTAjs.URL_LIMIT) {
|
|
902
902
|
nextPaths.clear();
|
|
903
903
|
return;
|
|
904
904
|
}
|
|
@@ -942,8 +942,8 @@ function isExternalLocation(location2) {
|
|
|
942
942
|
return newLocation.origin !== window.location.origin;
|
|
943
943
|
}
|
|
944
944
|
function normalizeRedirectLocation(location2) {
|
|
945
|
-
if (
|
|
946
|
-
let path =
|
|
945
|
+
if (_chunkIEF7VMTAjs.PROTOCOL_RELATIVE_URL_REGEX.test(location2)) {
|
|
946
|
+
let path = _chunkIEF7VMTAjs.resolvePath.call(void 0, location2);
|
|
947
947
|
return path.pathname + path.search + path.hash;
|
|
948
948
|
}
|
|
949
949
|
return location2;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
RSCRouterGlobalErrorBoundary,
|
|
14
14
|
getHydrationData,
|
|
15
15
|
populateRSCRouteModules
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3MA7PLKB.mjs";
|
|
17
17
|
import {
|
|
18
18
|
CRITICAL_CSS_DATA_ATTRIBUTE,
|
|
19
19
|
ErrorResponseImpl,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
singleFetchUrl,
|
|
47
47
|
stripIndexParam,
|
|
48
48
|
useFogOFWarDiscovery
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-3WDNQUW5.mjs";
|
|
50
50
|
|
|
51
51
|
// lib/dom-export/dom-router-provider.tsx
|
|
52
52
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.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 _chunkWICLSFKLjs = require('./chunk-WICLSFKL.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -34,7 +34,7 @@ var _chunkBIP66BKVjs = require('./chunk-BIP66BKV.js');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkIEF7VMTAjs = require('./chunk-IEF7VMTA.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunkIUPBOWYOjs = require('./chunk-IUPBOWYO.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.BrowserRouter =
|
|
61
|
+
exports.BrowserRouter = _chunkWICLSFKLjs.BrowserRouter; exports.Form = _chunkWICLSFKLjs.Form; exports.HashRouter = _chunkWICLSFKLjs.HashRouter; exports.Link = _chunkWICLSFKLjs.Link; exports.Links = _chunkIEF7VMTAjs.Links; exports.MemoryRouter = _chunkIEF7VMTAjs.MemoryRouter; exports.Meta = _chunkIEF7VMTAjs.Meta; exports.NavLink = _chunkWICLSFKLjs.NavLink; exports.Navigate = _chunkIEF7VMTAjs.Navigate; exports.Outlet = _chunkIEF7VMTAjs.Outlet; exports.Route = _chunkIEF7VMTAjs.Route; exports.Router = _chunkIEF7VMTAjs.Router; exports.RouterProvider = _chunkIEF7VMTAjs.RouterProvider; exports.Routes = _chunkIEF7VMTAjs.Routes; exports.ScrollRestoration = _chunkWICLSFKLjs.ScrollRestoration; exports.StaticRouter = _chunkWICLSFKLjs.StaticRouter; exports.StaticRouterProvider = _chunkWICLSFKLjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkIEF7VMTAjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunkIEF7VMTAjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkIEF7VMTAjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkIEF7VMTAjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkWICLSFKLjs.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.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-3WDNQUW5.mjs";
|
|
36
36
|
export {
|
|
37
37
|
BrowserRouter,
|
|
38
38
|
Form,
|