react-router 7.10.1-pre.0 → 7.10.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 +13 -3
- package/dist/{production/chunk-3WZYQEC5.js → development/chunk-FKYGG5Z2.js} +7 -7
- package/dist/development/{chunk-NUGUL5OD.js → chunk-HMTWJNYB.js} +94 -94
- package/dist/development/{chunk-X3LLUSK4.mjs → chunk-PMGK554W.mjs} +2 -2
- package/dist/development/{chunk-BFZIIKOS.js → chunk-RBZI3ZHD.js} +1 -1
- package/dist/development/{chunk-SC4UA6B4.mjs → chunk-WWGJGFF6.mjs} +2 -2
- 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 +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-FI4GMOFC.mjs → chunk-ANIOYBQK.mjs} +2 -2
- package/dist/production/{chunk-7NETFFGG.js → chunk-B3F6YMOF.js} +94 -94
- package/dist/production/{chunk-KT4GS4WF.mjs → chunk-TDCOAFPJ.mjs} +2 -2
- package/dist/production/{chunk-322RSYEJ.js → chunk-UQPBOMFP.js} +1 -1
- package/dist/{development/chunk-VPK5G3S4.js → production/chunk-YO5R3LGQ.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 +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.10.1
|
|
2
|
+
* react-router v7.10.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 _chunkFKYGG5Z2js = require('./chunk-FKYGG5Z2.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -32,7 +32,7 @@ var _chunkVPK5G3S4js = require('./chunk-VPK5G3S4.js');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkRBZI3ZHDjs = require('./chunk-RBZI3ZHD.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(`[${_chunkRBZI3ZHDjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
|
208
208
|
}
|
|
209
209
|
}, [criticalCss]);
|
|
210
210
|
let [location2, setLocation] = React2.useState(router.state.location);
|
|
@@ -376,10 +376,10 @@ function createRouterFromPayload({
|
|
|
376
376
|
};
|
|
377
377
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
378
378
|
globalVar.__reactRouterRouteModules = _nullishCoalesce(globalVar.__reactRouterRouteModules, () => ( {}));
|
|
379
|
-
|
|
379
|
+
_chunkFKYGG5Z2js.populateRSCRouteModules.call(void 0, globalVar.__reactRouterRouteModules, payload.matches);
|
|
380
380
|
let patches = /* @__PURE__ */ new Map();
|
|
381
381
|
_optionalChain([payload, 'access', _22 => _22.patches, 'optionalAccess', _23 => _23.forEach, 'call', _24 => _24((patch) => {
|
|
382
|
-
|
|
382
|
+
_chunkRBZI3ZHDjs.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
|
|
383
383
|
if (!patches.has(patch.parentId)) {
|
|
384
384
|
patches.set(patch.parentId, []);
|
|
385
385
|
}
|
|
@@ -401,12 +401,12 @@ function createRouterFromPayload({
|
|
|
401
401
|
}
|
|
402
402
|
return [route];
|
|
403
403
|
}, []);
|
|
404
|
-
globalVar.__reactRouterDataRouter =
|
|
404
|
+
globalVar.__reactRouterDataRouter = _chunkRBZI3ZHDjs.createRouter.call(void 0, {
|
|
405
405
|
routes,
|
|
406
406
|
getContext,
|
|
407
407
|
basename: payload.basename,
|
|
408
|
-
history:
|
|
409
|
-
hydrationData:
|
|
408
|
+
history: _chunkRBZI3ZHDjs.createBrowserHistory.call(void 0, ),
|
|
409
|
+
hydrationData: _chunkFKYGG5Z2js.getHydrationData.call(void 0, {
|
|
410
410
|
state: {
|
|
411
411
|
loaderData: payload.loaderData,
|
|
412
412
|
actionData: payload.actionData,
|
|
@@ -415,7 +415,7 @@ function createRouterFromPayload({
|
|
|
415
415
|
routes,
|
|
416
416
|
getRouteInfo: (routeId) => {
|
|
417
417
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
418
|
-
|
|
418
|
+
_chunkRBZI3ZHDjs.invariant.call(void 0, match, "Route not found in payload");
|
|
419
419
|
return {
|
|
420
420
|
clientLoader: match.clientLoader,
|
|
421
421
|
hasLoader: match.hasLoader,
|
|
@@ -513,9 +513,9 @@ function createRouterFromPayload({
|
|
|
513
513
|
routeModules: globalVar.__reactRouterRouteModules
|
|
514
514
|
};
|
|
515
515
|
}
|
|
516
|
-
var renderedRoutesContext =
|
|
516
|
+
var renderedRoutesContext = _chunkRBZI3ZHDjs.createContext.call(void 0, );
|
|
517
517
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
518
|
-
let dataStrategy =
|
|
518
|
+
let dataStrategy = _chunkRBZI3ZHDjs.getSingleFetchDataStrategyImpl.call(void 0,
|
|
519
519
|
getRouter,
|
|
520
520
|
(match) => {
|
|
521
521
|
let M = match;
|
|
@@ -571,20 +571,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
571
571
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
572
572
|
return async (args, basename, targetRoutes) => {
|
|
573
573
|
let { request, context } = args;
|
|
574
|
-
let url =
|
|
574
|
+
let url = _chunkRBZI3ZHDjs.singleFetchUrl.call(void 0, request.url, basename, "rsc");
|
|
575
575
|
if (request.method === "GET") {
|
|
576
|
-
url =
|
|
576
|
+
url = _chunkRBZI3ZHDjs.stripIndexParam.call(void 0, url);
|
|
577
577
|
if (targetRoutes) {
|
|
578
578
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
581
|
let res = await fetchImplementation(
|
|
582
|
-
new Request(url, await
|
|
582
|
+
new Request(url, await _chunkRBZI3ZHDjs.createRequestInit.call(void 0, request))
|
|
583
583
|
);
|
|
584
584
|
if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
|
|
585
|
-
throw new (0,
|
|
585
|
+
throw new (0, _chunkRBZI3ZHDjs.ErrorResponseImpl)(res.status, res.statusText, await res.text());
|
|
586
586
|
}
|
|
587
|
-
|
|
587
|
+
_chunkRBZI3ZHDjs.invariant.call(void 0, res.body, "No response body to decode");
|
|
588
588
|
try {
|
|
589
589
|
const payload = await createFromReadableStream(res.body, {
|
|
590
590
|
temporaryReferences: void 0
|
|
@@ -608,7 +608,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
608
608
|
}
|
|
609
609
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
610
610
|
let results = { routes: {} };
|
|
611
|
-
const dataKey =
|
|
611
|
+
const dataKey = _chunkRBZI3ZHDjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
612
612
|
for (let [routeId, data] of Object.entries(payload[dataKey] || {})) {
|
|
613
613
|
results.routes[routeId] = { data };
|
|
614
614
|
}
|
|
@@ -641,7 +641,7 @@ function RSCHydratedRouter({
|
|
|
641
641
|
[createFromReadableStream, payload, fetchImplementation, getContext]
|
|
642
642
|
);
|
|
643
643
|
React3.useEffect(() => {
|
|
644
|
-
|
|
644
|
+
_chunkRBZI3ZHDjs.setIsHydrated.call(void 0, );
|
|
645
645
|
}, []);
|
|
646
646
|
React3.useLayoutEffect(() => {
|
|
647
647
|
const globalVar = window;
|
|
@@ -743,8 +743,8 @@ function RSCHydratedRouter({
|
|
|
743
743
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
744
744
|
routeModules
|
|
745
745
|
};
|
|
746
|
-
return /* @__PURE__ */ React3.createElement(
|
|
747
|
-
|
|
746
|
+
return /* @__PURE__ */ React3.createElement(_chunkRBZI3ZHDjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkFKYGG5Z2js.RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(_chunkRBZI3ZHDjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
|
747
|
+
_chunkRBZI3ZHDjs.RouterProvider,
|
|
748
748
|
{
|
|
749
749
|
router: transitionEnabledRouter,
|
|
750
750
|
flushSync: ReactDOM2.flushSync,
|
|
@@ -761,8 +761,8 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
761
761
|
// the server loader flow regardless of whether the client loader calls
|
|
762
762
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
763
763
|
match.hasComponent && !match.element;
|
|
764
|
-
|
|
765
|
-
|
|
764
|
+
_chunkRBZI3ZHDjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
765
|
+
_chunkFKYGG5Z2js.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
|
|
766
766
|
let dataRoute = {
|
|
767
767
|
id: match.id,
|
|
768
768
|
element: match.element,
|
|
@@ -812,7 +812,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
812
812
|
return await callSingleFetch(singleFetch);
|
|
813
813
|
}
|
|
814
814
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
815
|
-
throw
|
|
815
|
+
throw _chunkRBZI3ZHDjs.noActionDefinedError.call(void 0, "action", match.id);
|
|
816
816
|
},
|
|
817
817
|
path: match.path,
|
|
818
818
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -825,7 +825,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
825
825
|
hasShouldRevalidate: match.shouldRevalidate != null
|
|
826
826
|
};
|
|
827
827
|
if (typeof dataRoute.loader === "function") {
|
|
828
|
-
dataRoute.loader.hydrate =
|
|
828
|
+
dataRoute.loader.hydrate = _chunkRBZI3ZHDjs.shouldHydrateRouteLoader.call(void 0,
|
|
829
829
|
match.id,
|
|
830
830
|
match.clientLoader,
|
|
831
831
|
match.hasLoader,
|
|
@@ -835,7 +835,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
835
835
|
return dataRoute;
|
|
836
836
|
}
|
|
837
837
|
function callSingleFetch(singleFetch) {
|
|
838
|
-
|
|
838
|
+
_chunkRBZI3ZHDjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
839
839
|
return singleFetch();
|
|
840
840
|
}
|
|
841
841
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -843,7 +843,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
843
843
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
844
844
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
845
845
|
console.error(msg);
|
|
846
|
-
throw new (0,
|
|
846
|
+
throw new (0, _chunkRBZI3ZHDjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
849
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.10.1
|
|
2
|
+
* react-router v7.10.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-PMGK554W.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-WWGJGFF6.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.10.1
|
|
2
|
+
* react-router v7.10.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 _chunkHMTWJNYBjs = require('./chunk-HMTWJNYB.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -34,7 +34,7 @@ var _chunkNUGUL5ODjs = require('./chunk-NUGUL5OD.js');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkRBZI3ZHDjs = require('./chunk-RBZI3ZHD.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunkBFZIIKOSjs = require('./chunk-BFZIIKOS.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.BrowserRouter =
|
|
61
|
+
exports.BrowserRouter = _chunkHMTWJNYBjs.BrowserRouter; exports.Form = _chunkHMTWJNYBjs.Form; exports.HashRouter = _chunkHMTWJNYBjs.HashRouter; exports.Link = _chunkHMTWJNYBjs.Link; exports.Links = _chunkRBZI3ZHDjs.Links; exports.MemoryRouter = _chunkRBZI3ZHDjs.MemoryRouter; exports.Meta = _chunkRBZI3ZHDjs.Meta; exports.NavLink = _chunkHMTWJNYBjs.NavLink; exports.Navigate = _chunkRBZI3ZHDjs.Navigate; exports.Outlet = _chunkRBZI3ZHDjs.Outlet; exports.Route = _chunkRBZI3ZHDjs.Route; exports.Router = _chunkRBZI3ZHDjs.Router; exports.RouterProvider = _chunkRBZI3ZHDjs.RouterProvider; exports.Routes = _chunkRBZI3ZHDjs.Routes; exports.ScrollRestoration = _chunkHMTWJNYBjs.ScrollRestoration; exports.StaticRouter = _chunkHMTWJNYBjs.StaticRouter; exports.StaticRouterProvider = _chunkHMTWJNYBjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkRBZI3ZHDjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunkRBZI3ZHDjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkRBZI3ZHDjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkRBZI3ZHDjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkHMTWJNYBjs.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.10.1
|
|
2
|
+
* react-router v7.10.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-WWGJGFF6.mjs";
|
|
36
36
|
export {
|
|
37
37
|
BrowserRouter,
|
|
38
38
|
Form,
|