react-router 7.18.4 → 7.18.6
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 +21 -0
- package/dist/development/{browser-eq4RgLsD.d.ts → browser-7x6a6gQP.d.ts} +1 -1
- package/dist/development/{browser-BR5QG7ZC.d.mts → browser-CiGxXXOl.d.mts} +1 -1
- package/dist/development/{chunk-LVPI3KDG.js → chunk-3QTLHDUO.js} +7 -7
- package/dist/{production/chunk-G2MPF4YY.mjs → development/chunk-E2PF4K4Z.mjs} +25 -7
- package/dist/development/{chunk-HQO5H5CC.js → chunk-QM7ETCUK.js} +109 -104
- package/dist/development/{chunk-GR4NQCSD.js → chunk-S47XUPN5.js} +133 -66
- package/dist/development/{chunk-OB3PAWPO.mjs → chunk-YDNE64FV.mjs} +135 -64
- package/dist/{production/context-nqAapj74.d.mts → development/context-BlYKn1tE.d.mts} +2 -0
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +37 -35
- package/dist/development/dom-export.mjs +6 -4
- package/dist/development/{index-react-server-client-BjY-eKuf.d.ts → index-react-server-client-BaaZU3sM.d.ts} +1 -1
- package/dist/development/{index-react-server-client-K63fpMH4.d.mts → index-react-server-client-KK-TR-t7.d.mts} +1 -1
- package/dist/development/index-react-server-client.d.mts +2 -2
- 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 +2 -0
- package/dist/development/index-react-server.d.ts +2 -0
- package/dist/development/index-react-server.js +109 -17
- package/dist/development/index-react-server.mjs +109 -17
- package/dist/development/index.d.mts +7 -7
- package/dist/development/index.d.ts +7 -7
- package/dist/development/index.js +121 -103
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-B7w3_Eo9.d.ts → development/instrumentation-CPkMwccd.d.ts} +2 -0
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/production/{browser-eq4RgLsD.d.ts → browser-7x6a6gQP.d.ts} +1 -1
- package/dist/production/{browser-BR5QG7ZC.d.mts → browser-CiGxXXOl.d.mts} +1 -1
- package/dist/production/{chunk-AOOKMWND.js → chunk-2WUBOUFU.js} +109 -104
- package/dist/production/{chunk-QURBR4FZ.js → chunk-3IBQ4CTZ.js} +7 -7
- package/dist/production/{chunk-YNGRUB6F.js → chunk-AC65NKOP.js} +133 -66
- package/dist/production/{chunk-Q34X6AWR.mjs → chunk-HEAXLYUI.mjs} +135 -64
- package/dist/{development/chunk-H4DAEOV7.mjs → production/chunk-JRCXCPLA.mjs} +25 -7
- package/dist/{development/context-nqAapj74.d.mts → production/context-BlYKn1tE.d.mts} +2 -0
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +37 -35
- package/dist/production/dom-export.mjs +6 -4
- package/dist/production/{index-react-server-client-BjY-eKuf.d.ts → index-react-server-client-BaaZU3sM.d.ts} +1 -1
- package/dist/production/{index-react-server-client-K63fpMH4.d.mts → index-react-server-client-KK-TR-t7.d.mts} +1 -1
- package/dist/production/index-react-server-client.d.mts +2 -2
- 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 +2 -0
- package/dist/production/index-react-server.d.ts +2 -0
- package/dist/production/index-react-server.js +109 -17
- package/dist/production/index-react-server.mjs +109 -17
- package/dist/production/index.d.mts +7 -7
- package/dist/production/index.d.ts +7 -7
- package/dist/production/index.js +121 -103
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-B7w3_Eo9.d.ts → production/instrumentation-CPkMwccd.d.ts} +2 -0
- 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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkAC65NKOPjs = require('./chunk-AC65NKOP.js');
|
|
18
18
|
|
|
19
19
|
// lib/dom/ssr/hydration.tsx
|
|
20
20
|
function getHydrationData({
|
|
@@ -29,12 +29,12 @@ function getHydrationData({
|
|
|
29
29
|
...state,
|
|
30
30
|
loaderData: { ...state.loaderData }
|
|
31
31
|
};
|
|
32
|
-
let initialMatches =
|
|
32
|
+
let initialMatches = _chunkAC65NKOPjs.matchRoutes.call(void 0, routes, location, basename);
|
|
33
33
|
if (initialMatches) {
|
|
34
34
|
for (let match of initialMatches) {
|
|
35
35
|
let routeId = match.route.id;
|
|
36
36
|
let routeInfo = getRouteInfo(routeId);
|
|
37
|
-
if (
|
|
37
|
+
if (_chunkAC65NKOPjs.shouldHydrateRouteLoader.call(void 0,
|
|
38
38
|
routeId,
|
|
39
39
|
routeInfo.clientLoader,
|
|
40
40
|
routeInfo.hasLoader,
|
|
@@ -112,7 +112,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
|
-
if (
|
|
115
|
+
if (_chunkAC65NKOPjs.isRouteErrorResponse.call(void 0, error)) {
|
|
116
116
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
117
117
|
ErrorWrapper,
|
|
118
118
|
{
|
|
@@ -120,7 +120,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
120
120
|
title: "Unhandled Thrown Response!"
|
|
121
121
|
},
|
|
122
122
|
/* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
123
|
-
|
|
123
|
+
_chunkAC65NKOPjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
let errorInstance;
|
|
@@ -146,7 +146,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
146
146
|
function RSCDefaultRootErrorBoundary({
|
|
147
147
|
hasRootLayout
|
|
148
148
|
}) {
|
|
149
|
-
let error =
|
|
149
|
+
let error = _chunkAC65NKOPjs.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|
|
@@ -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.18.
|
|
2
|
+
* react-router v7.18.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -386,6 +386,67 @@ function createBrowserURLImpl(windowImpl, to, isAbsolute = false) {
|
|
|
386
386
|
return new URL(href, base);
|
|
387
387
|
}
|
|
388
388
|
|
|
389
|
+
// lib/router/navigation.ts
|
|
390
|
+
var DEFAULT_NAVIGATION_URL = new URL("http://localhost");
|
|
391
|
+
function getNavigatorCurrentUrl(navigator) {
|
|
392
|
+
if (navigator.createURL) {
|
|
393
|
+
return navigator.createURL("/");
|
|
394
|
+
}
|
|
395
|
+
try {
|
|
396
|
+
return new URL(navigator.createHref("/"), DEFAULT_NAVIGATION_URL);
|
|
397
|
+
} catch (e2) {
|
|
398
|
+
return DEFAULT_NAVIGATION_URL;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function isSameOrigin(a, b) {
|
|
402
|
+
return a.origin === b.origin && (a.origin !== "null" || a.protocol === b.protocol && a.host === b.host);
|
|
403
|
+
}
|
|
404
|
+
function isExplicitUrl(destination, target) {
|
|
405
|
+
if (destination.startsWith("//")) {
|
|
406
|
+
return true;
|
|
407
|
+
}
|
|
408
|
+
let protocol = target.protocol.toLowerCase();
|
|
409
|
+
if (!destination.toLowerCase().startsWith(protocol)) {
|
|
410
|
+
return false;
|
|
411
|
+
}
|
|
412
|
+
return target.host === "" || destination.slice(protocol.length).startsWith("//");
|
|
413
|
+
}
|
|
414
|
+
function validateDocumentNavigationTarget(destination) {
|
|
415
|
+
let normalized = destination.replace(/[\t\n\r]/g, "");
|
|
416
|
+
let start = 0;
|
|
417
|
+
while (normalized.charCodeAt(start) <= 32) start++;
|
|
418
|
+
normalized = normalized.slice(start);
|
|
419
|
+
if (!ABSOLUTE_URL_REGEX.test(normalized)) return;
|
|
420
|
+
let target;
|
|
421
|
+
try {
|
|
422
|
+
target = new URL(destination, DEFAULT_NAVIGATION_URL);
|
|
423
|
+
} catch (e3) {
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
if (!isExplicitUrl(destination, target)) {
|
|
427
|
+
throw new Error("External navigation is not allowed");
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function validateNavigationTarget(original, resolved, currentUrl, externalPolicy) {
|
|
431
|
+
let originalUrl = null;
|
|
432
|
+
try {
|
|
433
|
+
originalUrl = original == null ? null : new URL(original, currentUrl);
|
|
434
|
+
} catch (e4) {
|
|
435
|
+
}
|
|
436
|
+
let resolvedUrl = new URL(resolved, currentUrl);
|
|
437
|
+
let originalIsExternal = originalUrl != null && !isSameOrigin(originalUrl, currentUrl);
|
|
438
|
+
let resolvedIsExternal = !isSameOrigin(resolvedUrl, currentUrl);
|
|
439
|
+
if (externalPolicy === "reject") {
|
|
440
|
+
if (originalIsExternal || resolvedIsExternal) {
|
|
441
|
+
throw new Error("External navigation is not allowed");
|
|
442
|
+
}
|
|
443
|
+
} else if (resolvedIsExternal) {
|
|
444
|
+
if (originalUrl == null || !isExplicitUrl(original, originalUrl) || !isSameOrigin(originalUrl, resolvedUrl)) {
|
|
445
|
+
throw new Error("External navigation is not allowed");
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
389
450
|
// lib/router/utils.ts
|
|
390
451
|
function createContext(defaultValue) {
|
|
391
452
|
return { defaultValue };
|
|
@@ -767,7 +828,12 @@ function generatePath(originalPath, params = {}) {
|
|
|
767
828
|
}
|
|
768
829
|
return segment.replace(/\?$/g, "");
|
|
769
830
|
}).filter((segment) => !!segment);
|
|
770
|
-
|
|
831
|
+
let result = (prefix + segments.join("/")).replace(/^[\\/]{2,}/, "/");
|
|
832
|
+
if (!prefix && (path.startsWith(":") || path === "*")) {
|
|
833
|
+
result = result.replace(/^([a-z][a-z0-9+.-]*):/i, "$1%3A");
|
|
834
|
+
}
|
|
835
|
+
validateDocumentNavigationTarget(result);
|
|
836
|
+
return result;
|
|
771
837
|
}
|
|
772
838
|
function matchPath(pattern, pathname) {
|
|
773
839
|
if (typeof pattern === "string") {
|
|
@@ -995,6 +1061,7 @@ function data(data2, init) {
|
|
|
995
1061
|
);
|
|
996
1062
|
}
|
|
997
1063
|
var redirect = (url, init = 302) => {
|
|
1064
|
+
validateDocumentNavigationTarget(url);
|
|
998
1065
|
let responseInit = init;
|
|
999
1066
|
if (typeof responseInit === "number") {
|
|
1000
1067
|
responseInit = { status: responseInit };
|
|
@@ -1350,51 +1417,6 @@ function isPlainObject(thing) {
|
|
|
1350
1417
|
return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames;
|
|
1351
1418
|
}
|
|
1352
1419
|
|
|
1353
|
-
// lib/router/navigation.ts
|
|
1354
|
-
var DEFAULT_NAVIGATION_URL = new URL("http://localhost");
|
|
1355
|
-
function getNavigatorCurrentUrl(navigator) {
|
|
1356
|
-
if (navigator.createURL) {
|
|
1357
|
-
return navigator.createURL("/");
|
|
1358
|
-
}
|
|
1359
|
-
try {
|
|
1360
|
-
return new URL(navigator.createHref("/"), DEFAULT_NAVIGATION_URL);
|
|
1361
|
-
} catch (e2) {
|
|
1362
|
-
return DEFAULT_NAVIGATION_URL;
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
function isSameOrigin(a, b) {
|
|
1366
|
-
return a.origin === b.origin && (a.origin !== "null" || a.protocol === b.protocol && a.host === b.host);
|
|
1367
|
-
}
|
|
1368
|
-
function isExplicitUrl(destination, target) {
|
|
1369
|
-
if (destination.startsWith("//")) {
|
|
1370
|
-
return true;
|
|
1371
|
-
}
|
|
1372
|
-
let protocol = target.protocol.toLowerCase();
|
|
1373
|
-
if (!destination.toLowerCase().startsWith(protocol)) {
|
|
1374
|
-
return false;
|
|
1375
|
-
}
|
|
1376
|
-
return target.host === "" || destination.slice(protocol.length).startsWith("//");
|
|
1377
|
-
}
|
|
1378
|
-
function validateNavigationTarget(original, resolved, currentUrl, externalPolicy) {
|
|
1379
|
-
let originalUrl = null;
|
|
1380
|
-
try {
|
|
1381
|
-
originalUrl = original == null ? null : new URL(original, currentUrl);
|
|
1382
|
-
} catch (e3) {
|
|
1383
|
-
}
|
|
1384
|
-
let resolvedUrl = new URL(resolved, currentUrl);
|
|
1385
|
-
let originalIsExternal = originalUrl != null && !isSameOrigin(originalUrl, currentUrl);
|
|
1386
|
-
let resolvedIsExternal = !isSameOrigin(resolvedUrl, currentUrl);
|
|
1387
|
-
if (externalPolicy === "reject") {
|
|
1388
|
-
if (originalIsExternal || resolvedIsExternal) {
|
|
1389
|
-
throw new Error("External navigation is not allowed");
|
|
1390
|
-
}
|
|
1391
|
-
} else if (resolvedIsExternal) {
|
|
1392
|
-
if (originalUrl == null || !isExplicitUrl(original, originalUrl) || !isSameOrigin(originalUrl, resolvedUrl)) {
|
|
1393
|
-
throw new Error("External navigation is not allowed");
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
1420
|
// lib/router/router.ts
|
|
1399
1421
|
var validMutationMethodsArr = [
|
|
1400
1422
|
"POST",
|
|
@@ -2527,6 +2549,12 @@ function createRouter(init) {
|
|
|
2527
2549
|
routeId,
|
|
2528
2550
|
_optionalChain([opts, 'optionalAccess', _23 => _23.relative])
|
|
2529
2551
|
);
|
|
2552
|
+
validateNavigationTarget(
|
|
2553
|
+
null,
|
|
2554
|
+
normalizedPath,
|
|
2555
|
+
init.history.createURL("/"),
|
|
2556
|
+
"reject"
|
|
2557
|
+
);
|
|
2530
2558
|
let matches = matchRoutesImpl(
|
|
2531
2559
|
routesToUse,
|
|
2532
2560
|
normalizedPath,
|
|
@@ -3538,6 +3566,10 @@ function createStaticHandler(routes, opts) {
|
|
|
3538
3566
|
manifest
|
|
3539
3567
|
);
|
|
3540
3568
|
let routeBranches = flattenAndRankRoutes(dataRoutes);
|
|
3569
|
+
let matchCost = routeBranches.reduce(
|
|
3570
|
+
(total, branch) => total + branch.routesMeta.length,
|
|
3571
|
+
0
|
|
3572
|
+
);
|
|
3541
3573
|
async function query(request, {
|
|
3542
3574
|
requestContext,
|
|
3543
3575
|
filterMatchesToLoad,
|
|
@@ -4159,6 +4191,7 @@ function createStaticHandler(routes, opts) {
|
|
|
4159
4191
|
}
|
|
4160
4192
|
return {
|
|
4161
4193
|
dataRoutes,
|
|
4194
|
+
_matchCost: matchCost,
|
|
4162
4195
|
_internalRouteBranches: routeBranches,
|
|
4163
4196
|
query,
|
|
4164
4197
|
queryRoute
|
|
@@ -5292,6 +5325,12 @@ function normalizeRelativeRoutingRedirectResponse(response, request, routeId, ma
|
|
|
5292
5325
|
location,
|
|
5293
5326
|
"Redirects returned/thrown from loaders/actions must have a Location header"
|
|
5294
5327
|
);
|
|
5328
|
+
validateNavigationTarget(
|
|
5329
|
+
location,
|
|
5330
|
+
location,
|
|
5331
|
+
new URL(request.url),
|
|
5332
|
+
"allow-explicit"
|
|
5333
|
+
);
|
|
5295
5334
|
if (!isAbsoluteUrl(location)) {
|
|
5296
5335
|
let trimmedMatches = matches.slice(
|
|
5297
5336
|
0,
|
|
@@ -5323,7 +5362,7 @@ var invalidProtocols = [
|
|
|
5323
5362
|
function hasInvalidProtocol(location) {
|
|
5324
5363
|
try {
|
|
5325
5364
|
return invalidProtocols.includes(new URL(location).protocol);
|
|
5326
|
-
} catch (
|
|
5365
|
+
} catch (e5) {
|
|
5327
5366
|
return false;
|
|
5328
5367
|
}
|
|
5329
5368
|
}
|
|
@@ -6146,6 +6185,7 @@ function hydrate(index) {
|
|
|
6146
6185
|
set(-0);
|
|
6147
6186
|
continue;
|
|
6148
6187
|
}
|
|
6188
|
+
validateIndex(index2, values.length);
|
|
6149
6189
|
if (hydrated[index2]) {
|
|
6150
6190
|
set(hydrated[index2]);
|
|
6151
6191
|
continue;
|
|
@@ -6234,6 +6274,7 @@ function hydrate(index) {
|
|
|
6234
6274
|
set(obj);
|
|
6235
6275
|
continue;
|
|
6236
6276
|
case TYPE_PROMISE:
|
|
6277
|
+
validateIndex(b, values.length);
|
|
6237
6278
|
if (hydrated[b]) {
|
|
6238
6279
|
set(hydrated[index2] = hydrated[b]);
|
|
6239
6280
|
} else {
|
|
@@ -6249,6 +6290,7 @@ function hydrate(index) {
|
|
|
6249
6290
|
set(error);
|
|
6250
6291
|
continue;
|
|
6251
6292
|
case TYPE_PREVIOUS_RESOLVED:
|
|
6293
|
+
validateIndex(b, values.length);
|
|
6252
6294
|
set(hydrated[index2] = hydrated[b]);
|
|
6253
6295
|
continue;
|
|
6254
6296
|
default:
|
|
@@ -6313,7 +6355,12 @@ function hydrate(index) {
|
|
|
6313
6355
|
}
|
|
6314
6356
|
]);
|
|
6315
6357
|
postRun.push(() => {
|
|
6316
|
-
object
|
|
6358
|
+
Object.defineProperty(object, r[0], {
|
|
6359
|
+
value: r[1],
|
|
6360
|
+
enumerable: true,
|
|
6361
|
+
configurable: true,
|
|
6362
|
+
writable: true
|
|
6363
|
+
});
|
|
6317
6364
|
});
|
|
6318
6365
|
}
|
|
6319
6366
|
set(object);
|
|
@@ -6325,6 +6372,11 @@ function hydrate(index) {
|
|
|
6325
6372
|
}
|
|
6326
6373
|
return result;
|
|
6327
6374
|
}
|
|
6375
|
+
function validateIndex(index, length) {
|
|
6376
|
+
if (!Number.isSafeInteger(index) || index < 0 || index >= length) {
|
|
6377
|
+
throw new SyntaxError();
|
|
6378
|
+
}
|
|
6379
|
+
}
|
|
6328
6380
|
|
|
6329
6381
|
// vendor/turbo-stream-v2/turbo-stream.ts
|
|
6330
6382
|
async function decode(readable, options) {
|
|
@@ -6431,20 +6483,22 @@ function encode(input, options) {
|
|
|
6431
6483
|
};
|
|
6432
6484
|
const textEncoder = new TextEncoder();
|
|
6433
6485
|
let lastSentIndex = 0;
|
|
6486
|
+
let cancelled = false;
|
|
6434
6487
|
const readable = new ReadableStream({
|
|
6435
6488
|
async start(controller) {
|
|
6489
|
+
const enqueue = (chunk) => {
|
|
6490
|
+
if (!cancelled) controller.enqueue(chunk);
|
|
6491
|
+
};
|
|
6436
6492
|
const id = await flatten.call(encoder, input);
|
|
6437
6493
|
if (Array.isArray(id)) {
|
|
6438
6494
|
throw new Error("This should never happen");
|
|
6439
6495
|
}
|
|
6440
6496
|
if (id < 0) {
|
|
6441
|
-
|
|
6497
|
+
enqueue(textEncoder.encode(`${id}
|
|
6442
6498
|
`));
|
|
6443
6499
|
} else {
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
`)
|
|
6447
|
-
);
|
|
6500
|
+
enqueue(textEncoder.encode(`[${encoder.stringified.join(",")}]
|
|
6501
|
+
`));
|
|
6448
6502
|
lastSentIndex = encoder.stringified.length - 1;
|
|
6449
6503
|
}
|
|
6450
6504
|
const seenPromises = /* @__PURE__ */ new WeakSet();
|
|
@@ -6479,7 +6533,7 @@ function encode(input, options) {
|
|
|
6479
6533
|
processingChain = processingChain.then(async () => {
|
|
6480
6534
|
const id2 = await flatten.call(encoder, resolved);
|
|
6481
6535
|
if (Array.isArray(id2)) {
|
|
6482
|
-
|
|
6536
|
+
enqueue(
|
|
6483
6537
|
textEncoder.encode(
|
|
6484
6538
|
`${TYPE_PROMISE}${deferredId}:[["${TYPE_PREVIOUS_RESOLVED}",${id2[0]}]]
|
|
6485
6539
|
`
|
|
@@ -6488,7 +6542,7 @@ function encode(input, options) {
|
|
|
6488
6542
|
encoder.index++;
|
|
6489
6543
|
lastSentIndex++;
|
|
6490
6544
|
} else if (id2 < 0) {
|
|
6491
|
-
|
|
6545
|
+
enqueue(
|
|
6492
6546
|
textEncoder.encode(
|
|
6493
6547
|
`${TYPE_PROMISE}${deferredId}:${id2}
|
|
6494
6548
|
`
|
|
@@ -6496,7 +6550,7 @@ function encode(input, options) {
|
|
|
6496
6550
|
);
|
|
6497
6551
|
} else {
|
|
6498
6552
|
const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
|
|
6499
|
-
|
|
6553
|
+
enqueue(
|
|
6500
6554
|
textEncoder.encode(
|
|
6501
6555
|
`${TYPE_PROMISE}${deferredId}:[${values}]
|
|
6502
6556
|
`
|
|
@@ -6514,7 +6568,7 @@ function encode(input, options) {
|
|
|
6514
6568
|
}
|
|
6515
6569
|
const id2 = await flatten.call(encoder, reason);
|
|
6516
6570
|
if (Array.isArray(id2)) {
|
|
6517
|
-
|
|
6571
|
+
enqueue(
|
|
6518
6572
|
textEncoder.encode(
|
|
6519
6573
|
`${TYPE_ERROR}${deferredId}:[["${TYPE_PREVIOUS_RESOLVED}",${id2[0]}]]
|
|
6520
6574
|
`
|
|
@@ -6523,7 +6577,7 @@ function encode(input, options) {
|
|
|
6523
6577
|
encoder.index++;
|
|
6524
6578
|
lastSentIndex++;
|
|
6525
6579
|
} else if (id2 < 0) {
|
|
6526
|
-
|
|
6580
|
+
enqueue(
|
|
6527
6581
|
textEncoder.encode(
|
|
6528
6582
|
`${TYPE_ERROR}${deferredId}:${id2}
|
|
6529
6583
|
`
|
|
@@ -6531,7 +6585,7 @@ function encode(input, options) {
|
|
|
6531
6585
|
);
|
|
6532
6586
|
} else {
|
|
6533
6587
|
const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
|
|
6534
|
-
|
|
6588
|
+
enqueue(
|
|
6535
6589
|
textEncoder.encode(
|
|
6536
6590
|
`${TYPE_ERROR}${deferredId}:[${values}]
|
|
6537
6591
|
`
|
|
@@ -6553,8 +6607,11 @@ function encode(input, options) {
|
|
|
6553
6607
|
}
|
|
6554
6608
|
await Promise.all(Object.values(encoder.deferred));
|
|
6555
6609
|
await processingChain;
|
|
6556
|
-
controller.close();
|
|
6610
|
+
if (!cancelled) controller.close();
|
|
6557
6611
|
_optionalChain([onComplete, 'optionalCall', _82 => _82()]);
|
|
6612
|
+
},
|
|
6613
|
+
cancel() {
|
|
6614
|
+
cancelled = true;
|
|
6558
6615
|
}
|
|
6559
6616
|
});
|
|
6560
6617
|
return readable;
|
|
@@ -7167,7 +7224,7 @@ function decodeRedirectErrorDigest(digest) {
|
|
|
7167
7224
|
if (typeof parsed === "object" && parsed && typeof parsed.status === "number" && typeof parsed.statusText === "string" && typeof parsed.location === "string" && typeof parsed.reloadDocument === "boolean" && typeof parsed.replace === "boolean") {
|
|
7168
7225
|
return parsed;
|
|
7169
7226
|
}
|
|
7170
|
-
} catch (
|
|
7227
|
+
} catch (e6) {
|
|
7171
7228
|
}
|
|
7172
7229
|
}
|
|
7173
7230
|
}
|
|
@@ -7184,7 +7241,7 @@ function decodeRouteErrorResponseDigest(digest) {
|
|
|
7184
7241
|
parsed.data
|
|
7185
7242
|
);
|
|
7186
7243
|
}
|
|
7187
|
-
} catch (
|
|
7244
|
+
} catch (e7) {
|
|
7188
7245
|
}
|
|
7189
7246
|
}
|
|
7190
7247
|
}
|
|
@@ -8628,6 +8685,13 @@ function getPathsWithAncestors(paths) {
|
|
|
8628
8685
|
function isFogOfWarEnabled(routeDiscovery, ssr) {
|
|
8629
8686
|
return routeDiscovery.mode === "lazy" && ssr === true;
|
|
8630
8687
|
}
|
|
8688
|
+
var MANIFEST_MATCH_COST_LIMIT = 5e4;
|
|
8689
|
+
var MANIFEST_MATCH_COST_SEGMENT_THRESHOLD = 10;
|
|
8690
|
+
function shouldUseInitialRouteDiscovery(pathname, matchCost = 0) {
|
|
8691
|
+
let segmentCount = pathname.split("/").length - 1;
|
|
8692
|
+
let ancestorCount = Math.max(segmentCount - 1, 0);
|
|
8693
|
+
return ancestorCount * pathname.length + 1 > URL_LIMIT || segmentCount > MANIFEST_MATCH_COST_SEGMENT_THRESHOLD && segmentCount * matchCost > MANIFEST_MATCH_COST_LIMIT;
|
|
8694
|
+
}
|
|
8631
8695
|
function getPartialManifest({ sri, ...manifest }, router) {
|
|
8632
8696
|
let routeIds = new Set(router.state.matches.map((m) => m.route.id));
|
|
8633
8697
|
let segments = router.state.location.pathname.split("/").filter(Boolean);
|
|
@@ -8779,7 +8843,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
8779
8843
|
return;
|
|
8780
8844
|
}
|
|
8781
8845
|
sessionStorage.setItem(MANIFEST_VERSION_STORAGE_KEY, manifest.version);
|
|
8782
|
-
} catch (
|
|
8846
|
+
} catch (e8) {
|
|
8783
8847
|
}
|
|
8784
8848
|
window.location.href = errorReloadPath;
|
|
8785
8849
|
console.warn("Detected manifest version mismatch, reloading...");
|
|
@@ -8790,7 +8854,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
8790
8854
|
}
|
|
8791
8855
|
try {
|
|
8792
8856
|
sessionStorage.removeItem(MANIFEST_VERSION_STORAGE_KEY);
|
|
8793
|
-
} catch (
|
|
8857
|
+
} catch (e9) {
|
|
8794
8858
|
}
|
|
8795
8859
|
serverPatches = await res.json();
|
|
8796
8860
|
} catch (e) {
|
|
@@ -10407,4 +10471,7 @@ function withErrorBoundaryProps(ErrorBoundary) {
|
|
|
10407
10471
|
|
|
10408
10472
|
|
|
10409
10473
|
|
|
10410
|
-
|
|
10474
|
+
|
|
10475
|
+
|
|
10476
|
+
|
|
10477
|
+
exports.ABSOLUTE_URL_REGEX = ABSOLUTE_URL_REGEX; exports.PROTOCOL_RELATIVE_URL_REGEX = PROTOCOL_RELATIVE_URL_REGEX; exports.Action = Action; exports.createMemoryHistory = createMemoryHistory; exports.createBrowserHistory = createBrowserHistory; exports.createHashHistory = createHashHistory; exports.invariant = invariant; exports.warning = warning; exports.createPath = createPath; exports.parsePath = parsePath; exports.validateDocumentNavigationTarget = validateDocumentNavigationTarget; exports.validateNavigationTarget = validateNavigationTarget; exports.createContext = createContext; exports.RouterContextProvider = RouterContextProvider; exports.convertRoutesToDataRoutes = convertRoutesToDataRoutes; exports.matchRoutes = matchRoutes; exports.matchRoutesImpl = matchRoutesImpl; exports.generatePath = generatePath; exports.matchPath = matchPath; exports.stripBasename = stripBasename; exports.resolvePath = resolvePath; exports.resolveTo = resolveTo; exports.joinPaths = joinPaths; exports.data = data; exports.redirect = redirect; exports.redirectDocument = redirectDocument; exports.replace = replace; exports.SUPPORTED_ERROR_TYPES = SUPPORTED_ERROR_TYPES; exports.ErrorResponseImpl = ErrorResponseImpl; exports.isRouteErrorResponse = isRouteErrorResponse; exports.parseToInfo = parseToInfo; exports.escapeHtml = escapeHtml; exports.escapeAttribute = escapeAttribute; exports.encode = encode; exports.instrumentHandler = instrumentHandler; exports.IDLE_NAVIGATION = IDLE_NAVIGATION; exports.IDLE_FETCHER = IDLE_FETCHER; exports.IDLE_BLOCKER = IDLE_BLOCKER; exports.createRouter = createRouter; exports.createStaticHandler = createStaticHandler; exports.getStaticContextFromError = getStaticContextFromError; exports.hasInvalidProtocol = hasInvalidProtocol; exports.isDataWithResponseInit = isDataWithResponseInit; exports.isResponse = isResponse; exports.isRedirectStatusCode = isRedirectStatusCode; exports.isRedirectResponse = isRedirectResponse; exports.isMutationMethod = isMutationMethod; exports.createRequestInit = createRequestInit; exports.SingleFetchRedirectSymbol = SingleFetchRedirectSymbol; exports.SINGLE_FETCH_REDIRECT_STATUS = SINGLE_FETCH_REDIRECT_STATUS; exports.NO_BODY_STATUS_CODES = NO_BODY_STATUS_CODES; exports.StreamTransfer = StreamTransfer; exports.getTurboStreamSingleFetchDataStrategy = getTurboStreamSingleFetchDataStrategy; exports.getSingleFetchDataStrategyImpl = getSingleFetchDataStrategyImpl; exports.stripIndexParam = stripIndexParam; exports.singleFetchUrl = singleFetchUrl; exports.decodeViaTurboStream = decodeViaTurboStream; exports.DataRouterContext = DataRouterContext; exports.DataRouterStateContext = DataRouterStateContext; exports.RSCRouterContext = RSCRouterContext; exports.ViewTransitionContext = ViewTransitionContext; exports.FetchersContext = FetchersContext; exports.AwaitContextProvider = AwaitContextProvider; exports.NavigationContext = NavigationContext; exports.LocationContext = LocationContext; exports.RouteContext = RouteContext; exports.ENABLE_DEV_WARNINGS = ENABLE_DEV_WARNINGS; exports.warnOnce = warnOnce; exports.decodeRedirectErrorDigest = decodeRedirectErrorDigest; exports.decodeRouteErrorResponseDigest = decodeRouteErrorResponseDigest; exports.useHref = useHref; exports.useInRouterContext = useInRouterContext; exports.useLocation = useLocation; exports.useNavigationType = useNavigationType; exports.useMatch = useMatch; exports.useNavigate = useNavigate; exports.useOutletContext = useOutletContext; exports.useOutlet = useOutlet; exports.useParams = useParams; exports.useResolvedPath = useResolvedPath; exports.useRoutes = useRoutes; exports.useRouteId = useRouteId; exports.useNavigation = useNavigation; exports.useRevalidator = useRevalidator; exports.useMatches = useMatches; exports.useLoaderData = useLoaderData; exports.useRouteLoaderData = useRouteLoaderData; exports.useActionData = useActionData; exports.useRouteError = useRouteError; exports.useAsyncValue = useAsyncValue; exports.useAsyncError = useAsyncError; exports.useBlocker = useBlocker; exports.useRoute = useRoute; exports.useRouterState = useRouterState; exports.RemixErrorBoundary = RemixErrorBoundary; exports.createServerRoutes = createServerRoutes; exports.createClientRoutesWithHMRRevalidationOptOut = createClientRoutesWithHMRRevalidationOptOut; exports.noActionDefinedError = noActionDefinedError; exports.createClientRoutes = createClientRoutes; exports.shouldHydrateRouteLoader = shouldHydrateRouteLoader; exports.URL_LIMIT = URL_LIMIT; exports.getPathsWithAncestors = getPathsWithAncestors; exports.isFogOfWarEnabled = isFogOfWarEnabled; exports.shouldUseInitialRouteDiscovery = shouldUseInitialRouteDiscovery; exports.getPatchRoutesOnNavigationFunction = getPatchRoutesOnNavigationFunction; exports.useFogOFWarDiscovery = useFogOFWarDiscovery; exports.getManifestPath = getManifestPath; exports.FrameworkContext = FrameworkContext; exports.usePrefetchBehavior = usePrefetchBehavior; exports.CRITICAL_CSS_DATA_ATTRIBUTE = CRITICAL_CSS_DATA_ATTRIBUTE; exports.Links = Links; exports.PrefetchPageLinks = PrefetchPageLinks; exports.Meta = Meta; exports.setIsHydrated = setIsHydrated; exports.Scripts = Scripts; exports.mergeRefs = mergeRefs; exports.mapRouteProperties = mapRouteProperties; exports.hydrationRouteProperties = hydrationRouteProperties; exports.createMemoryRouter = createMemoryRouter; exports.RouterProvider = RouterProvider; exports.DataRoutes = DataRoutes2; exports.MemoryRouter = MemoryRouter; exports.Navigate = Navigate; exports.Outlet = Outlet; exports.Route = Route; exports.Router = Router; exports.Routes = Routes; exports.Await = Await; exports.createRoutesFromChildren = createRoutesFromChildren; exports.createRoutesFromElements = createRoutesFromElements; exports.renderMatches = renderMatches; exports.WithComponentProps = WithComponentProps; exports.withComponentProps = withComponentProps; exports.WithHydrateFallbackProps = WithHydrateFallbackProps; exports.withHydrateFallbackProps = withHydrateFallbackProps; exports.WithErrorBoundaryProps = WithErrorBoundaryProps; exports.withErrorBoundaryProps = withErrorBoundaryProps;
|