react-router 7.13.2-pre.0 → 7.13.2
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 +30 -11
- package/dist/development/{chunk-WO3PXTPV.js → chunk-GO74ODU3.js} +1 -1
- package/dist/development/{chunk-ZHBHDHL3.js → chunk-HPFFRPKK.js} +99 -99
- package/dist/development/{chunk-FXJW44AE.js → chunk-LLP6DRWX.js} +7 -7
- package/dist/development/{chunk-JEVMZMTG.mjs → chunk-UALY5CBT.mjs} +2 -2
- package/dist/development/{chunk-WM3TIFYP.mjs → chunk-UVKPFVEO.mjs} +2 -2
- package/dist/development/dom-export.js +28 -28
- 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-GCYIH3UC.mjs → chunk-2BDJPJTA.mjs} +2 -2
- package/dist/production/{chunk-R7LC5VXK.js → chunk-CAFVLUDY.js} +7 -7
- package/dist/production/{chunk-6A7E6W56.js → chunk-LKUVSIBA.js} +1 -1
- package/dist/production/{chunk-ZLBCNRMB.mjs → chunk-PY35PE22.mjs} +2 -2
- package/dist/production/{chunk-C3CA6GXO.js → chunk-XAAX7KIK.js} +99 -99
- package/dist/production/dom-export.js +28 -28
- 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 _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.2
|
|
2
|
+
* react-router v7.13.2
|
|
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 _chunkCAFVLUDYjs = require('./chunk-CAFVLUDY.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -33,7 +33,7 @@ var _chunkR7LC5VXKjs = require('./chunk-R7LC5VXK.js');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _chunkLKUVSIBAjs = require('./chunk-LKUVSIBA.js');
|
|
37
37
|
|
|
38
38
|
// lib/dom-export/dom-router-provider.tsx
|
|
39
39
|
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(`[${_chunkLKUVSIBAjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
|
|
217
217
|
}
|
|
218
218
|
}, [criticalCss]);
|
|
219
219
|
let [location2, setLocation] = React2.useState(router.state.location);
|
|
@@ -391,10 +391,10 @@ function createRouterFromPayload({
|
|
|
391
391
|
};
|
|
392
392
|
if (payload.type !== "render") throw new Error("Invalid payload type");
|
|
393
393
|
globalVar.__reactRouterRouteModules = _nullishCoalesce(globalVar.__reactRouterRouteModules, () => ( {}));
|
|
394
|
-
|
|
394
|
+
_chunkCAFVLUDYjs.populateRSCRouteModules.call(void 0, globalVar.__reactRouterRouteModules, payload.matches);
|
|
395
395
|
let patches = /* @__PURE__ */ new Map();
|
|
396
396
|
_optionalChain([payload, 'access', _22 => _22.patches, 'optionalAccess', _23 => _23.forEach, 'call', _24 => _24((patch) => {
|
|
397
|
-
|
|
397
|
+
_chunkLKUVSIBAjs.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
|
|
398
398
|
if (!patches.has(patch.parentId)) {
|
|
399
399
|
patches.set(patch.parentId, []);
|
|
400
400
|
}
|
|
@@ -416,12 +416,12 @@ function createRouterFromPayload({
|
|
|
416
416
|
}
|
|
417
417
|
return [route];
|
|
418
418
|
}, []);
|
|
419
|
-
globalVar.__reactRouterDataRouter =
|
|
419
|
+
globalVar.__reactRouterDataRouter = _chunkLKUVSIBAjs.createRouter.call(void 0, {
|
|
420
420
|
routes,
|
|
421
421
|
getContext,
|
|
422
422
|
basename: payload.basename,
|
|
423
|
-
history:
|
|
424
|
-
hydrationData:
|
|
423
|
+
history: _chunkLKUVSIBAjs.createBrowserHistory.call(void 0, ),
|
|
424
|
+
hydrationData: _chunkCAFVLUDYjs.getHydrationData.call(void 0, {
|
|
425
425
|
state: {
|
|
426
426
|
loaderData: payload.loaderData,
|
|
427
427
|
actionData: payload.actionData,
|
|
@@ -430,7 +430,7 @@ function createRouterFromPayload({
|
|
|
430
430
|
routes,
|
|
431
431
|
getRouteInfo: (routeId) => {
|
|
432
432
|
let match = payload.matches.find((m) => m.id === routeId);
|
|
433
|
-
|
|
433
|
+
_chunkLKUVSIBAjs.invariant.call(void 0, match, "Route not found in payload");
|
|
434
434
|
return {
|
|
435
435
|
clientLoader: match.clientLoader,
|
|
436
436
|
hasLoader: match.hasLoader,
|
|
@@ -528,9 +528,9 @@ function createRouterFromPayload({
|
|
|
528
528
|
routeModules: globalVar.__reactRouterRouteModules
|
|
529
529
|
};
|
|
530
530
|
}
|
|
531
|
-
var renderedRoutesContext =
|
|
531
|
+
var renderedRoutesContext = _chunkLKUVSIBAjs.createContext.call(void 0, );
|
|
532
532
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
533
|
-
let dataStrategy =
|
|
533
|
+
let dataStrategy = _chunkLKUVSIBAjs.getSingleFetchDataStrategyImpl.call(void 0,
|
|
534
534
|
getRouter,
|
|
535
535
|
(match) => {
|
|
536
536
|
let M = match;
|
|
@@ -588,20 +588,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
|
|
|
588
588
|
function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
|
|
589
589
|
return async (args, basename, trailingSlashAware, targetRoutes) => {
|
|
590
590
|
let { request, context } = args;
|
|
591
|
-
let url =
|
|
591
|
+
let url = _chunkLKUVSIBAjs.singleFetchUrl.call(void 0, request.url, basename, trailingSlashAware, "rsc");
|
|
592
592
|
if (request.method === "GET") {
|
|
593
|
-
url =
|
|
593
|
+
url = _chunkLKUVSIBAjs.stripIndexParam.call(void 0, url);
|
|
594
594
|
if (targetRoutes) {
|
|
595
595
|
url.searchParams.set("_routes", targetRoutes.join(","));
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
let res = await fetchImplementation(
|
|
599
|
-
new Request(url, await
|
|
599
|
+
new Request(url, await _chunkLKUVSIBAjs.createRequestInit.call(void 0, request))
|
|
600
600
|
);
|
|
601
601
|
if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
|
|
602
|
-
throw new (0,
|
|
602
|
+
throw new (0, _chunkLKUVSIBAjs.ErrorResponseImpl)(res.status, res.statusText, await res.text());
|
|
603
603
|
}
|
|
604
|
-
|
|
604
|
+
_chunkLKUVSIBAjs.invariant.call(void 0, res.body, "No response body to decode");
|
|
605
605
|
try {
|
|
606
606
|
const payload = await createFromReadableStream(res.body, {
|
|
607
607
|
temporaryReferences: void 0
|
|
@@ -625,7 +625,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
|
|
|
625
625
|
}
|
|
626
626
|
context.get(renderedRoutesContext).push(...payload.matches);
|
|
627
627
|
let results = { routes: {} };
|
|
628
|
-
const dataKey =
|
|
628
|
+
const dataKey = _chunkLKUVSIBAjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
|
|
629
629
|
for (let [routeId, data] of Object.entries(payload[dataKey] || {})) {
|
|
630
630
|
results.routes[routeId] = { data };
|
|
631
631
|
}
|
|
@@ -658,7 +658,7 @@ function RSCHydratedRouter({
|
|
|
658
658
|
[createFromReadableStream, payload, fetchImplementation, getContext]
|
|
659
659
|
);
|
|
660
660
|
React3.useEffect(() => {
|
|
661
|
-
|
|
661
|
+
_chunkLKUVSIBAjs.setIsHydrated.call(void 0, );
|
|
662
662
|
}, []);
|
|
663
663
|
React3.useLayoutEffect(() => {
|
|
664
664
|
const globalVar = window;
|
|
@@ -764,8 +764,8 @@ function RSCHydratedRouter({
|
|
|
764
764
|
routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
|
|
765
765
|
routeModules
|
|
766
766
|
};
|
|
767
|
-
return /* @__PURE__ */ React3.createElement(
|
|
768
|
-
|
|
767
|
+
return /* @__PURE__ */ React3.createElement(_chunkLKUVSIBAjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkCAFVLUDYjs.RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(_chunkLKUVSIBAjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
|
768
|
+
_chunkLKUVSIBAjs.RouterProvider,
|
|
769
769
|
{
|
|
770
770
|
router: transitionEnabledRouter,
|
|
771
771
|
flushSync: ReactDOM2.flushSync
|
|
@@ -781,8 +781,8 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
781
781
|
// the server loader flow regardless of whether the client loader calls
|
|
782
782
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
783
783
|
match.hasComponent && !match.element;
|
|
784
|
-
|
|
785
|
-
|
|
784
|
+
_chunkLKUVSIBAjs.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
785
|
+
_chunkCAFVLUDYjs.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
|
|
786
786
|
let dataRoute = {
|
|
787
787
|
id: match.id,
|
|
788
788
|
element: match.element,
|
|
@@ -832,7 +832,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
832
832
|
return await callSingleFetch(singleFetch);
|
|
833
833
|
}
|
|
834
834
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
835
|
-
throw
|
|
835
|
+
throw _chunkLKUVSIBAjs.noActionDefinedError.call(void 0, "action", match.id);
|
|
836
836
|
},
|
|
837
837
|
path: match.path,
|
|
838
838
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -845,7 +845,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
845
845
|
hasShouldRevalidate: match.shouldRevalidate != null
|
|
846
846
|
};
|
|
847
847
|
if (typeof dataRoute.loader === "function") {
|
|
848
|
-
dataRoute.loader.hydrate =
|
|
848
|
+
dataRoute.loader.hydrate = _chunkLKUVSIBAjs.shouldHydrateRouteLoader.call(void 0,
|
|
849
849
|
match.id,
|
|
850
850
|
match.clientLoader,
|
|
851
851
|
match.hasLoader,
|
|
@@ -855,7 +855,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
855
855
|
return dataRoute;
|
|
856
856
|
}
|
|
857
857
|
function callSingleFetch(singleFetch) {
|
|
858
|
-
|
|
858
|
+
_chunkLKUVSIBAjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
859
859
|
return singleFetch();
|
|
860
860
|
}
|
|
861
861
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -863,7 +863,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
863
863
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
864
864
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
865
865
|
console.error(msg);
|
|
866
|
-
throw new (0,
|
|
866
|
+
throw new (0, _chunkLKUVSIBAjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
869
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -935,7 +935,7 @@ function isExternalLocation(location2) {
|
|
|
935
935
|
}
|
|
936
936
|
function hasInvalidProtocol(location2) {
|
|
937
937
|
try {
|
|
938
|
-
return
|
|
938
|
+
return _chunkLKUVSIBAjs.invalidProtocols.includes(new URL(location2).protocol);
|
|
939
939
|
} catch (e2) {
|
|
940
940
|
return false;
|
|
941
941
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.13.2
|
|
2
|
+
* react-router v7.13.2
|
|
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-PY35PE22.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-2BDJPJTA.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.13.2
|
|
2
|
+
* react-router v7.13.2
|
|
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 _chunkXAAX7KIKjs = require('./chunk-XAAX7KIK.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -34,7 +34,7 @@ var _chunkC3CA6GXOjs = require('./chunk-C3CA6GXO.js');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkLKUVSIBAjs = require('./chunk-LKUVSIBA.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunk6A7E6W56js = require('./chunk-6A7E6W56.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.BrowserRouter =
|
|
61
|
+
exports.BrowserRouter = _chunkXAAX7KIKjs.BrowserRouter; exports.Form = _chunkXAAX7KIKjs.Form; exports.HashRouter = _chunkXAAX7KIKjs.HashRouter; exports.Link = _chunkXAAX7KIKjs.Link; exports.Links = _chunkLKUVSIBAjs.Links; exports.MemoryRouter = _chunkLKUVSIBAjs.MemoryRouter; exports.Meta = _chunkLKUVSIBAjs.Meta; exports.NavLink = _chunkXAAX7KIKjs.NavLink; exports.Navigate = _chunkLKUVSIBAjs.Navigate; exports.Outlet = _chunkLKUVSIBAjs.Outlet; exports.Route = _chunkLKUVSIBAjs.Route; exports.Router = _chunkLKUVSIBAjs.Router; exports.RouterProvider = _chunkLKUVSIBAjs.RouterProvider; exports.Routes = _chunkLKUVSIBAjs.Routes; exports.ScrollRestoration = _chunkXAAX7KIKjs.ScrollRestoration; exports.StaticRouter = _chunkXAAX7KIKjs.StaticRouter; exports.StaticRouterProvider = _chunkXAAX7KIKjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkLKUVSIBAjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunkLKUVSIBAjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkLKUVSIBAjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkLKUVSIBAjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkXAAX7KIKjs.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.13.2
|
|
2
|
+
* react-router v7.13.2
|
|
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-2BDJPJTA.mjs";
|
|
36
36
|
export {
|
|
37
37
|
BrowserRouter,
|
|
38
38
|
Form,
|