react-router 7.11.0-pre.0 → 7.11.0
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 +20 -3
- package/dist/{production/chunk-M5W3Q3T5.js → development/chunk-2JY4UAJA.js} +93 -93
- package/dist/{production/chunk-YGB3JEIP.js → development/chunk-GNDLROV6.js} +7 -7
- package/dist/development/{chunk-KRMLYMWA.mjs → chunk-JMJ3UQ3L.mjs} +2 -2
- package/dist/development/{chunk-UO7KGW2U.js → chunk-SZQUWNVJ.js} +1 -1
- package/dist/{production/chunk-J4JITZ76.mjs → development/chunk-YNUBSHFH.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 +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-AO22ZXHI.js → chunk-2HFJAX7U.js} +1 -1
- package/dist/{development/chunk-OVG6YSZ5.js → production/chunk-BEXOWXJO.js} +7 -7
- package/dist/{development/chunk-QMKP6CC3.mjs → production/chunk-E6GYEQUT.mjs} +2 -2
- package/dist/production/{chunk-IDHO4Q57.mjs → chunk-TINMVEA2.mjs} +2 -2
- package/dist/{development/chunk-JKMHOZYW.js → production/chunk-ZMYPVUNZ.js} +93 -93
- 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 _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.11.0
|
|
2
|
+
* react-router v7.11.0
|
|
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 _chunkBEXOWXJOjs = require('./chunk-BEXOWXJO.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -32,7 +32,7 @@ var _chunkYGB3JEIPjs = require('./chunk-YGB3JEIP.js');
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunk2HFJAX7Ujs = require('./chunk-2HFJAX7U.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(`[${_chunk2HFJAX7Ujs.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
|
+
_chunkBEXOWXJOjs.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
|
+
_chunk2HFJAX7Ujs.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 = _chunk2HFJAX7Ujs.createRouter.call(void 0, {
|
|
405
405
|
routes,
|
|
406
406
|
getContext,
|
|
407
407
|
basename: payload.basename,
|
|
408
|
-
history:
|
|
409
|
-
hydrationData:
|
|
408
|
+
history: _chunk2HFJAX7Ujs.createBrowserHistory.call(void 0, ),
|
|
409
|
+
hydrationData: _chunkBEXOWXJOjs.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
|
+
_chunk2HFJAX7Ujs.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 = _chunk2HFJAX7Ujs.createContext.call(void 0, );
|
|
517
517
|
function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
|
|
518
|
-
let dataStrategy =
|
|
518
|
+
let dataStrategy = _chunk2HFJAX7Ujs.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 = _chunk2HFJAX7Ujs.singleFetchUrl.call(void 0, request.url, basename, "rsc");
|
|
575
575
|
if (request.method === "GET") {
|
|
576
|
-
url =
|
|
576
|
+
url = _chunk2HFJAX7Ujs.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 _chunk2HFJAX7Ujs.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, _chunk2HFJAX7Ujs.ErrorResponseImpl)(res.status, res.statusText, await res.text());
|
|
586
586
|
}
|
|
587
|
-
|
|
587
|
+
_chunk2HFJAX7Ujs.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 = _chunk2HFJAX7Ujs.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
|
+
_chunk2HFJAX7Ujs.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(_chunk2HFJAX7Ujs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkBEXOWXJOjs.RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(_chunk2HFJAX7Ujs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
|
|
747
|
+
_chunk2HFJAX7Ujs.RouterProvider,
|
|
748
748
|
{
|
|
749
749
|
router: transitionEnabledRouter,
|
|
750
750
|
flushSync: ReactDOM2.flushSync
|
|
@@ -760,8 +760,8 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
760
760
|
// the server loader flow regardless of whether the client loader calls
|
|
761
761
|
// `serverLoader` or not, otherwise we'll have nothing to render.
|
|
762
762
|
match.hasComponent && !match.element;
|
|
763
|
-
|
|
764
|
-
|
|
763
|
+
_chunk2HFJAX7Ujs.invariant.call(void 0, window.__reactRouterRouteModules);
|
|
764
|
+
_chunkBEXOWXJOjs.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
|
|
765
765
|
let dataRoute = {
|
|
766
766
|
id: match.id,
|
|
767
767
|
element: match.element,
|
|
@@ -811,7 +811,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
811
811
|
return await callSingleFetch(singleFetch);
|
|
812
812
|
}
|
|
813
813
|
}) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
|
|
814
|
-
throw
|
|
814
|
+
throw _chunk2HFJAX7Ujs.noActionDefinedError.call(void 0, "action", match.id);
|
|
815
815
|
},
|
|
816
816
|
path: match.path,
|
|
817
817
|
shouldRevalidate: match.shouldRevalidate,
|
|
@@ -824,7 +824,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
824
824
|
hasShouldRevalidate: match.shouldRevalidate != null
|
|
825
825
|
};
|
|
826
826
|
if (typeof dataRoute.loader === "function") {
|
|
827
|
-
dataRoute.loader.hydrate =
|
|
827
|
+
dataRoute.loader.hydrate = _chunk2HFJAX7Ujs.shouldHydrateRouteLoader.call(void 0,
|
|
828
828
|
match.id,
|
|
829
829
|
match.clientLoader,
|
|
830
830
|
match.hasLoader,
|
|
@@ -834,7 +834,7 @@ function createRouteFromServerManifest(match, payload) {
|
|
|
834
834
|
return dataRoute;
|
|
835
835
|
}
|
|
836
836
|
function callSingleFetch(singleFetch) {
|
|
837
|
-
|
|
837
|
+
_chunk2HFJAX7Ujs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
|
|
838
838
|
return singleFetch();
|
|
839
839
|
}
|
|
840
840
|
function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
@@ -842,7 +842,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
|
|
|
842
842
|
let fn = type === "action" ? "serverAction()" : "serverLoader()";
|
|
843
843
|
let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
|
|
844
844
|
console.error(msg);
|
|
845
|
-
throw new (0,
|
|
845
|
+
throw new (0, _chunk2HFJAX7Ujs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
848
|
var nextPaths = /* @__PURE__ */ new Set();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.11.0
|
|
2
|
+
* react-router v7.11.0
|
|
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-E6GYEQUT.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-TINMVEA2.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.11.0
|
|
2
|
+
* react-router v7.11.0
|
|
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 _chunkZMYPVUNZjs = require('./chunk-ZMYPVUNZ.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -34,7 +34,7 @@ var _chunkM5W3Q3T5js = require('./chunk-M5W3Q3T5.js');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunk2HFJAX7Ujs = require('./chunk-2HFJAX7U.js');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -58,4 +58,4 @@ var _chunkAO22ZXHIjs = require('./chunk-AO22ZXHI.js');
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
exports.BrowserRouter =
|
|
61
|
+
exports.BrowserRouter = _chunkZMYPVUNZjs.BrowserRouter; exports.Form = _chunkZMYPVUNZjs.Form; exports.HashRouter = _chunkZMYPVUNZjs.HashRouter; exports.Link = _chunkZMYPVUNZjs.Link; exports.Links = _chunk2HFJAX7Ujs.Links; exports.MemoryRouter = _chunk2HFJAX7Ujs.MemoryRouter; exports.Meta = _chunk2HFJAX7Ujs.Meta; exports.NavLink = _chunkZMYPVUNZjs.NavLink; exports.Navigate = _chunk2HFJAX7Ujs.Navigate; exports.Outlet = _chunk2HFJAX7Ujs.Outlet; exports.Route = _chunk2HFJAX7Ujs.Route; exports.Router = _chunk2HFJAX7Ujs.Router; exports.RouterProvider = _chunk2HFJAX7Ujs.RouterProvider; exports.Routes = _chunk2HFJAX7Ujs.Routes; exports.ScrollRestoration = _chunkZMYPVUNZjs.ScrollRestoration; exports.StaticRouter = _chunkZMYPVUNZjs.StaticRouter; exports.StaticRouterProvider = _chunkZMYPVUNZjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunk2HFJAX7Ujs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunk2HFJAX7Ujs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunk2HFJAX7Ujs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunk2HFJAX7Ujs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkZMYPVUNZjs.HistoryRouter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.11.0
|
|
2
|
+
* react-router v7.11.0
|
|
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-TINMVEA2.mjs";
|
|
36
36
|
export {
|
|
37
37
|
BrowserRouter,
|
|
38
38
|
Form,
|