react-router 7.13.1-pre.0 → 7.13.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 +31 -12
- package/dist/{production/chunk-ZXYVKLN7.js → development/chunk-2YMDXNOJ.js} +99 -99
- package/dist/development/{chunk-BPFEYQ6M.mjs → chunk-JPUPSTYD.mjs} +2 -2
- package/dist/{production/chunk-I63A6YSE.js → development/chunk-KSEWV2VO.js} +7 -7
- package/dist/development/{chunk-WQZSGSJA.mjs → chunk-LFPYN7LY.mjs} +2 -2
- package/dist/development/{chunk-LF5SS6XE.js → chunk-XOLAXE2Z.js} +1 -1
- package/dist/development/dom-export.js +27 -27
- 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 +82 -82
- 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-XCKC4VBJ.js → chunk-772H4TVR.js} +1 -1
- package/dist/{development/chunk-TC44ITIJ.js → production/chunk-B5UMK6O7.js} +99 -99
- package/dist/production/{chunk-2K4LVAAG.mjs → chunk-RJCJ3EYF.mjs} +2 -2
- package/dist/production/{chunk-ROHSFSEU.mjs → chunk-TXB4YXR2.mjs} +2 -2
- package/dist/{development/chunk-CGPAOPIJ.js → production/chunk-ZJMCM6KT.js} +7 -7
- package/dist/production/dom-export.js +27 -27
- 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 +82 -82
- 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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
|
|
2
|
-
* react-router v7.13.1
|
|
2
|
+
* react-router v7.13.1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk772H4TVRjs = require('./chunk-772H4TVR.js');
|
|
18
18
|
|
|
19
19
|
// lib/dom/ssr/hydration.tsx
|
|
20
20
|
function getHydrationData({
|
|
@@ -29,12 +29,12 @@ function getHydrationData({
|
|
|
29
29
|
...state,
|
|
30
30
|
loaderData: { ...state.loaderData }
|
|
31
31
|
};
|
|
32
|
-
let initialMatches =
|
|
32
|
+
let initialMatches = _chunk772H4TVRjs.matchRoutes.call(void 0, routes, location, basename);
|
|
33
33
|
if (initialMatches) {
|
|
34
34
|
for (let match of initialMatches) {
|
|
35
35
|
let routeId = match.route.id;
|
|
36
36
|
let routeInfo = getRouteInfo(routeId);
|
|
37
|
-
if (
|
|
37
|
+
if (_chunk772H4TVRjs.shouldHydrateRouteLoader.call(void 0,
|
|
38
38
|
routeId,
|
|
39
39
|
routeInfo.clientLoader,
|
|
40
40
|
routeInfo.hasLoader,
|
|
@@ -112,7 +112,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
|
-
if (
|
|
115
|
+
if (_chunk772H4TVRjs.isRouteErrorResponse.call(void 0, error)) {
|
|
116
116
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
117
117
|
ErrorWrapper,
|
|
118
118
|
{
|
|
@@ -120,7 +120,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
120
120
|
title: "Unhandled Thrown Response!"
|
|
121
121
|
},
|
|
122
122
|
/* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
123
|
-
|
|
123
|
+
_chunk772H4TVRjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
let errorInstance;
|
|
@@ -146,7 +146,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
146
146
|
function RSCDefaultRootErrorBoundary({
|
|
147
147
|
hasRootLayout
|
|
148
148
|
}) {
|
|
149
|
-
let error =
|
|
149
|
+
let error = _chunk772H4TVRjs.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|
|
@@ -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.13.1
|
|
2
|
+
* react-router v7.13.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 _chunkZJMCM6KTjs = require('./chunk-ZJMCM6KT.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -32,7 +32,7 @@ var _chunkI63A6YSEjs = require('./chunk-I63A6YSE.js');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunk772H4TVRjs = require('./chunk-772H4TVR.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);
|
|
@@ -212,7 +212,7 @@ function HydratedRouter(props) {
|
|
|
212
212
|
}, []);
|
|
213
213
|
React2.useEffect(() => {
|
|
214
214
|
if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
|
|
215
|
-
document.querySelectorAll(`[${
|
|
215
|
+
document.querySelectorAll(`[${_chunk772H4TVRjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
|
216
216
|
}
|
|
217
217
|
}, [criticalCss]);
|
|
218
218
|
let [location2, setLocation] = React2.useState(router.state.location);
|
|
@@ -384,10 +384,10 @@ function createRouterFromPayload({
|
|
|
384
384
|
};
|
|
385
385
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
386
386
|
globalVar.__reactRouterRouteModules = _nullishCoalesce(globalVar.__reactRouterRouteModules, () => ( {}));
|
|
387
|
-
|
|
387
|
+
_chunkZJMCM6KTjs.populateRSCRouteModules.call(void 0, globalVar.__reactRouterRouteModules, payload.matches);
|
|
388
388
|
let patches = /* @__PURE__ */ new Map();
|
|
389
389
|
_optionalChain([payload, 'access', _22 => _22.patches, 'optionalAccess', _23 => _23.forEach, 'call', _24 => _24((patch) => {
|
|
390
|
-
|
|
390
|
+
_chunk772H4TVRjs.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
|
|
391
391
|
if (!patches.has(patch.parentId)) {
|
|
392
392
|
patches.set(patch.parentId, []);
|
|
393
393
|
}
|
|
@@ -409,12 +409,12 @@ function createRouterFromPayload({
|
|
|
409
409
|
}
|
|
410
410
|
return [route];
|
|
411
411
|
}, []);
|
|
412
|
-
globalVar.__reactRouterDataRouter =
|
|
412
|
+
globalVar.__reactRouterDataRouter = _chunk772H4TVRjs.createRouter.call(void 0, {
|
|
413
413
|
routes,
|
|
414
414
|
getContext,
|
|
415
415
|
basename: payload.basename,
|
|
416
|
-
history:
|
|
417
|
-
hydrationData:
|
|
416
|
+
history: _chunk772H4TVRjs.createBrowserHistory.call(void 0, ),
|
|
417
|
+
hydrationData: _chunkZJMCM6KTjs.getHydrationData.call(void 0, {
|
|
418
418
|
state: {
|
|
419
419
|
loaderData: payload.loaderData,
|
|
420
420
|
actionData: payload.actionData,
|
|
@@ -423,7 +423,7 @@ function createRouterFromPayload({
|
|
|
423
423
|
routes,
|
|
424
424
|
getRouteInfo: (routeId) => {
|
|
425
425
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
426
|
-
|
|
426
|
+
_chunk772H4TVRjs.invariant.call(void 0, match, "Route not found in payload");
|
|
427
427
|
return {
|
|
428
428
|
clientLoader: match.clientLoader,
|
|
429
429
|
hasLoader: match.hasLoader,
|
|
@@ -521,9 +521,9 @@ function createRouterFromPayload({
|
|
|
521
521
|
routeModules: globalVar.__reactRouterRouteModules
|
|
522
522
|
};
|
|
523
523
|
}
|
|
524
|
-
var renderedRoutesContext =
|
|
524
|
+
var renderedRoutesContext = _chunk772H4TVRjs.createContext.call(void 0, );
|
|
525
525
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
526
|
-
let dataStrategy =
|
|
526
|
+
let dataStrategy = _chunk772H4TVRjs.getSingleFetchDataStrategyImpl.call(void 0,
|
|
527
527
|
getRouter,
|
|
528
528
|
(match) => {
|
|
529
529
|
let M = match;
|
|
@@ -581,20 +581,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
581
581
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
582
582
|
return async (args, basename, trailingSlashAware, targetRoutes) => {
|
|
583
583
|
let { request, context } = args;
|
|
584
|
-
let url =
|
|
584
|
+
let url = _chunk772H4TVRjs.singleFetchUrl.call(void 0, request.url, basename, trailingSlashAware, "rsc");
|
|
585
585
|
if (request.method === "GET") {
|
|
586
|
-
url =
|
|
586
|
+
url = _chunk772H4TVRjs.stripIndexParam.call(void 0, url);
|
|
587
587
|
if (targetRoutes) {
|
|
588
588
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
let res = await fetchImplementation(
|
|
592
|
-
new Request(url, await
|
|
592
|
+
new Request(url, await _chunk772H4TVRjs.createRequestInit.call(void 0, request))
|
|
593
593
|
);
|
|
594
594
|
if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
|
|
595
|
-
throw new (0,
|
|
595
|
+
throw new (0, _chunk772H4TVRjs.ErrorResponseImpl)(res.status, res.statusText, await res.text());
|
|
596
596
|
}
|
|
597
|
-
|
|
597
|
+
_chunk772H4TVRjs.invariant.call(void 0, res.body, "No response body to decode");
|
|
598
598
|
try {
|
|
599
599
|
const payload = await createFromReadableStream(res.body, {
|
|
600
600
|
temporaryReferences: void 0
|
|
@@ -618,7 +618,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
618
618
|
}
|
|
619
619
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
620
620
|
let results = { routes: {} };
|
|
621
|
-
const dataKey =
|
|
621
|
+
const dataKey = _chunk772H4TVRjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
622
622
|
for (let [routeId, data] of Object.entries(payload[dataKey] || {})) {
|
|
623
623
|
results.routes[routeId] = { data };
|
|
624
624
|
}
|
|
@@ -651,7 +651,7 @@ function RSCHydratedRouter({
|
|
|
651
651
|
[createFromReadableStream, payload, fetchImplementation, getContext]
|
|
652
652
|
);
|
|
653
653
|
React3.useEffect(() => {
|
|
654
|
-
|
|
654
|
+
_chunk772H4TVRjs.setIsHydrated.call(void 0, );
|
|
655
655
|
}, []);
|
|
656
656
|
React3.useLayoutEffect(() => {
|
|
657
657
|
const globalVar = window;
|
|
@@ -755,8 +755,8 @@ function RSCHydratedRouter({
|
|
|
755
755
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
756
756
|
routeModules
|
|
757
757
|
};
|
|
758
|
-
return /* @__PURE__ */ React3.createElement(
|
|
759
|
-
|
|
758
|
+
return /* @__PURE__ */ React3.createElement(_chunk772H4TVRjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkZJMCM6KTjs.RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(_chunk772H4TVRjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
|
759
|
+
_chunk772H4TVRjs.RouterProvider,
|
|
760
760
|
{
|
|
761
761
|
router: transitionEnabledRouter,
|
|
762
762
|
flushSync: ReactDOM2.flushSync
|
|
@@ -772,8 +772,8 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
772
772
|
// the server loader flow regardless of whether the client loader calls
|
|
773
773
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
774
774
|
match.hasComponent && !match.element;
|
|
775
|
-
|
|
776
|
-
|
|
775
|
+
_chunk772H4TVRjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
776
|
+
_chunkZJMCM6KTjs.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
|
|
777
777
|
let dataRoute = {
|
|
778
778
|
id: match.id,
|
|
779
779
|
element: match.element,
|
|
@@ -823,7 +823,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
823
823
|
return await callSingleFetch(singleFetch);
|
|
824
824
|
}
|
|
825
825
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
826
|
-
throw
|
|
826
|
+
throw _chunk772H4TVRjs.noActionDefinedError.call(void 0, "action", match.id);
|
|
827
827
|
},
|
|
828
828
|
path: match.path,
|
|
829
829
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -836,7 +836,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
836
836
|
hasShouldRevalidate: match.shouldRevalidate != null
|
|
837
837
|
};
|
|
838
838
|
if (typeof dataRoute.loader === "function") {
|
|
839
|
-
dataRoute.loader.hydrate =
|
|
839
|
+
dataRoute.loader.hydrate = _chunk772H4TVRjs.shouldHydrateRouteLoader.call(void 0,
|
|
840
840
|
match.id,
|
|
841
841
|
match.clientLoader,
|
|
842
842
|
match.hasLoader,
|
|
@@ -846,7 +846,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
846
846
|
return dataRoute;
|
|
847
847
|
}
|
|
848
848
|
function callSingleFetch(singleFetch) {
|
|
849
|
-
|
|
849
|
+
_chunk772H4TVRjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
850
850
|
return singleFetch();
|
|
851
851
|
}
|
|
852
852
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -854,7 +854,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
854
854
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
855
855
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
856
856
|
console.error(msg);
|
|
857
|
-
throw new (0,
|
|
857
|
+
throw new (0, _chunk772H4TVRjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.13.1
|
|
2
|
+
* react-router v7.13.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-TXB4YXR2.mjs";
|
|
18
18
|
import {
|
|
19
19
|
CRITICAL_CSS_DATA_ATTRIBUTE,
|
|
20
20
|
ErrorResponseImpl,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
singleFetchUrl,
|
|
43
43
|
stripIndexParam,
|
|
44
44
|
useFogOFWarDiscovery
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-RJCJ3EYF.mjs";
|
|
46
46
|
|
|
47
47
|
// lib/dom-export/dom-router-provider.tsx
|
|
48
48
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
|
|
2
|
-
* react-router v7.13.1
|
|
2
|
+
* react-router v7.13.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 _chunkB5UMK6O7js = require('./chunk-B5UMK6O7.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -34,7 +34,7 @@ var _chunkZXYVKLN7js = require('./chunk-ZXYVKLN7.js');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunk772H4TVRjs = require('./chunk-772H4TVR.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunkXCKC4VBJjs = require('./chunk-XCKC4VBJ.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.BrowserRouter =
|
|
61
|
+
exports.BrowserRouter = _chunkB5UMK6O7js.BrowserRouter; exports.Form = _chunkB5UMK6O7js.Form; exports.HashRouter = _chunkB5UMK6O7js.HashRouter; exports.Link = _chunkB5UMK6O7js.Link; exports.Links = _chunk772H4TVRjs.Links; exports.MemoryRouter = _chunk772H4TVRjs.MemoryRouter; exports.Meta = _chunk772H4TVRjs.Meta; exports.NavLink = _chunkB5UMK6O7js.NavLink; exports.Navigate = _chunk772H4TVRjs.Navigate; exports.Outlet = _chunk772H4TVRjs.Outlet; exports.Route = _chunk772H4TVRjs.Route; exports.Router = _chunk772H4TVRjs.Router; exports.RouterProvider = _chunk772H4TVRjs.RouterProvider; exports.Routes = _chunk772H4TVRjs.Routes; exports.ScrollRestoration = _chunkB5UMK6O7js.ScrollRestoration; exports.StaticRouter = _chunkB5UMK6O7js.StaticRouter; exports.StaticRouterProvider = _chunkB5UMK6O7js.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunk772H4TVRjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunk772H4TVRjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunk772H4TVRjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunk772H4TVRjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkB5UMK6O7js.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.13.1
|
|
2
|
+
* react-router v7.13.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-RJCJ3EYF.mjs";
|
|
36
36
|
export {
|
|
37
37
|
BrowserRouter,
|
|
38
38
|
Form,
|