react-router 7.7.0 → 7.7.1-pre.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 +11 -28
- package/dist/development/{browser-CcxeZJcQ.d.mts → browser-7LYX59NK.d.mts} +97 -1
- package/dist/development/{chunk-V6PEDDZI.js → chunk-4DODSFAK.js} +79 -76
- package/dist/development/{chunk-EF7DTUVF.mjs → chunk-FSG5FGWQ.mjs} +83 -80
- package/dist/{production/chunk-2TYFPE3B.js → development/chunk-JKVEU2V7.js} +132 -132
- package/dist/{production/chunk-GNZILI6H.mjs → development/chunk-KFHXRAUZ.mjs} +3 -5
- package/dist/development/components-CjQijYga.d.mts +802 -0
- package/dist/development/dom-export.d.mts +13 -6
- package/dist/development/dom-export.d.ts +10 -3
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/index-react-server-client-Bi_fx8qz.d.ts +3163 -0
- package/dist/development/index-react-server-client-KLg-U4nr.d.mts +2366 -0
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +2 -2
- 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.d.mts +109 -2
- package/dist/development/index-react-server.d.ts +109 -2
- package/dist/development/index-react-server.js +28 -20
- package/dist/development/index-react-server.mjs +29 -21
- package/dist/development/index.d.mts +918 -287
- package/dist/development/index.d.ts +1010 -283
- package/dist/development/index.js +98 -100
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.d.mts +1 -1
- package/dist/development/lib/types/internal.d.ts +1 -1
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/{production/route-data-DjzmHYNR.d.mts → development/route-data-CqEmXQub.d.mts} +48 -2
- package/dist/{production/routeModules-g5PTiDfO.d.ts → development/routeModules-BR2FO0ix.d.ts} +48 -2
- package/dist/production/{browser-CcxeZJcQ.d.mts → browser-7LYX59NK.d.mts} +97 -1
- package/dist/production/{chunk-5KHO4FML.js → chunk-BPUKNCMM.js} +79 -76
- package/dist/production/{chunk-WPPIQDYG.mjs → chunk-J4LDCI7O.mjs} +83 -80
- package/dist/{development/chunk-T3VM44WY.mjs → production/chunk-MZVTKUZ4.mjs} +3 -5
- package/dist/{development/chunk-4ADB4KIO.js → production/chunk-PVPY6FX7.js} +132 -132
- package/dist/production/components-CjQijYga.d.mts +802 -0
- package/dist/production/dom-export.d.mts +13 -6
- package/dist/production/dom-export.d.ts +10 -3
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/index-react-server-client-Bi_fx8qz.d.ts +3163 -0
- package/dist/production/index-react-server-client-KLg-U4nr.d.mts +2366 -0
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +2 -2
- 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.d.mts +109 -2
- package/dist/production/index-react-server.d.ts +109 -2
- package/dist/production/index-react-server.js +28 -20
- package/dist/production/index-react-server.mjs +29 -21
- package/dist/production/index.d.mts +918 -287
- package/dist/production/index.d.ts +1010 -283
- package/dist/production/index.js +98 -100
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.d.mts +1 -1
- package/dist/production/lib/types/internal.d.ts +1 -1
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/{development/route-data-DjzmHYNR.d.mts → production/route-data-CqEmXQub.d.mts} +48 -2
- package/dist/{development/routeModules-g5PTiDfO.d.ts → production/routeModules-BR2FO0ix.d.ts} +48 -2
- package/package.json +1 -1
- package/dist/development/components-DzqPLVI1.d.mts +0 -464
- package/dist/development/index-react-server-client-CUidsuu_.d.mts +0 -1360
- package/dist/development/index-react-server-client-kY8DvDF3.d.ts +0 -1819
- package/dist/production/components-DzqPLVI1.d.mts +0 -464
- package/dist/production/index-react-server-client-CUidsuu_.d.mts +0 -1360
- package/dist/production/index-react-server-client-kY8DvDF3.d.ts +0 -1819
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.7.0
|
|
2
|
+
* react-router v7.7.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -2305,9 +2305,7 @@ function createRouter(init) {
|
|
|
2305
2305
|
)
|
|
2306
2306
|
};
|
|
2307
2307
|
} else {
|
|
2308
|
-
dataResults[routeId] = await convertDataStrategyResultToDataResult(
|
|
2309
|
-
result
|
|
2310
|
-
);
|
|
2308
|
+
dataResults[routeId] = await convertDataStrategyResultToDataResult(result);
|
|
2311
2309
|
}
|
|
2312
2310
|
}
|
|
2313
2311
|
return dataResults;
|
|
@@ -4163,7 +4161,10 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
|
|
|
4163
4161
|
});
|
|
4164
4162
|
try {
|
|
4165
4163
|
await Promise.all(
|
|
4166
|
-
matches.flatMap((m) => [
|
|
4164
|
+
matches.flatMap((m) => [
|
|
4165
|
+
m._lazyPromises?.handler,
|
|
4166
|
+
m._lazyPromises?.route
|
|
4167
|
+
])
|
|
4167
4168
|
);
|
|
4168
4169
|
} catch (e) {
|
|
4169
4170
|
}
|
|
@@ -5233,68 +5234,71 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
|
|
|
5233
5234
|
}
|
|
5234
5235
|
}
|
|
5235
5236
|
}
|
|
5236
|
-
return renderedMatches.reduceRight(
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
if (
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5237
|
+
return renderedMatches.reduceRight(
|
|
5238
|
+
(outlet, match, index) => {
|
|
5239
|
+
let error;
|
|
5240
|
+
let shouldRenderHydrateFallback = false;
|
|
5241
|
+
let errorElement = null;
|
|
5242
|
+
let hydrateFallbackElement = null;
|
|
5243
|
+
if (dataRouterState) {
|
|
5244
|
+
error = errors && match.route.id ? errors[match.route.id] : void 0;
|
|
5245
|
+
errorElement = match.route.errorElement || defaultErrorElement;
|
|
5246
|
+
if (renderFallback) {
|
|
5247
|
+
if (fallbackIndex < 0 && index === 0) {
|
|
5248
|
+
warningOnce(
|
|
5249
|
+
"route-fallback",
|
|
5250
|
+
false,
|
|
5251
|
+
"No `HydrateFallback` element provided to render during initial hydration"
|
|
5252
|
+
);
|
|
5253
|
+
shouldRenderHydrateFallback = true;
|
|
5254
|
+
hydrateFallbackElement = null;
|
|
5255
|
+
} else if (fallbackIndex === index) {
|
|
5256
|
+
shouldRenderHydrateFallback = true;
|
|
5257
|
+
hydrateFallbackElement = match.route.hydrateFallbackElement || null;
|
|
5258
|
+
}
|
|
5256
5259
|
}
|
|
5257
5260
|
}
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5261
|
+
let matches2 = parentMatches.concat(renderedMatches.slice(0, index + 1));
|
|
5262
|
+
let getChildren = () => {
|
|
5263
|
+
let children;
|
|
5264
|
+
if (error) {
|
|
5265
|
+
children = errorElement;
|
|
5266
|
+
} else if (shouldRenderHydrateFallback) {
|
|
5267
|
+
children = hydrateFallbackElement;
|
|
5268
|
+
} else if (match.route.Component) {
|
|
5269
|
+
children = /* @__PURE__ */ React2.createElement(match.route.Component, null);
|
|
5270
|
+
} else if (match.route.element) {
|
|
5271
|
+
children = match.route.element;
|
|
5272
|
+
} else {
|
|
5273
|
+
children = outlet;
|
|
5274
|
+
}
|
|
5275
|
+
return /* @__PURE__ */ React2.createElement(
|
|
5276
|
+
RenderedRoute,
|
|
5277
|
+
{
|
|
5278
|
+
match,
|
|
5279
|
+
routeContext: {
|
|
5280
|
+
outlet,
|
|
5281
|
+
matches: matches2,
|
|
5282
|
+
isDataRoute: dataRouterState != null
|
|
5283
|
+
},
|
|
5284
|
+
children
|
|
5285
|
+
}
|
|
5286
|
+
);
|
|
5287
|
+
};
|
|
5288
|
+
return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /* @__PURE__ */ React2.createElement(
|
|
5289
|
+
RenderErrorBoundary,
|
|
5275
5290
|
{
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
}
|
|
5282
|
-
children
|
|
5291
|
+
location: dataRouterState.location,
|
|
5292
|
+
revalidation: dataRouterState.revalidation,
|
|
5293
|
+
component: errorElement,
|
|
5294
|
+
error,
|
|
5295
|
+
children: getChildren(),
|
|
5296
|
+
routeContext: { outlet: null, matches: matches2, isDataRoute: true }
|
|
5283
5297
|
}
|
|
5284
|
-
);
|
|
5285
|
-
}
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
{
|
|
5289
|
-
location: dataRouterState.location,
|
|
5290
|
-
revalidation: dataRouterState.revalidation,
|
|
5291
|
-
component: errorElement,
|
|
5292
|
-
error,
|
|
5293
|
-
children: getChildren(),
|
|
5294
|
-
routeContext: { outlet: null, matches: matches2, isDataRoute: true }
|
|
5295
|
-
}
|
|
5296
|
-
) : getChildren();
|
|
5297
|
-
}, null);
|
|
5298
|
+
) : getChildren();
|
|
5299
|
+
},
|
|
5300
|
+
null
|
|
5301
|
+
);
|
|
5298
5302
|
}
|
|
5299
5303
|
function getDataRouterConsoleError(hookName) {
|
|
5300
5304
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
@@ -5802,7 +5806,7 @@ function Navigate({
|
|
|
5802
5806
|
function Outlet(props) {
|
|
5803
5807
|
return useOutlet(props.context);
|
|
5804
5808
|
}
|
|
5805
|
-
function Route(
|
|
5809
|
+
function Route(props) {
|
|
5806
5810
|
invariant(
|
|
5807
5811
|
false,
|
|
5808
5812
|
`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`
|
|
@@ -6818,8 +6822,10 @@ function encode(input, options) {
|
|
|
6818
6822
|
lastSentIndex++;
|
|
6819
6823
|
} else if (id2 < 0) {
|
|
6820
6824
|
controller.enqueue(
|
|
6821
|
-
textEncoder.encode(
|
|
6822
|
-
|
|
6825
|
+
textEncoder.encode(
|
|
6826
|
+
`${TYPE_ERROR}${deferredId}:${id2}
|
|
6827
|
+
`
|
|
6828
|
+
)
|
|
6823
6829
|
);
|
|
6824
6830
|
} else {
|
|
6825
6831
|
const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
|
|
@@ -8352,10 +8358,7 @@ function Links() {
|
|
|
8352
8358
|
({ key, link }) => isPageLinkDescriptor(link) ? /* @__PURE__ */ React8.createElement(PrefetchPageLinks, { key, ...link }) : /* @__PURE__ */ React8.createElement("link", { key, ...link })
|
|
8353
8359
|
));
|
|
8354
8360
|
}
|
|
8355
|
-
function PrefetchPageLinks({
|
|
8356
|
-
page,
|
|
8357
|
-
...dataLinkProps
|
|
8358
|
-
}) {
|
|
8361
|
+
function PrefetchPageLinks({ page, ...linkProps }) {
|
|
8359
8362
|
let { router } = useDataRouterContext2();
|
|
8360
8363
|
let matches = React8.useMemo(
|
|
8361
8364
|
() => matchRoutes(router.routes, page, router.basename),
|
|
@@ -8364,7 +8367,7 @@ function PrefetchPageLinks({
|
|
|
8364
8367
|
if (!matches) {
|
|
8365
8368
|
return null;
|
|
8366
8369
|
}
|
|
8367
|
-
return /* @__PURE__ */ React8.createElement(PrefetchPageLinksImpl, { page, matches, ...
|
|
8370
|
+
return /* @__PURE__ */ React8.createElement(PrefetchPageLinksImpl, { page, matches, ...linkProps });
|
|
8368
8371
|
}
|
|
8369
8372
|
function useKeyedPrefetchLinks(matches) {
|
|
8370
8373
|
let { manifest, routeModules } = useFrameworkContext();
|
|
@@ -8568,7 +8571,7 @@ function isValidMetaTag(tagName) {
|
|
|
8568
8571
|
return typeof tagName === "string" && /^(meta|link)$/.test(tagName);
|
|
8569
8572
|
}
|
|
8570
8573
|
var isHydrated = false;
|
|
8571
|
-
function Scripts(
|
|
8574
|
+
function Scripts(scriptProps) {
|
|
8572
8575
|
let {
|
|
8573
8576
|
manifest,
|
|
8574
8577
|
serverHandoffString,
|
|
@@ -8654,7 +8657,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
|
|
|
8654
8657
|
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(
|
|
8655
8658
|
"script",
|
|
8656
8659
|
{
|
|
8657
|
-
...
|
|
8660
|
+
...scriptProps,
|
|
8658
8661
|
suppressHydrationWarning: true,
|
|
8659
8662
|
dangerouslySetInnerHTML: createHtml(contextScript),
|
|
8660
8663
|
type: void 0
|
|
@@ -8662,7 +8665,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
|
|
|
8662
8665
|
), /* @__PURE__ */ React8.createElement(
|
|
8663
8666
|
"script",
|
|
8664
8667
|
{
|
|
8665
|
-
...
|
|
8668
|
+
...scriptProps,
|
|
8666
8669
|
suppressHydrationWarning: true,
|
|
8667
8670
|
dangerouslySetInnerHTML: createHtml(routeModulesScript),
|
|
8668
8671
|
type: "module",
|
|
@@ -8699,7 +8702,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
|
|
|
8699
8702
|
{
|
|
8700
8703
|
rel: "modulepreload",
|
|
8701
8704
|
href: manifest.url,
|
|
8702
|
-
crossOrigin:
|
|
8705
|
+
crossOrigin: scriptProps.crossOrigin,
|
|
8703
8706
|
integrity: sri[manifest.url],
|
|
8704
8707
|
suppressHydrationWarning: true
|
|
8705
8708
|
}
|
|
@@ -8708,7 +8711,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
|
|
|
8708
8711
|
{
|
|
8709
8712
|
rel: "modulepreload",
|
|
8710
8713
|
href: manifest.entry.module,
|
|
8711
|
-
crossOrigin:
|
|
8714
|
+
crossOrigin: scriptProps.crossOrigin,
|
|
8712
8715
|
integrity: sri[manifest.entry.module],
|
|
8713
8716
|
suppressHydrationWarning: true
|
|
8714
8717
|
}
|
|
@@ -8718,7 +8721,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
|
|
|
8718
8721
|
key: path,
|
|
8719
8722
|
rel: "modulepreload",
|
|
8720
8723
|
href: path,
|
|
8721
|
-
crossOrigin:
|
|
8724
|
+
crossOrigin: scriptProps.crossOrigin,
|
|
8722
8725
|
integrity: sri[path],
|
|
8723
8726
|
suppressHydrationWarning: true
|
|
8724
8727
|
}
|
|
@@ -8842,7 +8845,7 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
8842
8845
|
try {
|
|
8843
8846
|
if (isBrowser) {
|
|
8844
8847
|
window.__reactRouterVersion = // @ts-expect-error
|
|
8845
|
-
"7.7.0";
|
|
8848
|
+
"7.7.1-pre.0";
|
|
8846
8849
|
}
|
|
8847
8850
|
} catch (e) {
|
|
8848
8851
|
}
|
|
@@ -9640,7 +9643,7 @@ function usePrompt({
|
|
|
9640
9643
|
}
|
|
9641
9644
|
}, [blocker, when]);
|
|
9642
9645
|
}
|
|
9643
|
-
function useViewTransitionState(to,
|
|
9646
|
+
function useViewTransitionState(to, { relative } = {}) {
|
|
9644
9647
|
let vtContext = React10.useContext(ViewTransitionContext);
|
|
9645
9648
|
invariant(
|
|
9646
9649
|
vtContext != null,
|
|
@@ -9649,7 +9652,7 @@ function useViewTransitionState(to, opts = {}) {
|
|
|
9649
9652
|
let { basename } = useDataRouterContext3(
|
|
9650
9653
|
"useViewTransitionState" /* useViewTransitionState */
|
|
9651
9654
|
);
|
|
9652
|
-
let path = useResolvedPath(to, { relative
|
|
9655
|
+
let path = useResolvedPath(to, { relative });
|
|
9653
9656
|
if (!vtContext.isTransitioning) {
|
|
9654
9657
|
return false;
|
|
9655
9658
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.7.0
|
|
2
|
+
* react-router v7.7.1-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
withComponentProps,
|
|
58
58
|
withErrorBoundaryProps,
|
|
59
59
|
withHydrateFallbackProps
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-J4LDCI7O.mjs";
|
|
61
61
|
|
|
62
62
|
// lib/dom/ssr/server.tsx
|
|
63
63
|
import * as React from "react";
|
|
@@ -2493,9 +2493,7 @@ async function routeRSCServerRequest({
|
|
|
2493
2493
|
throw reason;
|
|
2494
2494
|
}
|
|
2495
2495
|
}
|
|
2496
|
-
function RSCStaticRouter({
|
|
2497
|
-
getPayload
|
|
2498
|
-
}) {
|
|
2496
|
+
function RSCStaticRouter({ getPayload }) {
|
|
2499
2497
|
const payload = React5.use(getPayload());
|
|
2500
2498
|
if (payload.type === "redirect") {
|
|
2501
2499
|
throw new Response(null, {
|