react-router 7.6.3 → 7.7.0-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 +41 -0
- package/dist/development/browser-BSrXyLft.d.mts +157 -0
- package/dist/development/chunk-P37AORTA.js +21 -0
- package/dist/development/{chunk-QMGIS6GS.mjs → chunk-PUMRC5B5.mjs} +1473 -3024
- package/dist/development/chunk-PY5DBM7W.mjs +2695 -0
- package/dist/development/chunk-X5ZUQHCD.js +10021 -0
- package/dist/development/components-IaVqGBuO.d.mts +816 -0
- package/dist/development/dom-export.d.mts +4 -2
- package/dist/development/dom-export.js +57 -76
- package/dist/development/dom-export.mjs +11 -8
- package/dist/development/index-react-server-client-DOK8MfYF.d.mts +1360 -0
- package/dist/development/{lib-B33EY9A0.d.mts → index-react-server-client-LrDNRnlX.d.ts} +39 -5
- package/dist/development/index-react-server-client.d.mts +4 -0
- package/dist/development/index-react-server-client.d.ts +3 -0
- package/dist/development/index-react-server-client.js +54 -0
- package/dist/development/index-react-server-client.mjs +53 -0
- package/dist/development/index-react-server.d.mts +1863 -0
- package/dist/development/index-react-server.d.ts +1863 -0
- package/dist/development/index-react-server.js +3196 -0
- package/dist/development/index-react-server.mjs +3083 -0
- package/dist/development/index.d.mts +33 -47
- package/dist/development/index.d.ts +195 -2190
- package/dist/development/index.js +2596 -11444
- package/dist/development/index.mjs +33 -18
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +2 -1
- package/dist/development/lib/types/internal.js +2 -20
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/{production/register-DeIo2iHO.d.mts → development/register-DiOIlEq5.d.mts} +1 -1
- package/dist/development/{register-DeIo2iHO.d.mts → register-DiOIlEq5.d.ts} +1 -1
- package/dist/development/{route-data-D7Xbr_Ww.d.mts → route-data-7aXBQ4I3.d.ts} +26 -15
- package/dist/{production/route-data-D7Xbr_Ww.d.mts → development/route-data-DAw7Esur.d.mts} +16 -5
- package/dist/production/browser-BSrXyLft.d.mts +157 -0
- package/dist/production/{chunk-S4Z2UWCU.mjs → chunk-5AMJKWMN.mjs} +1473 -3024
- package/dist/production/chunk-KWWBKJDT.mjs +2695 -0
- package/dist/production/chunk-LKVDO7TU.js +10021 -0
- package/dist/production/chunk-P37AORTA.js +21 -0
- package/dist/production/components-IaVqGBuO.d.mts +816 -0
- package/dist/production/dom-export.d.mts +4 -2
- package/dist/production/dom-export.js +57 -76
- package/dist/production/dom-export.mjs +11 -8
- package/dist/production/index-react-server-client-DOK8MfYF.d.mts +1360 -0
- package/dist/production/{lib-B33EY9A0.d.mts → index-react-server-client-LrDNRnlX.d.ts} +39 -5
- package/dist/production/index-react-server-client.d.mts +4 -0
- package/dist/production/index-react-server-client.d.ts +3 -0
- package/dist/production/index-react-server-client.js +54 -0
- package/dist/production/index-react-server-client.mjs +53 -0
- package/dist/production/index-react-server.d.mts +1863 -0
- package/dist/production/index-react-server.d.ts +1863 -0
- package/dist/production/index-react-server.js +3196 -0
- package/dist/production/index-react-server.mjs +3083 -0
- package/dist/production/index.d.mts +33 -47
- package/dist/production/index.d.ts +195 -2190
- package/dist/production/index.js +2596 -11444
- package/dist/production/index.mjs +33 -18
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +2 -1
- package/dist/production/lib/types/internal.js +2 -20
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/register-DiOIlEq5.d.mts +24 -0
- package/dist/production/register-DiOIlEq5.d.ts +24 -0
- package/dist/production/{register-COAKzST_.d.ts → route-data-7aXBQ4I3.d.ts} +26 -38
- package/dist/{development/register-COAKzST_.d.ts → production/route-data-DAw7Esur.d.mts} +16 -28
- package/package.json +56 -11
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterProviderProps$1 } from './
|
|
3
|
-
import
|
|
2
|
+
import { R as RouterProviderProps$1 } from './components-IaVqGBuO.mjs';
|
|
3
|
+
import './browser-BSrXyLft.mjs';
|
|
4
|
+
import { R as RouterInit } from './route-data-DAw7Esur.mjs';
|
|
5
|
+
import 'node:async_hooks';
|
|
4
6
|
|
|
5
7
|
type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
|
|
6
8
|
declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* react-router v7.
|
|
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 _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.7.0-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -8,61 +8,43 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
"use
|
|
12
|
-
|
|
13
|
-
var __defProp = Object.defineProperty;
|
|
14
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
17
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
|
-
var __export = (target, all) => {
|
|
19
|
-
for (var name in all)
|
|
20
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
21
|
-
};
|
|
22
|
-
var __copyProps = (to, from, except, desc) => {
|
|
23
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
24
|
-
for (let key of __getOwnPropNames(from))
|
|
25
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
26
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
27
|
-
}
|
|
28
|
-
return to;
|
|
29
|
-
};
|
|
30
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
31
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
32
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
33
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
34
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
35
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
36
|
-
mod
|
|
37
|
-
));
|
|
38
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
39
|
-
|
|
40
|
-
// dom-export.ts
|
|
41
|
-
var dom_export_exports = {};
|
|
42
|
-
__export(dom_export_exports, {
|
|
43
|
-
HydratedRouter: () => HydratedRouter,
|
|
44
|
-
RouterProvider: () => RouterProvider
|
|
45
|
-
});
|
|
46
|
-
module.exports = __toCommonJS(dom_export_exports);
|
|
11
|
+
"use client";
|
|
12
|
+
require('./chunk-P37AORTA.js');
|
|
47
13
|
|
|
48
14
|
// lib/dom-export/dom-router-provider.tsx
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
15
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
|
|
16
|
+
var _reactdom = require('react-dom'); var ReactDOM = _interopRequireWildcard(_reactdom);
|
|
17
|
+
var _reactrouter = require('react-router');
|
|
52
18
|
function RouterProvider(props) {
|
|
53
|
-
return /* @__PURE__ */ React.createElement(
|
|
19
|
+
return /* @__PURE__ */ React.createElement(_reactrouter.RouterProvider, { flushSync: ReactDOM.flushSync, ...props });
|
|
54
20
|
}
|
|
55
21
|
|
|
56
22
|
// lib/dom-export/hydrated-router.tsx
|
|
57
|
-
|
|
58
|
-
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
59
41
|
var ssrInfo = null;
|
|
60
42
|
var router = null;
|
|
61
43
|
function initSsrInfo() {
|
|
62
44
|
if (!ssrInfo && window.__reactRouterContext && window.__reactRouterManifest && window.__reactRouterRouteModules) {
|
|
63
45
|
if (window.__reactRouterManifest.sri === true) {
|
|
64
46
|
const importMap = document.querySelector("script[rr-importmap]");
|
|
65
|
-
if (importMap
|
|
47
|
+
if (_optionalChain([importMap, 'optionalAccess', _ => _.textContent])) {
|
|
66
48
|
try {
|
|
67
49
|
window.__reactRouterManifest.sri = JSON.parse(
|
|
68
50
|
importMap.textContent
|
|
@@ -94,9 +76,9 @@ function createHydratedRouter({
|
|
|
94
76
|
let localSsrInfo = ssrInfo;
|
|
95
77
|
if (!ssrInfo.stateDecodingPromise) {
|
|
96
78
|
let stream = ssrInfo.context.stream;
|
|
97
|
-
(0,
|
|
79
|
+
_reactrouter.UNSAFE_invariant.call(void 0, stream, "No stream found for single fetch decoding");
|
|
98
80
|
ssrInfo.context.stream = void 0;
|
|
99
|
-
ssrInfo.stateDecodingPromise = (0,
|
|
81
|
+
ssrInfo.stateDecodingPromise = _reactrouter.UNSAFE_decodeViaTurboStream.call(void 0, stream, window).then((value) => {
|
|
100
82
|
ssrInfo.context.state = value.value;
|
|
101
83
|
localSsrInfo.stateDecodingPromise.value = true;
|
|
102
84
|
}).catch((e) => {
|
|
@@ -109,7 +91,7 @@ function createHydratedRouter({
|
|
|
109
91
|
if (!ssrInfo.stateDecodingPromise.value) {
|
|
110
92
|
throw ssrInfo.stateDecodingPromise;
|
|
111
93
|
}
|
|
112
|
-
let routes = (0,
|
|
94
|
+
let routes = _reactrouter.UNSAFE_createClientRoutes.call(void 0,
|
|
113
95
|
ssrInfo.manifest.routes,
|
|
114
96
|
ssrInfo.routeModules,
|
|
115
97
|
ssrInfo.context.state,
|
|
@@ -119,7 +101,7 @@ function createHydratedRouter({
|
|
|
119
101
|
let hydrationData = void 0;
|
|
120
102
|
if (ssrInfo.context.isSpaMode) {
|
|
121
103
|
let { loaderData } = ssrInfo.context.state;
|
|
122
|
-
if (ssrInfo.manifest.routes.root
|
|
104
|
+
if (_optionalChain([ssrInfo, 'access', _2 => _2.manifest, 'access', _3 => _3.routes, 'access', _4 => _4.root, 'optionalAccess', _5 => _5.hasLoader]) && loaderData && "root" in loaderData) {
|
|
123
105
|
hydrationData = {
|
|
124
106
|
loaderData: {
|
|
125
107
|
root: loaderData.root
|
|
@@ -127,41 +109,41 @@ function createHydratedRouter({
|
|
|
127
109
|
};
|
|
128
110
|
}
|
|
129
111
|
} else {
|
|
130
|
-
hydrationData = (0,
|
|
112
|
+
hydrationData = _reactrouter.UNSAFE_getHydrationData.call(void 0,
|
|
131
113
|
ssrInfo.context.state,
|
|
132
114
|
routes,
|
|
133
115
|
(routeId) => ({
|
|
134
|
-
clientLoader: ssrInfo.routeModules[routeId]
|
|
135
|
-
hasLoader: ssrInfo.manifest.routes[routeId]
|
|
136
|
-
hasHydrateFallback: ssrInfo.routeModules[routeId]
|
|
116
|
+
clientLoader: _optionalChain([ssrInfo, 'access', _6 => _6.routeModules, 'access', _7 => _7[routeId], 'optionalAccess', _8 => _8.clientLoader]),
|
|
117
|
+
hasLoader: _optionalChain([ssrInfo, 'access', _9 => _9.manifest, 'access', _10 => _10.routes, 'access', _11 => _11[routeId], 'optionalAccess', _12 => _12.hasLoader]) === true,
|
|
118
|
+
hasHydrateFallback: _optionalChain([ssrInfo, 'access', _13 => _13.routeModules, 'access', _14 => _14[routeId], 'optionalAccess', _15 => _15.HydrateFallback]) != null
|
|
137
119
|
}),
|
|
138
120
|
window.location,
|
|
139
|
-
window.__reactRouterContext
|
|
121
|
+
_optionalChain([window, 'access', _16 => _16.__reactRouterContext, 'optionalAccess', _17 => _17.basename]),
|
|
140
122
|
ssrInfo.context.isSpaMode
|
|
141
123
|
);
|
|
142
124
|
if (hydrationData && hydrationData.errors) {
|
|
143
|
-
hydrationData.errors = (0,
|
|
125
|
+
hydrationData.errors = _reactrouter.UNSAFE_deserializeErrors.call(void 0, hydrationData.errors);
|
|
144
126
|
}
|
|
145
127
|
}
|
|
146
|
-
let router2 = (0,
|
|
128
|
+
let router2 = _reactrouter.UNSAFE_createRouter.call(void 0, {
|
|
147
129
|
routes,
|
|
148
|
-
history: (0,
|
|
130
|
+
history: _reactrouter.UNSAFE_createBrowserHistory.call(void 0, ),
|
|
149
131
|
basename: ssrInfo.context.basename,
|
|
150
132
|
unstable_getContext,
|
|
151
133
|
hydrationData,
|
|
152
|
-
hydrationRouteProperties:
|
|
153
|
-
mapRouteProperties:
|
|
134
|
+
hydrationRouteProperties: _reactrouter.UNSAFE_hydrationRouteProperties,
|
|
135
|
+
mapRouteProperties: _reactrouter.UNSAFE_mapRouteProperties,
|
|
154
136
|
future: {
|
|
155
137
|
unstable_middleware: ssrInfo.context.future.unstable_middleware
|
|
156
138
|
},
|
|
157
|
-
dataStrategy: (0,
|
|
139
|
+
dataStrategy: _reactrouter.UNSAFE_getTurboStreamSingleFetchDataStrategy.call(void 0,
|
|
158
140
|
() => router2,
|
|
159
141
|
ssrInfo.manifest,
|
|
160
142
|
ssrInfo.routeModules,
|
|
161
143
|
ssrInfo.context.ssr,
|
|
162
144
|
ssrInfo.context.basename
|
|
163
145
|
),
|
|
164
|
-
patchRoutesOnNavigation: (0,
|
|
146
|
+
patchRoutesOnNavigation: _reactrouter.UNSAFE_getPatchRoutesOnNavigationFunction.call(void 0,
|
|
165
147
|
ssrInfo.manifest,
|
|
166
148
|
ssrInfo.routeModules,
|
|
167
149
|
ssrInfo.context.ssr,
|
|
@@ -176,7 +158,7 @@ function createHydratedRouter({
|
|
|
176
158
|
router2.initialize();
|
|
177
159
|
}
|
|
178
160
|
router2.createRoutesForHMR = /* spacer so ts-ignore does not affect the right hand of the assignment */
|
|
179
|
-
|
|
161
|
+
_reactrouter.UNSAFE_createClientRoutesWithHMRRevalidationOptOut;
|
|
180
162
|
window.__reactRouterDataRouter = router2;
|
|
181
163
|
return router2;
|
|
182
164
|
}
|
|
@@ -187,13 +169,13 @@ function HydratedRouter(props) {
|
|
|
187
169
|
});
|
|
188
170
|
}
|
|
189
171
|
let [criticalCss, setCriticalCss] = React2.useState(
|
|
190
|
-
process.env.NODE_ENV === "development" ? ssrInfo
|
|
172
|
+
process.env.NODE_ENV === "development" ? _optionalChain([ssrInfo, 'optionalAccess', _18 => _18.context, 'access', _19 => _19.criticalCss]) : void 0
|
|
191
173
|
);
|
|
192
|
-
|
|
193
|
-
if (
|
|
194
|
-
|
|
174
|
+
React2.useEffect(() => {
|
|
175
|
+
if (process.env.NODE_ENV === "development") {
|
|
176
|
+
setCriticalCss(void 0);
|
|
195
177
|
}
|
|
196
|
-
}
|
|
178
|
+
}, []);
|
|
197
179
|
let [location, setLocation] = React2.useState(router.state.location);
|
|
198
180
|
React2.useLayoutEffect(() => {
|
|
199
181
|
if (ssrInfo && ssrInfo.router && !ssrInfo.routerInitialized) {
|
|
@@ -210,8 +192,8 @@ function HydratedRouter(props) {
|
|
|
210
192
|
});
|
|
211
193
|
}
|
|
212
194
|
}, [location]);
|
|
213
|
-
(0,
|
|
214
|
-
(0,
|
|
195
|
+
_reactrouter.UNSAFE_invariant.call(void 0, ssrInfo, "ssrInfo unavailable for HydratedRouter");
|
|
196
|
+
_reactrouter.UNSAFE_useFogOFWarDiscovery.call(void 0,
|
|
215
197
|
router,
|
|
216
198
|
ssrInfo.manifest,
|
|
217
199
|
ssrInfo.routeModules,
|
|
@@ -223,7 +205,7 @@ function HydratedRouter(props) {
|
|
|
223
205
|
// This fragment is important to ensure we match the <ServerRouter> JSX
|
|
224
206
|
// structure so that useId values hydrate correctly
|
|
225
207
|
/* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
226
|
-
|
|
208
|
+
_reactrouter.UNSAFE_FrameworkContext.Provider,
|
|
227
209
|
{
|
|
228
210
|
value: {
|
|
229
211
|
manifest: ssrInfo.manifest,
|
|
@@ -235,12 +217,11 @@ function HydratedRouter(props) {
|
|
|
235
217
|
routeDiscovery: ssrInfo.context.routeDiscovery
|
|
236
218
|
}
|
|
237
219
|
},
|
|
238
|
-
/* @__PURE__ */ React2.createElement(
|
|
220
|
+
/* @__PURE__ */ React2.createElement(_reactrouter.UNSAFE_RemixErrorBoundary, { location }, /* @__PURE__ */ React2.createElement(RouterProvider, { router }))
|
|
239
221
|
), /* @__PURE__ */ React2.createElement(React2.Fragment, null))
|
|
240
222
|
);
|
|
241
223
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
});
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
exports.HydratedRouter = HydratedRouter; exports.RouterProvider = RouterProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.
|
|
2
|
+
* react-router v7.7.0-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
+
"use client";
|
|
12
|
+
import {
|
|
13
|
+
deserializeErrors,
|
|
14
|
+
getHydrationData
|
|
15
|
+
} from "./chunk-PY5DBM7W.mjs";
|
|
11
16
|
import {
|
|
12
17
|
FrameworkContext,
|
|
13
18
|
RemixErrorBoundary,
|
|
@@ -17,15 +22,13 @@ import {
|
|
|
17
22
|
createClientRoutesWithHMRRevalidationOptOut,
|
|
18
23
|
createRouter,
|
|
19
24
|
decodeViaTurboStream,
|
|
20
|
-
deserializeErrors,
|
|
21
|
-
getHydrationData,
|
|
22
25
|
getPatchRoutesOnNavigationFunction,
|
|
23
26
|
getTurboStreamSingleFetchDataStrategy,
|
|
24
27
|
hydrationRouteProperties,
|
|
25
28
|
invariant,
|
|
26
29
|
mapRouteProperties,
|
|
27
30
|
useFogOFWarDiscovery
|
|
28
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-PUMRC5B5.mjs";
|
|
29
32
|
|
|
30
33
|
// lib/dom-export/dom-router-provider.tsx
|
|
31
34
|
import * as React from "react";
|
|
@@ -169,11 +172,11 @@ function HydratedRouter(props) {
|
|
|
169
172
|
let [criticalCss, setCriticalCss] = React2.useState(
|
|
170
173
|
process.env.NODE_ENV === "development" ? ssrInfo?.context.criticalCss : void 0
|
|
171
174
|
);
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
|
|
175
|
+
React2.useEffect(() => {
|
|
176
|
+
if (process.env.NODE_ENV === "development") {
|
|
177
|
+
setCriticalCss(void 0);
|
|
175
178
|
}
|
|
176
|
-
}
|
|
179
|
+
}, []);
|
|
177
180
|
let [location, setLocation] = React2.useState(router.state.location);
|
|
178
181
|
React2.useLayoutEffect(() => {
|
|
179
182
|
if (ssrInfo && ssrInfo.router && !ssrInfo.routerInitialized) {
|