react-router 7.13.1 → 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 +53 -0
- package/dist/{production/browser-DzsJABDQ.d.mts → development/browser-Bfn3xw9E.d.ts} +2 -1
- package/dist/development/{browser-DzsJABDQ.d.mts → browser-Di6-vSl-.d.mts} +2 -1
- package/dist/development/{chunk-XOLAXE2Z.js → chunk-GO74ODU3.js} +190 -111
- package/dist/{production/chunk-B5UMK6O7.js → development/chunk-HPFFRPKK.js} +100 -99
- package/dist/development/{chunk-KSEWV2VO.js → chunk-LLP6DRWX.js} +7 -7
- package/dist/{production/chunk-TXB4YXR2.mjs → development/chunk-UALY5CBT.mjs} +83 -49
- package/dist/development/{chunk-LFPYN7LY.mjs → chunk-UVKPFVEO.mjs} +124 -44
- package/dist/development/context-phCt_zmH.d.mts +1713 -0
- package/dist/development/dom-export.d.mts +3 -2
- package/dist/development/dom-export.d.ts +3 -2
- package/dist/development/dom-export.js +45 -29
- package/dist/development/dom-export.mjs +21 -5
- package/dist/development/{index-react-server-client-C4tCIird.d.ts → index-react-server-client-BcrVT7Dd.d.mts} +4 -2
- package/dist/{production/index-react-server-client-EzWJGpN_.d.mts → development/index-react-server-client-CCwMoQIT.d.ts} +1067 -10
- package/dist/development/index-react-server-client.d.mts +3 -2
- package/dist/development/index-react-server-client.d.ts +3 -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 +293 -246
- package/dist/development/index-react-server.d.ts +293 -246
- package/dist/development/index-react-server.js +121 -43
- package/dist/development/index-react-server.mjs +121 -43
- package/dist/development/index.d.mts +15 -13
- package/dist/development/index.d.ts +15 -13
- package/dist/development/index.js +176 -142
- package/dist/development/index.mjs +3 -3
- package/dist/development/instrumentation-BYr6ff5D.d.ts +657 -0
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{register-CBoanF80.d.ts → register-CTxsJBKQ.d.mts} +1 -1
- package/dist/development/{register-cRYJ3CjG.d.mts → register-CkcGwv27.d.ts} +1 -1
- package/dist/development/routeModules-BRrCYrSL.d.mts +1693 -0
- package/dist/development/routeModules-CA7kSxJJ.d.ts +1693 -0
- package/dist/production/{browser-sPQ7eaK4.d.ts → browser-Bfn3xw9E.d.ts} +2 -1
- package/dist/{development/browser-sPQ7eaK4.d.ts → production/browser-Di6-vSl-.d.mts} +2 -1
- package/dist/production/{chunk-RJCJ3EYF.mjs → chunk-2BDJPJTA.mjs} +124 -44
- package/dist/production/{chunk-ZJMCM6KT.js → chunk-CAFVLUDY.js} +7 -7
- package/dist/production/{chunk-772H4TVR.js → chunk-LKUVSIBA.js} +190 -111
- package/dist/{development/chunk-JPUPSTYD.mjs → production/chunk-PY35PE22.mjs} +83 -49
- package/dist/{development/chunk-2YMDXNOJ.js → production/chunk-XAAX7KIK.js} +100 -99
- package/dist/production/context-phCt_zmH.d.mts +1713 -0
- package/dist/production/dom-export.d.mts +3 -2
- package/dist/production/dom-export.d.ts +3 -2
- package/dist/production/dom-export.js +45 -29
- package/dist/production/dom-export.mjs +21 -5
- package/dist/{development/index-react-server-client-EzWJGpN_.d.mts → production/index-react-server-client-BcrVT7Dd.d.mts} +4 -2
- package/dist/production/{index-react-server-client-C4tCIird.d.ts → index-react-server-client-CCwMoQIT.d.ts} +1067 -10
- package/dist/production/index-react-server-client.d.mts +3 -2
- package/dist/production/index-react-server-client.d.ts +3 -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 +293 -246
- package/dist/production/index-react-server.d.ts +293 -246
- package/dist/production/index-react-server.js +121 -43
- package/dist/production/index-react-server.mjs +121 -43
- package/dist/production/index.d.mts +15 -13
- package/dist/production/index.d.ts +15 -13
- package/dist/production/index.js +176 -142
- package/dist/production/index.mjs +3 -3
- package/dist/production/instrumentation-BYr6ff5D.d.ts +657 -0
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{register-CBoanF80.d.ts → register-CTxsJBKQ.d.mts} +1 -1
- package/dist/production/{register-cRYJ3CjG.d.mts → register-CkcGwv27.d.ts} +1 -1
- package/dist/production/routeModules-BRrCYrSL.d.mts +1693 -0
- package/dist/production/routeModules-CA7kSxJJ.d.ts +1693 -0
- package/package.json +1 -1
- package/dist/development/instrumentation--6Pioq_G.d.ts +0 -3344
- package/dist/development/router-cLsU7kHk.d.mts +0 -3344
- package/dist/production/instrumentation--6Pioq_G.d.ts +0 -3344
- package/dist/production/router-cLsU7kHk.d.mts +0 -3344
|
@@ -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
|
+
* react-router v7.13.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -1380,6 +1380,7 @@ function createRouter(init) {
|
|
|
1380
1380
|
}
|
|
1381
1381
|
let dataStrategyImpl = init.dataStrategy || defaultDataStrategyWithMiddleware;
|
|
1382
1382
|
let future = {
|
|
1383
|
+
unstable_passThroughRequests: false,
|
|
1383
1384
|
...init.future
|
|
1384
1385
|
};
|
|
1385
1386
|
let unlistenHistory = null;
|
|
@@ -1443,10 +1444,11 @@ function createRouter(init) {
|
|
|
1443
1444
|
relevantMatches = relevantMatches.slice(0, idx + 1);
|
|
1444
1445
|
}
|
|
1445
1446
|
renderFallback = false;
|
|
1446
|
-
initialized =
|
|
1447
|
+
initialized = true;
|
|
1448
|
+
relevantMatches.forEach((m) => {
|
|
1447
1449
|
let status = getRouteHydrationStatus(m.route, loaderData, errors);
|
|
1448
1450
|
renderFallback = renderFallback || status.renderFallback;
|
|
1449
|
-
|
|
1451
|
+
initialized = initialized && !status.shouldLoad;
|
|
1450
1452
|
});
|
|
1451
1453
|
}
|
|
1452
1454
|
}
|
|
@@ -2025,6 +2027,7 @@ function createRouter(init) {
|
|
|
2025
2027
|
mapRouteProperties2,
|
|
2026
2028
|
manifest,
|
|
2027
2029
|
request,
|
|
2030
|
+
location,
|
|
2028
2031
|
matches,
|
|
2029
2032
|
actionMatch,
|
|
2030
2033
|
initialHydration ? [] : hydrationRouteProperties2,
|
|
@@ -2032,6 +2035,7 @@ function createRouter(init) {
|
|
|
2032
2035
|
);
|
|
2033
2036
|
let results = await callDataStrategy(
|
|
2034
2037
|
request,
|
|
2038
|
+
location,
|
|
2035
2039
|
dsMatches,
|
|
2036
2040
|
scopedContext,
|
|
2037
2041
|
null
|
|
@@ -2219,6 +2223,7 @@ function createRouter(init) {
|
|
|
2219
2223
|
dsMatches,
|
|
2220
2224
|
revalidatingFetchers,
|
|
2221
2225
|
request,
|
|
2226
|
+
location,
|
|
2222
2227
|
scopedContext
|
|
2223
2228
|
);
|
|
2224
2229
|
if (request.signal.aborted) {
|
|
@@ -2410,6 +2415,7 @@ function createRouter(init) {
|
|
|
2410
2415
|
mapRouteProperties2,
|
|
2411
2416
|
manifest,
|
|
2412
2417
|
fetchRequest,
|
|
2418
|
+
path,
|
|
2413
2419
|
requestMatches,
|
|
2414
2420
|
match,
|
|
2415
2421
|
hydrationRouteProperties2,
|
|
@@ -2417,6 +2423,7 @@ function createRouter(init) {
|
|
|
2417
2423
|
);
|
|
2418
2424
|
let actionResults = await callDataStrategy(
|
|
2419
2425
|
fetchRequest,
|
|
2426
|
+
path,
|
|
2420
2427
|
fetchMatches,
|
|
2421
2428
|
scopedContext,
|
|
2422
2429
|
key
|
|
@@ -2520,6 +2527,7 @@ function createRouter(init) {
|
|
|
2520
2527
|
dsMatches,
|
|
2521
2528
|
revalidatingFetchers,
|
|
2522
2529
|
revalidationRequest,
|
|
2530
|
+
nextLocation,
|
|
2523
2531
|
scopedContext
|
|
2524
2532
|
);
|
|
2525
2533
|
if (abortController.signal.aborted) {
|
|
@@ -2634,6 +2642,7 @@ function createRouter(init) {
|
|
|
2634
2642
|
mapRouteProperties2,
|
|
2635
2643
|
manifest,
|
|
2636
2644
|
fetchRequest,
|
|
2645
|
+
path,
|
|
2637
2646
|
matches,
|
|
2638
2647
|
match,
|
|
2639
2648
|
hydrationRouteProperties2,
|
|
@@ -2641,6 +2650,7 @@ function createRouter(init) {
|
|
|
2641
2650
|
);
|
|
2642
2651
|
let results = await callDataStrategy(
|
|
2643
2652
|
fetchRequest,
|
|
2653
|
+
path,
|
|
2644
2654
|
dsMatches,
|
|
2645
2655
|
scopedContext,
|
|
2646
2656
|
key
|
|
@@ -2749,13 +2759,14 @@ function createRouter(init) {
|
|
|
2749
2759
|
});
|
|
2750
2760
|
}
|
|
2751
2761
|
}
|
|
2752
|
-
async function callDataStrategy(request, matches, scopedContext, fetcherKey) {
|
|
2762
|
+
async function callDataStrategy(request, path, matches, scopedContext, fetcherKey) {
|
|
2753
2763
|
let results;
|
|
2754
2764
|
let dataResults = {};
|
|
2755
2765
|
try {
|
|
2756
2766
|
results = await callDataStrategyImpl(
|
|
2757
2767
|
dataStrategyImpl,
|
|
2758
2768
|
request,
|
|
2769
|
+
path,
|
|
2759
2770
|
matches,
|
|
2760
2771
|
fetcherKey,
|
|
2761
2772
|
scopedContext,
|
|
@@ -2807,9 +2818,10 @@ function createRouter(init) {
|
|
|
2807
2818
|
}
|
|
2808
2819
|
return dataResults;
|
|
2809
2820
|
}
|
|
2810
|
-
async function callLoadersAndMaybeResolveData(matches, fetchersToLoad, request, scopedContext) {
|
|
2821
|
+
async function callLoadersAndMaybeResolveData(matches, fetchersToLoad, request, location, scopedContext) {
|
|
2811
2822
|
let loaderResultsPromise = callDataStrategy(
|
|
2812
2823
|
request,
|
|
2824
|
+
location,
|
|
2813
2825
|
matches,
|
|
2814
2826
|
scopedContext,
|
|
2815
2827
|
null
|
|
@@ -2819,6 +2831,7 @@ function createRouter(init) {
|
|
|
2819
2831
|
if (f.matches && f.match && f.request && f.controller) {
|
|
2820
2832
|
let results = await callDataStrategy(
|
|
2821
2833
|
f.request,
|
|
2834
|
+
f.path,
|
|
2822
2835
|
f.matches,
|
|
2823
2836
|
scopedContext,
|
|
2824
2837
|
f.key
|
|
@@ -3227,7 +3240,12 @@ function createStaticHandler(routes, opts) {
|
|
|
3227
3240
|
let basename = (opts ? opts.basename : null) || "/";
|
|
3228
3241
|
let _mapRouteProperties = _optionalChain([opts, 'optionalAccess', _29 => _29.mapRouteProperties]) || defaultMapRouteProperties;
|
|
3229
3242
|
let mapRouteProperties2 = _mapRouteProperties;
|
|
3230
|
-
|
|
3243
|
+
let future = {
|
|
3244
|
+
unstable_passThroughRequests: false,
|
|
3245
|
+
// unused in static handler
|
|
3246
|
+
..._optionalChain([opts, 'optionalAccess', _30 => _30.future])
|
|
3247
|
+
};
|
|
3248
|
+
if (_optionalChain([opts, 'optionalAccess', _31 => _31.unstable_instrumentations])) {
|
|
3231
3249
|
let instrumentations = opts.unstable_instrumentations;
|
|
3232
3250
|
mapRouteProperties2 = (route) => {
|
|
3233
3251
|
return {
|
|
@@ -3251,11 +3269,12 @@ function createStaticHandler(routes, opts) {
|
|
|
3251
3269
|
skipLoaderErrorBubbling,
|
|
3252
3270
|
skipRevalidation,
|
|
3253
3271
|
dataStrategy,
|
|
3254
|
-
generateMiddlewareResponse
|
|
3272
|
+
generateMiddlewareResponse,
|
|
3273
|
+
unstable_normalizePath
|
|
3255
3274
|
} = {}) {
|
|
3256
|
-
let
|
|
3275
|
+
let normalizePath = unstable_normalizePath || defaultNormalizePath;
|
|
3257
3276
|
let method = request.method;
|
|
3258
|
-
let location = createLocation("",
|
|
3277
|
+
let location = createLocation("", normalizePath(request), null, "default");
|
|
3259
3278
|
let matches = matchRoutes(dataRoutes, location, basename);
|
|
3260
3279
|
requestContext = requestContext != null ? requestContext : new RouterContextProvider();
|
|
3261
3280
|
if (!isValidMethod(method) && method !== "HEAD") {
|
|
@@ -3308,6 +3327,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3308
3327
|
let response = await runServerMiddlewarePipeline(
|
|
3309
3328
|
{
|
|
3310
3329
|
request,
|
|
3330
|
+
unstable_url: createDataFunctionUrl(request, location),
|
|
3311
3331
|
unstable_pattern: getRoutePattern(matches),
|
|
3312
3332
|
matches,
|
|
3313
3333
|
params: matches[0].params,
|
|
@@ -3372,9 +3392,9 @@ function createStaticHandler(routes, opts) {
|
|
|
3372
3392
|
} else {
|
|
3373
3393
|
let boundaryRouteId = skipLoaderErrorBubbling ? routeId : findNearestBoundary(
|
|
3374
3394
|
matches,
|
|
3375
|
-
_optionalChain([matches, 'access',
|
|
3395
|
+
_optionalChain([matches, 'access', _32 => _32.find, 'call', _33 => _33(
|
|
3376
3396
|
(m) => m.route.id === routeId || m.route.loader
|
|
3377
|
-
), 'optionalAccess',
|
|
3397
|
+
), 'optionalAccess', _34 => _34.route, 'access', _35 => _35.id]) || routeId
|
|
3378
3398
|
).route.id;
|
|
3379
3399
|
let staticContext = {
|
|
3380
3400
|
matches,
|
|
@@ -3424,11 +3444,12 @@ function createStaticHandler(routes, opts) {
|
|
|
3424
3444
|
routeId,
|
|
3425
3445
|
requestContext,
|
|
3426
3446
|
dataStrategy,
|
|
3427
|
-
generateMiddlewareResponse
|
|
3447
|
+
generateMiddlewareResponse,
|
|
3448
|
+
unstable_normalizePath
|
|
3428
3449
|
} = {}) {
|
|
3429
|
-
let
|
|
3450
|
+
let normalizePath = unstable_normalizePath || defaultNormalizePath;
|
|
3430
3451
|
let method = request.method;
|
|
3431
|
-
let location = createLocation("",
|
|
3452
|
+
let location = createLocation("", normalizePath(request), null, "default");
|
|
3432
3453
|
let matches = matchRoutes(dataRoutes, location, basename);
|
|
3433
3454
|
requestContext = requestContext != null ? requestContext : new RouterContextProvider();
|
|
3434
3455
|
if (!isValidMethod(method) && method !== "HEAD" && method !== "OPTIONS") {
|
|
@@ -3454,6 +3475,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3454
3475
|
let response = await runServerMiddlewarePipeline(
|
|
3455
3476
|
{
|
|
3456
3477
|
request,
|
|
3478
|
+
unstable_url: createDataFunctionUrl(request, location),
|
|
3457
3479
|
unstable_pattern: getRoutePattern(matches),
|
|
3458
3480
|
matches,
|
|
3459
3481
|
params: matches[0].params,
|
|
@@ -3531,6 +3553,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3531
3553
|
if (isMutationMethod(request.method)) {
|
|
3532
3554
|
let result2 = await submit(
|
|
3533
3555
|
request,
|
|
3556
|
+
location,
|
|
3534
3557
|
matches,
|
|
3535
3558
|
routeMatch || getTargetMatch(matches, location),
|
|
3536
3559
|
requestContext,
|
|
@@ -3544,6 +3567,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3544
3567
|
}
|
|
3545
3568
|
let result = await loadRouteData(
|
|
3546
3569
|
request,
|
|
3570
|
+
location,
|
|
3547
3571
|
matches,
|
|
3548
3572
|
requestContext,
|
|
3549
3573
|
dataStrategy,
|
|
@@ -3569,7 +3593,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3569
3593
|
throw e;
|
|
3570
3594
|
}
|
|
3571
3595
|
}
|
|
3572
|
-
async function submit(request, matches, actionMatch, requestContext, dataStrategy, skipLoaderErrorBubbling, isRouteRequest, filterMatchesToLoad, skipRevalidation) {
|
|
3596
|
+
async function submit(request, location, matches, actionMatch, requestContext, dataStrategy, skipLoaderErrorBubbling, isRouteRequest, filterMatchesToLoad, skipRevalidation) {
|
|
3573
3597
|
let result;
|
|
3574
3598
|
if (!actionMatch.route.action && !actionMatch.route.lazy) {
|
|
3575
3599
|
let error = getInternalRouterError(405, {
|
|
@@ -3589,6 +3613,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3589
3613
|
mapRouteProperties2,
|
|
3590
3614
|
manifest,
|
|
3591
3615
|
request,
|
|
3616
|
+
location,
|
|
3592
3617
|
matches,
|
|
3593
3618
|
actionMatch,
|
|
3594
3619
|
[],
|
|
@@ -3596,6 +3621,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3596
3621
|
);
|
|
3597
3622
|
let results = await callDataStrategy(
|
|
3598
3623
|
request,
|
|
3624
|
+
location,
|
|
3599
3625
|
dsMatches,
|
|
3600
3626
|
isRouteRequest,
|
|
3601
3627
|
requestContext,
|
|
@@ -3669,6 +3695,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3669
3695
|
let boundaryMatch = skipLoaderErrorBubbling ? actionMatch : findNearestBoundary(matches, actionMatch.route.id);
|
|
3670
3696
|
let handlerContext2 = await loadRouteData(
|
|
3671
3697
|
loaderRequest,
|
|
3698
|
+
location,
|
|
3672
3699
|
matches,
|
|
3673
3700
|
requestContext,
|
|
3674
3701
|
dataStrategy,
|
|
@@ -3688,6 +3715,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3688
3715
|
}
|
|
3689
3716
|
let handlerContext = await loadRouteData(
|
|
3690
3717
|
loaderRequest,
|
|
3718
|
+
location,
|
|
3691
3719
|
matches,
|
|
3692
3720
|
requestContext,
|
|
3693
3721
|
dataStrategy,
|
|
@@ -3705,13 +3733,13 @@ function createStaticHandler(routes, opts) {
|
|
|
3705
3733
|
actionHeaders: result.headers ? { [actionMatch.route.id]: result.headers } : {}
|
|
3706
3734
|
};
|
|
3707
3735
|
}
|
|
3708
|
-
async function loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, filterMatchesToLoad, pendingActionResult) {
|
|
3736
|
+
async function loadRouteData(request, location, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, filterMatchesToLoad, pendingActionResult) {
|
|
3709
3737
|
let isRouteRequest = routeMatch != null;
|
|
3710
|
-
if (isRouteRequest && !_optionalChain([routeMatch, 'optionalAccess',
|
|
3738
|
+
if (isRouteRequest && !_optionalChain([routeMatch, 'optionalAccess', _36 => _36.route, 'access', _37 => _37.loader]) && !_optionalChain([routeMatch, 'optionalAccess', _38 => _38.route, 'access', _39 => _39.lazy])) {
|
|
3711
3739
|
throw getInternalRouterError(400, {
|
|
3712
3740
|
method: request.method,
|
|
3713
3741
|
pathname: new URL(request.url).pathname,
|
|
3714
|
-
routeId: _optionalChain([routeMatch, 'optionalAccess',
|
|
3742
|
+
routeId: _optionalChain([routeMatch, 'optionalAccess', _40 => _40.route, 'access', _41 => _41.id])
|
|
3715
3743
|
});
|
|
3716
3744
|
}
|
|
3717
3745
|
let dsMatches;
|
|
@@ -3720,6 +3748,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3720
3748
|
mapRouteProperties2,
|
|
3721
3749
|
manifest,
|
|
3722
3750
|
request,
|
|
3751
|
+
location,
|
|
3723
3752
|
matches,
|
|
3724
3753
|
routeMatch,
|
|
3725
3754
|
[],
|
|
@@ -3737,6 +3766,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3737
3766
|
mapRouteProperties2,
|
|
3738
3767
|
manifest,
|
|
3739
3768
|
request,
|
|
3769
|
+
location,
|
|
3740
3770
|
pattern,
|
|
3741
3771
|
match,
|
|
3742
3772
|
[],
|
|
@@ -3748,6 +3778,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3748
3778
|
mapRouteProperties2,
|
|
3749
3779
|
manifest,
|
|
3750
3780
|
request,
|
|
3781
|
+
location,
|
|
3751
3782
|
pattern,
|
|
3752
3783
|
match,
|
|
3753
3784
|
[],
|
|
@@ -3769,6 +3800,7 @@ function createStaticHandler(routes, opts) {
|
|
|
3769
3800
|
}
|
|
3770
3801
|
let results = await callDataStrategy(
|
|
3771
3802
|
request,
|
|
3803
|
+
location,
|
|
3772
3804
|
dsMatches,
|
|
3773
3805
|
isRouteRequest,
|
|
3774
3806
|
requestContext,
|
|
@@ -3789,10 +3821,11 @@ function createStaticHandler(routes, opts) {
|
|
|
3789
3821
|
matches
|
|
3790
3822
|
};
|
|
3791
3823
|
}
|
|
3792
|
-
async function callDataStrategy(request, matches, isRouteRequest, requestContext, dataStrategy) {
|
|
3824
|
+
async function callDataStrategy(request, location, matches, isRouteRequest, requestContext, dataStrategy) {
|
|
3793
3825
|
let results = await callDataStrategyImpl(
|
|
3794
3826
|
dataStrategy || defaultDataStrategy,
|
|
3795
3827
|
request,
|
|
3828
|
+
location,
|
|
3796
3829
|
matches,
|
|
3797
3830
|
null,
|
|
3798
3831
|
requestContext,
|
|
@@ -3855,6 +3888,14 @@ function throwStaticHandlerAbortedError(request, isRouteRequest) {
|
|
|
3855
3888
|
function isSubmissionNavigation(opts) {
|
|
3856
3889
|
return opts != null && ("formData" in opts && opts.formData != null || "body" in opts && opts.body !== void 0);
|
|
3857
3890
|
}
|
|
3891
|
+
function defaultNormalizePath(request) {
|
|
3892
|
+
let url = new URL(request.url);
|
|
3893
|
+
return {
|
|
3894
|
+
pathname: url.pathname,
|
|
3895
|
+
search: url.search,
|
|
3896
|
+
hash: url.hash
|
|
3897
|
+
};
|
|
3898
|
+
}
|
|
3858
3899
|
function normalizeTo(location, matches, basename, to, fromRouteId, relative) {
|
|
3859
3900
|
let contextualMatches;
|
|
3860
3901
|
let activeRouteMatch;
|
|
@@ -4022,7 +4063,7 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest,
|
|
|
4022
4063
|
let shouldSkipRevalidation = actionStatus && actionStatus >= 400;
|
|
4023
4064
|
let baseShouldRevalidateArgs = {
|
|
4024
4065
|
currentUrl,
|
|
4025
|
-
currentParams: _optionalChain([state, 'access',
|
|
4066
|
+
currentParams: _optionalChain([state, 'access', _42 => _42.matches, 'access', _43 => _43[0], 'optionalAccess', _44 => _44.params]) || {},
|
|
4026
4067
|
nextUrl,
|
|
4027
4068
|
nextParams: matches[0].params,
|
|
4028
4069
|
...submission,
|
|
@@ -4054,6 +4095,7 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest,
|
|
|
4054
4095
|
mapRouteProperties2,
|
|
4055
4096
|
manifest,
|
|
4056
4097
|
request,
|
|
4098
|
+
location,
|
|
4057
4099
|
pattern,
|
|
4058
4100
|
match,
|
|
4059
4101
|
lazyRoutePropertiesToSkip,
|
|
@@ -4084,6 +4126,7 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest,
|
|
|
4084
4126
|
mapRouteProperties2,
|
|
4085
4127
|
manifest,
|
|
4086
4128
|
request,
|
|
4129
|
+
location,
|
|
4087
4130
|
pattern,
|
|
4088
4131
|
match,
|
|
4089
4132
|
lazyRoutePropertiesToSkip,
|
|
@@ -4133,6 +4176,7 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest,
|
|
|
4133
4176
|
mapRouteProperties2,
|
|
4134
4177
|
manifest,
|
|
4135
4178
|
fetchRequest,
|
|
4179
|
+
f.path,
|
|
4136
4180
|
fetcherMatches,
|
|
4137
4181
|
fetcherMatch,
|
|
4138
4182
|
lazyRoutePropertiesToSkip,
|
|
@@ -4144,6 +4188,7 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest,
|
|
|
4144
4188
|
mapRouteProperties2,
|
|
4145
4189
|
manifest,
|
|
4146
4190
|
fetchRequest,
|
|
4191
|
+
f.path,
|
|
4147
4192
|
fetcherMatches,
|
|
4148
4193
|
fetcherMatch,
|
|
4149
4194
|
lazyRoutePropertiesToSkip,
|
|
@@ -4168,6 +4213,7 @@ function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest,
|
|
|
4168
4213
|
mapRouteProperties2,
|
|
4169
4214
|
manifest,
|
|
4170
4215
|
fetchRequest,
|
|
4216
|
+
f.path,
|
|
4171
4217
|
fetcherMatches,
|
|
4172
4218
|
fetcherMatch,
|
|
4173
4219
|
lazyRoutePropertiesToSkip,
|
|
@@ -4269,7 +4315,7 @@ function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRoutePrope
|
|
|
4269
4315
|
let newRoutes = convertRoutesToDataRoutes(
|
|
4270
4316
|
uniqueChildren,
|
|
4271
4317
|
mapRouteProperties2,
|
|
4272
|
-
[routeId || "_", "patch", String(_optionalChain([childrenToPatch, 'optionalAccess',
|
|
4318
|
+
[routeId || "_", "patch", String(_optionalChain([childrenToPatch, 'optionalAccess', _45 => _45.length]) || "0")],
|
|
4273
4319
|
manifest
|
|
4274
4320
|
);
|
|
4275
4321
|
childrenToPatch.push(...newRoutes);
|
|
@@ -4305,8 +4351,8 @@ function isSameRoute(newRoute, existingRoute) {
|
|
|
4305
4351
|
if ((!newRoute.children || newRoute.children.length === 0) && (!existingRoute.children || existingRoute.children.length === 0)) {
|
|
4306
4352
|
return true;
|
|
4307
4353
|
}
|
|
4308
|
-
return _nullishCoalesce(_optionalChain([newRoute, 'access',
|
|
4309
|
-
(aChild, i) => _optionalChain([existingRoute, 'access',
|
|
4354
|
+
return _nullishCoalesce(_optionalChain([newRoute, 'access', _46 => _46.children, 'optionalAccess', _47 => _47.every, 'call', _48 => _48(
|
|
4355
|
+
(aChild, i) => _optionalChain([existingRoute, 'access', _49 => _49.children, 'optionalAccess', _50 => _50.some, 'call', _51 => _51((bChild) => isSameRoute(aChild, bChild))])
|
|
4310
4356
|
)]), () => ( false));
|
|
4311
4357
|
}
|
|
4312
4358
|
var lazyRoutePropertyCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -4454,9 +4500,9 @@ function loadLazyRoute(route, type, manifest, mapRouteProperties2, lazyRouteProp
|
|
|
4454
4500
|
}
|
|
4455
4501
|
let lazyRoutePromise = lazyPropertyPromises.length > 0 ? Promise.all(lazyPropertyPromises).then(() => {
|
|
4456
4502
|
}) : void 0;
|
|
4457
|
-
_optionalChain([lazyRoutePromise, 'optionalAccess',
|
|
4503
|
+
_optionalChain([lazyRoutePromise, 'optionalAccess', _52 => _52.catch, 'call', _53 => _53(() => {
|
|
4458
4504
|
})]);
|
|
4459
|
-
_optionalChain([lazyHandlerPromise, 'optionalAccess',
|
|
4505
|
+
_optionalChain([lazyHandlerPromise, 'optionalAccess', _54 => _54.catch, 'call', _55 => _55(() => {
|
|
4460
4506
|
})]);
|
|
4461
4507
|
return {
|
|
4462
4508
|
lazyRoutePromise,
|
|
@@ -4552,17 +4598,12 @@ function runClientMiddlewarePipeline(args, handler) {
|
|
|
4552
4598
|
}
|
|
4553
4599
|
}
|
|
4554
4600
|
async function runMiddlewarePipeline(args, handler, processResult, isResult, errorHandler) {
|
|
4555
|
-
let { matches,
|
|
4601
|
+
let { matches, ...dataFnArgs } = args;
|
|
4556
4602
|
let tuples = matches.flatMap(
|
|
4557
4603
|
(m) => m.route.middleware ? m.route.middleware.map((fn) => [m.route.id, fn]) : []
|
|
4558
4604
|
);
|
|
4559
4605
|
let result = await callRouteMiddleware(
|
|
4560
|
-
|
|
4561
|
-
request,
|
|
4562
|
-
params,
|
|
4563
|
-
context,
|
|
4564
|
-
unstable_pattern
|
|
4565
|
-
},
|
|
4606
|
+
dataFnArgs,
|
|
4566
4607
|
tuples,
|
|
4567
4608
|
handler,
|
|
4568
4609
|
processResult,
|
|
@@ -4640,7 +4681,7 @@ function getDataStrategyMatchLazyPromises(mapRouteProperties2, manifest, request
|
|
|
4640
4681
|
handler: lazyRoutePromises.lazyHandlerPromise
|
|
4641
4682
|
};
|
|
4642
4683
|
}
|
|
4643
|
-
function getDataStrategyMatch(mapRouteProperties2, manifest, request, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null, callSiteDefaultShouldRevalidate) {
|
|
4684
|
+
function getDataStrategyMatch(mapRouteProperties2, manifest, request, path, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null, callSiteDefaultShouldRevalidate) {
|
|
4644
4685
|
let isUsingNewApi = false;
|
|
4645
4686
|
let _lazyPromises = getDataStrategyMatchLazyPromises(
|
|
4646
4687
|
mapRouteProperties2,
|
|
@@ -4680,10 +4721,11 @@ function getDataStrategyMatch(mapRouteProperties2, manifest, request, unstable_p
|
|
|
4680
4721
|
if (callHandler && (isMutationMethod(request.method) || !isMiddlewareOnlyRoute)) {
|
|
4681
4722
|
return callLoaderOrAction({
|
|
4682
4723
|
request,
|
|
4724
|
+
path,
|
|
4683
4725
|
unstable_pattern,
|
|
4684
4726
|
match,
|
|
4685
|
-
lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess',
|
|
4686
|
-
lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess',
|
|
4727
|
+
lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess', _56 => _56.handler]),
|
|
4728
|
+
lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess', _57 => _57.route]),
|
|
4687
4729
|
handlerOverride,
|
|
4688
4730
|
scopedContext
|
|
4689
4731
|
});
|
|
@@ -4692,7 +4734,7 @@ function getDataStrategyMatch(mapRouteProperties2, manifest, request, unstable_p
|
|
|
4692
4734
|
}
|
|
4693
4735
|
};
|
|
4694
4736
|
}
|
|
4695
|
-
function getTargetedDataStrategyMatches(mapRouteProperties2, manifest, request, matches, targetMatch, lazyRoutePropertiesToSkip, scopedContext, shouldRevalidateArgs = null) {
|
|
4737
|
+
function getTargetedDataStrategyMatches(mapRouteProperties2, manifest, request, path, matches, targetMatch, lazyRoutePropertiesToSkip, scopedContext, shouldRevalidateArgs = null) {
|
|
4696
4738
|
return matches.map((match) => {
|
|
4697
4739
|
if (match.route.id !== targetMatch.route.id) {
|
|
4698
4740
|
return {
|
|
@@ -4714,6 +4756,7 @@ function getTargetedDataStrategyMatches(mapRouteProperties2, manifest, request,
|
|
|
4714
4756
|
mapRouteProperties2,
|
|
4715
4757
|
manifest,
|
|
4716
4758
|
request,
|
|
4759
|
+
path,
|
|
4717
4760
|
getRoutePattern(matches),
|
|
4718
4761
|
match,
|
|
4719
4762
|
lazyRoutePropertiesToSkip,
|
|
@@ -4723,12 +4766,13 @@ function getTargetedDataStrategyMatches(mapRouteProperties2, manifest, request,
|
|
|
4723
4766
|
);
|
|
4724
4767
|
});
|
|
4725
4768
|
}
|
|
4726
|
-
async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherKey, scopedContext, isStaticHandler) {
|
|
4727
|
-
if (matches.some((m) => _optionalChain([m, 'access',
|
|
4728
|
-
await Promise.all(matches.map((m) => _optionalChain([m, 'access',
|
|
4769
|
+
async function callDataStrategyImpl(dataStrategyImpl, request, path, matches, fetcherKey, scopedContext, isStaticHandler) {
|
|
4770
|
+
if (matches.some((m) => _optionalChain([m, 'access', _58 => _58._lazyPromises, 'optionalAccess', _59 => _59.middleware]))) {
|
|
4771
|
+
await Promise.all(matches.map((m) => _optionalChain([m, 'access', _60 => _60._lazyPromises, 'optionalAccess', _61 => _61.middleware])));
|
|
4729
4772
|
}
|
|
4730
4773
|
let dataStrategyArgs = {
|
|
4731
4774
|
request,
|
|
4775
|
+
unstable_url: createDataFunctionUrl(request, path),
|
|
4732
4776
|
unstable_pattern: getRoutePattern(matches),
|
|
4733
4777
|
params: matches[0].params,
|
|
4734
4778
|
context: scopedContext,
|
|
@@ -4760,8 +4804,8 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
|
|
|
4760
4804
|
try {
|
|
4761
4805
|
await Promise.all(
|
|
4762
4806
|
matches.flatMap((m) => [
|
|
4763
|
-
_optionalChain([m, 'access',
|
|
4764
|
-
_optionalChain([m, 'access',
|
|
4807
|
+
_optionalChain([m, 'access', _62 => _62._lazyPromises, 'optionalAccess', _63 => _63.handler]),
|
|
4808
|
+
_optionalChain([m, 'access', _64 => _64._lazyPromises, 'optionalAccess', _65 => _65.route])
|
|
4765
4809
|
])
|
|
4766
4810
|
);
|
|
4767
4811
|
} catch (e) {
|
|
@@ -4770,6 +4814,7 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
|
|
|
4770
4814
|
}
|
|
4771
4815
|
async function callLoaderOrAction({
|
|
4772
4816
|
request,
|
|
4817
|
+
path,
|
|
4773
4818
|
unstable_pattern,
|
|
4774
4819
|
match,
|
|
4775
4820
|
lazyHandlerPromise,
|
|
@@ -4797,6 +4842,7 @@ async function callLoaderOrAction({
|
|
|
4797
4842
|
return handler(
|
|
4798
4843
|
{
|
|
4799
4844
|
request,
|
|
4845
|
+
unstable_url: createDataFunctionUrl(request, path),
|
|
4800
4846
|
unstable_pattern,
|
|
4801
4847
|
params: match.params,
|
|
4802
4848
|
context: scopedContext
|
|
@@ -4906,15 +4952,15 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
|
|
|
4906
4952
|
return {
|
|
4907
4953
|
type: "error" /* error */,
|
|
4908
4954
|
error: result.data,
|
|
4909
|
-
statusCode: _optionalChain([result, 'access',
|
|
4910
|
-
headers: _optionalChain([result, 'access',
|
|
4955
|
+
statusCode: _optionalChain([result, 'access', _66 => _66.init, 'optionalAccess', _67 => _67.status]),
|
|
4956
|
+
headers: _optionalChain([result, 'access', _68 => _68.init, 'optionalAccess', _69 => _69.headers]) ? new Headers(result.init.headers) : void 0
|
|
4911
4957
|
};
|
|
4912
4958
|
}
|
|
4913
4959
|
return {
|
|
4914
4960
|
type: "error" /* error */,
|
|
4915
4961
|
error: dataWithResponseInitToErrorResponse(result),
|
|
4916
4962
|
statusCode: isRouteErrorResponse(result) ? result.status : void 0,
|
|
4917
|
-
headers: _optionalChain([result, 'access',
|
|
4963
|
+
headers: _optionalChain([result, 'access', _70 => _70.init, 'optionalAccess', _71 => _71.headers]) ? new Headers(result.init.headers) : void 0
|
|
4918
4964
|
};
|
|
4919
4965
|
}
|
|
4920
4966
|
return {
|
|
@@ -4927,8 +4973,8 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
|
|
|
4927
4973
|
return {
|
|
4928
4974
|
type: "data" /* data */,
|
|
4929
4975
|
data: result.data,
|
|
4930
|
-
statusCode: _optionalChain([result, 'access',
|
|
4931
|
-
headers: _optionalChain([result, 'access',
|
|
4976
|
+
statusCode: _optionalChain([result, 'access', _72 => _72.init, 'optionalAccess', _73 => _73.status]),
|
|
4977
|
+
headers: _optionalChain([result, 'access', _74 => _74.init, 'optionalAccess', _75 => _75.headers]) ? new Headers(result.init.headers) : void 0
|
|
4932
4978
|
};
|
|
4933
4979
|
}
|
|
4934
4980
|
return { type: "data" /* data */, data: result };
|
|
@@ -4954,20 +5000,20 @@ function normalizeRelativeRoutingRedirectResponse(response, request, routeId, ma
|
|
|
4954
5000
|
}
|
|
4955
5001
|
return response;
|
|
4956
5002
|
}
|
|
5003
|
+
var invalidProtocols = [
|
|
5004
|
+
"about:",
|
|
5005
|
+
"blob:",
|
|
5006
|
+
"chrome:",
|
|
5007
|
+
"chrome-untrusted:",
|
|
5008
|
+
"content:",
|
|
5009
|
+
"data:",
|
|
5010
|
+
"devtools:",
|
|
5011
|
+
"file:",
|
|
5012
|
+
"filesystem:",
|
|
5013
|
+
// eslint-disable-next-line no-script-url
|
|
5014
|
+
"javascript:"
|
|
5015
|
+
];
|
|
4957
5016
|
function normalizeRedirectLocation(location, currentUrl, basename, historyInstance) {
|
|
4958
|
-
let invalidProtocols = [
|
|
4959
|
-
"about:",
|
|
4960
|
-
"blob:",
|
|
4961
|
-
"chrome:",
|
|
4962
|
-
"chrome-untrusted:",
|
|
4963
|
-
"content:",
|
|
4964
|
-
"data:",
|
|
4965
|
-
"devtools:",
|
|
4966
|
-
"file:",
|
|
4967
|
-
"filesystem:",
|
|
4968
|
-
// eslint-disable-next-line no-script-url
|
|
4969
|
-
"javascript:"
|
|
4970
|
-
];
|
|
4971
5017
|
if (isAbsoluteUrl(location)) {
|
|
4972
5018
|
let normalizedLocation = location;
|
|
4973
5019
|
let url = normalizedLocation.startsWith("//") ? new URL(currentUrl.protocol + normalizedLocation) : new URL(normalizedLocation);
|
|
@@ -5007,6 +5053,24 @@ function createClientSideRequest(history, location, signal, submission) {
|
|
|
5007
5053
|
}
|
|
5008
5054
|
return new Request(url, init);
|
|
5009
5055
|
}
|
|
5056
|
+
function createDataFunctionUrl(request, path) {
|
|
5057
|
+
let url = new URL(request.url);
|
|
5058
|
+
let parsed = typeof path === "string" ? parsePath(path) : path;
|
|
5059
|
+
url.pathname = parsed.pathname || "/";
|
|
5060
|
+
if (parsed.search) {
|
|
5061
|
+
let searchParams = new URLSearchParams(parsed.search);
|
|
5062
|
+
let indexValues = searchParams.getAll("index");
|
|
5063
|
+
searchParams.delete("index");
|
|
5064
|
+
for (let value of indexValues.filter(Boolean)) {
|
|
5065
|
+
searchParams.append("index", value);
|
|
5066
|
+
}
|
|
5067
|
+
url.search = searchParams.size ? `?${searchParams.toString()}` : "";
|
|
5068
|
+
} else {
|
|
5069
|
+
url.search = "";
|
|
5070
|
+
}
|
|
5071
|
+
url.hash = parsed.hash || "";
|
|
5072
|
+
return url;
|
|
5073
|
+
}
|
|
5010
5074
|
function convertFormDataToSearchParams(formData) {
|
|
5011
5075
|
let searchParams = new URLSearchParams();
|
|
5012
5076
|
for (let [key, value] of formData.entries()) {
|
|
@@ -5100,7 +5164,7 @@ function processLoaderData(state, matches, results, pendingActionResult, revalid
|
|
|
5100
5164
|
let result = fetcherResults[key];
|
|
5101
5165
|
invariant(result, "Did not find corresponding fetcher result");
|
|
5102
5166
|
if (isErrorResult(result)) {
|
|
5103
|
-
let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess',
|
|
5167
|
+
let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess', _76 => _76.route, 'access', _77 => _77.id]));
|
|
5104
5168
|
if (!(errors && errors[boundaryMatch.route.id])) {
|
|
5105
5169
|
errors = {
|
|
5106
5170
|
...errors,
|
|
@@ -5234,8 +5298,8 @@ function dataWithResponseInitToResponse(data2) {
|
|
|
5234
5298
|
}
|
|
5235
5299
|
function dataWithResponseInitToErrorResponse(data2) {
|
|
5236
5300
|
return new ErrorResponseImpl(
|
|
5237
|
-
_nullishCoalesce(_optionalChain([data2, 'access',
|
|
5238
|
-
_nullishCoalesce(_optionalChain([data2, 'access',
|
|
5301
|
+
_nullishCoalesce(_optionalChain([data2, 'access', _78 => _78.init, 'optionalAccess', _79 => _79.status]), () => ( 500)),
|
|
5302
|
+
_nullishCoalesce(_optionalChain([data2, 'access', _80 => _80.init, 'optionalAccess', _81 => _81.statusText]), () => ( "Internal Server Error")),
|
|
5239
5303
|
data2.data
|
|
5240
5304
|
);
|
|
5241
5305
|
}
|
|
@@ -6138,7 +6202,7 @@ function encode(input, options) {
|
|
|
6138
6202
|
raceDone();
|
|
6139
6203
|
}
|
|
6140
6204
|
await Promise.all(Object.values(encoder.deferred));
|
|
6141
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
6205
|
+
_optionalChain([onComplete, 'optionalCall', _82 => _82()]);
|
|
6142
6206
|
controller.close();
|
|
6143
6207
|
}
|
|
6144
6208
|
});
|
|
@@ -6268,7 +6332,7 @@ function getTurboStreamSingleFetchDataStrategy(getRouter, manifest, routeModules
|
|
|
6268
6332
|
return {
|
|
6269
6333
|
hasLoader: manifestRoute.hasLoader,
|
|
6270
6334
|
hasClientLoader: manifestRoute.hasClientLoader,
|
|
6271
|
-
hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess',
|
|
6335
|
+
hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess', _83 => _83.shouldRevalidate]))
|
|
6272
6336
|
};
|
|
6273
6337
|
},
|
|
6274
6338
|
fetchAndDecodeViaTurboStream,
|
|
@@ -6469,7 +6533,7 @@ async function bubbleMiddlewareErrors(singleFetchPromise, matches, routesParams,
|
|
|
6469
6533
|
let routeResult = fetchedData.routes[match.route.id];
|
|
6470
6534
|
if ("error" in routeResult) {
|
|
6471
6535
|
middlewareError = routeResult.error;
|
|
6472
|
-
if (_optionalChain([results, 'access',
|
|
6536
|
+
if (_optionalChain([results, 'access', _84 => _84[match.route.id], 'optionalAccess', _85 => _85.result]) == null) {
|
|
6473
6537
|
results[match.route.id] = {
|
|
6474
6538
|
type: "error",
|
|
6475
6539
|
result: middlewareError
|
|
@@ -6592,7 +6656,7 @@ async function fetchAndDecodeViaTurboStream(args, basename, trailingSlashAware,
|
|
|
6592
6656
|
}
|
|
6593
6657
|
} else {
|
|
6594
6658
|
let typed = decoded.value;
|
|
6595
|
-
let routeId = _optionalChain([targetRoutes, 'optionalAccess',
|
|
6659
|
+
let routeId = _optionalChain([targetRoutes, 'optionalAccess', _86 => _86[0]]);
|
|
6596
6660
|
invariant2(routeId, "No routeId found for single fetch call decoding");
|
|
6597
6661
|
if ("redirect" in typed) {
|
|
6598
6662
|
data2 = { redirect: typed };
|
|
@@ -6939,7 +7003,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
6939
7003
|
if (locationArg) {
|
|
6940
7004
|
let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
|
|
6941
7005
|
invariant(
|
|
6942
|
-
parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access',
|
|
7006
|
+
parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access', _87 => _87.pathname, 'optionalAccess', _88 => _88.startsWith, 'call', _89 => _89(parentPathnameBase)]),
|
|
6943
7007
|
`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${parentPathnameBase}" but pathname "${parsedLocationArg.pathname}" was given in the \`location\` prop.`
|
|
6944
7008
|
);
|
|
6945
7009
|
location = parsedLocationArg;
|
|
@@ -6971,21 +7035,21 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
|
|
|
6971
7035
|
pathname: joinPaths([
|
|
6972
7036
|
parentPathnameBase,
|
|
6973
7037
|
// Re-encode pathnames that were decoded inside matchRoutes.
|
|
6974
|
-
// Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
|
|
7038
|
+
// Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
|
|
6975
7039
|
// `new URL()` internally and we need to prevent it from treating
|
|
6976
7040
|
// them as separators
|
|
6977
7041
|
navigator.encodeLocation ? navigator.encodeLocation(
|
|
6978
|
-
match.pathname.replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
7042
|
+
match.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
6979
7043
|
).pathname : match.pathname
|
|
6980
7044
|
]),
|
|
6981
7045
|
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([
|
|
6982
7046
|
parentPathnameBase,
|
|
6983
7047
|
// Re-encode pathnames that were decoded inside matchRoutes
|
|
6984
|
-
// Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
|
|
7048
|
+
// Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
|
|
6985
7049
|
// `new URL()` internally and we need to prevent it from treating
|
|
6986
7050
|
// them as separators
|
|
6987
7051
|
navigator.encodeLocation ? navigator.encodeLocation(
|
|
6988
|
-
match.pathnameBase.replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
7052
|
+
match.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
6989
7053
|
).pathname : match.pathnameBase
|
|
6990
7054
|
])
|
|
6991
7055
|
})
|
|
@@ -7133,7 +7197,7 @@ function RenderedRoute({ routeContext, match, children }) {
|
|
|
7133
7197
|
return /* @__PURE__ */ React3.createElement(RouteContext.Provider, { value: routeContext }, children);
|
|
7134
7198
|
}
|
|
7135
7199
|
function _renderMatches(matches, parentMatches = [], dataRouterOpts) {
|
|
7136
|
-
let dataRouterState = _optionalChain([dataRouterOpts, 'optionalAccess',
|
|
7200
|
+
let dataRouterState = _optionalChain([dataRouterOpts, 'optionalAccess', _90 => _90.state]);
|
|
7137
7201
|
if (matches == null) {
|
|
7138
7202
|
if (!dataRouterState) {
|
|
7139
7203
|
return null;
|
|
@@ -7147,10 +7211,10 @@ function _renderMatches(matches, parentMatches = [], dataRouterOpts) {
|
|
|
7147
7211
|
}
|
|
7148
7212
|
}
|
|
7149
7213
|
let renderedMatches = matches;
|
|
7150
|
-
let errors = _optionalChain([dataRouterState, 'optionalAccess',
|
|
7214
|
+
let errors = _optionalChain([dataRouterState, 'optionalAccess', _91 => _91.errors]);
|
|
7151
7215
|
if (errors != null) {
|
|
7152
7216
|
let errorIndex = renderedMatches.findIndex(
|
|
7153
|
-
(m) => m.route.id && _optionalChain([errors, 'optionalAccess',
|
|
7217
|
+
(m) => m.route.id && _optionalChain([errors, 'optionalAccess', _92 => _92[m.route.id]]) !== void 0
|
|
7154
7218
|
);
|
|
7155
7219
|
invariant(
|
|
7156
7220
|
errorIndex >= 0,
|
|
@@ -7189,11 +7253,11 @@ function _renderMatches(matches, parentMatches = [], dataRouterOpts) {
|
|
|
7189
7253
|
}
|
|
7190
7254
|
}
|
|
7191
7255
|
}
|
|
7192
|
-
let onErrorHandler = _optionalChain([dataRouterOpts, 'optionalAccess',
|
|
7256
|
+
let onErrorHandler = _optionalChain([dataRouterOpts, 'optionalAccess', _93 => _93.onError]);
|
|
7193
7257
|
let onError = dataRouterState && onErrorHandler ? (error, errorInfo) => {
|
|
7194
7258
|
onErrorHandler(error, {
|
|
7195
7259
|
location: dataRouterState.location,
|
|
7196
|
-
params: _nullishCoalesce(_optionalChain([dataRouterState, 'access',
|
|
7260
|
+
params: _nullishCoalesce(_optionalChain([dataRouterState, 'access', _94 => _94.matches, 'optionalAccess', _95 => _95[0], 'optionalAccess', _96 => _96.params]), () => ( {})),
|
|
7197
7261
|
unstable_pattern: getRoutePattern(dataRouterState.matches),
|
|
7198
7262
|
errorInfo
|
|
7199
7263
|
});
|
|
@@ -7340,15 +7404,15 @@ function useRouteError() {
|
|
|
7340
7404
|
if (error !== void 0) {
|
|
7341
7405
|
return error;
|
|
7342
7406
|
}
|
|
7343
|
-
return _optionalChain([state, 'access',
|
|
7407
|
+
return _optionalChain([state, 'access', _97 => _97.errors, 'optionalAccess', _98 => _98[routeId]]);
|
|
7344
7408
|
}
|
|
7345
7409
|
function useAsyncValue() {
|
|
7346
7410
|
let value = React3.useContext(AwaitContext);
|
|
7347
|
-
return _optionalChain([value, 'optionalAccess',
|
|
7411
|
+
return _optionalChain([value, 'optionalAccess', _99 => _99._data]);
|
|
7348
7412
|
}
|
|
7349
7413
|
function useAsyncError() {
|
|
7350
7414
|
let value = React3.useContext(AwaitContext);
|
|
7351
|
-
return _optionalChain([value, 'optionalAccess',
|
|
7415
|
+
return _optionalChain([value, 'optionalAccess', _100 => _100._error]);
|
|
7352
7416
|
}
|
|
7353
7417
|
var blockerId = 0;
|
|
7354
7418
|
function useBlocker(shouldBlock) {
|
|
@@ -7429,7 +7493,7 @@ function useRoute(...args) {
|
|
|
7429
7493
|
return {
|
|
7430
7494
|
handle: route.route.handle,
|
|
7431
7495
|
loaderData: state.loaderData[id],
|
|
7432
|
-
actionData: _optionalChain([state, 'access',
|
|
7496
|
+
actionData: _optionalChain([state, 'access', _101 => _101.actionData, 'optionalAccess', _102 => _102[id]])
|
|
7433
7497
|
};
|
|
7434
7498
|
}
|
|
7435
7499
|
|
|
@@ -7474,7 +7538,7 @@ function getKeyedLinksForMatches(matches, routeModules, manifest) {
|
|
|
7474
7538
|
let route = manifest.routes[match.route.id];
|
|
7475
7539
|
return [
|
|
7476
7540
|
route && route.css ? route.css.map((href) => ({ rel: "stylesheet", href })) : [],
|
|
7477
|
-
_optionalChain([module, 'optionalAccess',
|
|
7541
|
+
_optionalChain([module, 'optionalAccess', _103 => _103.links, 'optionalCall', _104 => _104()]) || []
|
|
7478
7542
|
];
|
|
7479
7543
|
}).flat(2);
|
|
7480
7544
|
let preloads = getModuleLinkHrefs(matches, manifest);
|
|
@@ -7575,7 +7639,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
|
|
|
7575
7639
|
// param change, /users/123 -> /users/456
|
|
7576
7640
|
currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path
|
|
7577
7641
|
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
7578
|
-
_optionalChain([currentMatches, 'access',
|
|
7642
|
+
_optionalChain([currentMatches, 'access', _105 => _105[index], 'access', _106 => _106.route, 'access', _107 => _107.path, 'optionalAccess', _108 => _108.endsWith, 'call', _109 => _109("*")]) && currentMatches[index].params["*"] !== match.params["*"]
|
|
7579
7643
|
);
|
|
7580
7644
|
};
|
|
7581
7645
|
if (mode === "assets") {
|
|
@@ -7598,7 +7662,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
|
|
|
7598
7662
|
location.pathname + location.search + location.hash,
|
|
7599
7663
|
window.origin
|
|
7600
7664
|
),
|
|
7601
|
-
currentParams: _optionalChain([currentMatches, 'access',
|
|
7665
|
+
currentParams: _optionalChain([currentMatches, 'access', _110 => _110[0], 'optionalAccess', _111 => _111.params]) || {},
|
|
7602
7666
|
nextUrl: new URL(page, window.origin),
|
|
7603
7667
|
nextParams: match.params,
|
|
7604
7668
|
defaultShouldRevalidate: true
|
|
@@ -7870,11 +7934,17 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7870
7934
|
)
|
|
7871
7935
|
});
|
|
7872
7936
|
let hasInitialData = initialState && initialState.loaderData && route.id in initialState.loaderData;
|
|
7873
|
-
let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess',
|
|
7937
|
+
let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess', _112 => _112.loaderData, 'optionalAccess', _113 => _113[route.id]]) : void 0;
|
|
7874
7938
|
let hasInitialError = initialState && initialState.errors && route.id in initialState.errors;
|
|
7875
|
-
let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess',
|
|
7876
|
-
let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access',
|
|
7877
|
-
dataRoute.loader = async ({
|
|
7939
|
+
let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess', _114 => _114.errors, 'optionalAccess', _115 => _115[route.id]]) : void 0;
|
|
7940
|
+
let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access', _116 => _116.clientLoader, 'optionalAccess', _117 => _117.hydrate]) === true || !route.hasLoader);
|
|
7941
|
+
dataRoute.loader = async ({
|
|
7942
|
+
request,
|
|
7943
|
+
params,
|
|
7944
|
+
context,
|
|
7945
|
+
unstable_pattern,
|
|
7946
|
+
unstable_url
|
|
7947
|
+
}, singleFetch) => {
|
|
7878
7948
|
try {
|
|
7879
7949
|
let result = await prefetchStylesAndCallHandler(async () => {
|
|
7880
7950
|
invariant2(
|
|
@@ -7889,6 +7959,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7889
7959
|
params,
|
|
7890
7960
|
context,
|
|
7891
7961
|
unstable_pattern,
|
|
7962
|
+
unstable_url,
|
|
7892
7963
|
async serverLoader() {
|
|
7893
7964
|
preventInvalidServerHandlerCall("loader", route);
|
|
7894
7965
|
if (isHydrationRequest) {
|
|
@@ -7914,7 +7985,13 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7914
7985
|
route.hasLoader,
|
|
7915
7986
|
isSpaMode
|
|
7916
7987
|
);
|
|
7917
|
-
dataRoute.action = ({
|
|
7988
|
+
dataRoute.action = ({
|
|
7989
|
+
request,
|
|
7990
|
+
params,
|
|
7991
|
+
context,
|
|
7992
|
+
unstable_pattern,
|
|
7993
|
+
unstable_url
|
|
7994
|
+
}, singleFetch) => {
|
|
7918
7995
|
return prefetchStylesAndCallHandler(async () => {
|
|
7919
7996
|
invariant2(
|
|
7920
7997
|
routeModule,
|
|
@@ -7931,6 +8008,7 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
|
|
|
7931
8008
|
params,
|
|
7932
8009
|
context,
|
|
7933
8010
|
unstable_pattern,
|
|
8011
|
+
unstable_url,
|
|
7934
8012
|
async serverAction() {
|
|
7935
8013
|
preventInvalidServerHandlerCall("action", route);
|
|
7936
8014
|
return fetchServerAction(singleFetch);
|
|
@@ -8168,7 +8246,7 @@ function getPatchRoutesOnNavigationFunction(getRouter, manifest, routeModules, s
|
|
|
8168
8246
|
function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscovery, isSpaMode) {
|
|
8169
8247
|
React6.useEffect(() => {
|
|
8170
8248
|
if (!isFogOfWarEnabled(routeDiscovery, ssr) || // @ts-expect-error - TS doesn't know about this yet
|
|
8171
|
-
_optionalChain([window, 'access',
|
|
8249
|
+
_optionalChain([window, 'access', _118 => _118.navigator, 'optionalAccess', _119 => _119.connection, 'optionalAccess', _120 => _120.saveData]) === true) {
|
|
8172
8250
|
return;
|
|
8173
8251
|
}
|
|
8174
8252
|
function registerElement(el) {
|
|
@@ -8277,7 +8355,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
|
|
|
8277
8355
|
}
|
|
8278
8356
|
serverPatches = await res.json();
|
|
8279
8357
|
} catch (e) {
|
|
8280
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
8358
|
+
if (_optionalChain([signal, 'optionalAccess', _121 => _121.aborted])) return;
|
|
8281
8359
|
throw e;
|
|
8282
8360
|
}
|
|
8283
8361
|
let knownRoutes = new Set(Object.keys(manifest.routes));
|
|
@@ -8536,7 +8614,7 @@ function PrefetchPageLinksImpl({
|
|
|
8536
8614
|
if (!manifestRoute || !manifestRoute.hasLoader) {
|
|
8537
8615
|
return;
|
|
8538
8616
|
}
|
|
8539
|
-
if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access',
|
|
8617
|
+
if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access', _122 => _122[m.route.id], 'optionalAccess', _123 => _123.shouldRevalidate])) {
|
|
8540
8618
|
foundOptOutRoute = true;
|
|
8541
8619
|
} else if (manifestRoute.hasClientLoader) {
|
|
8542
8620
|
foundOptOutRoute = true;
|
|
@@ -8624,7 +8702,7 @@ function Meta() {
|
|
|
8624
8702
|
error
|
|
8625
8703
|
};
|
|
8626
8704
|
matches[i] = match;
|
|
8627
|
-
if (_optionalChain([routeModule, 'optionalAccess',
|
|
8705
|
+
if (_optionalChain([routeModule, 'optionalAccess', _124 => _124.meta])) {
|
|
8628
8706
|
routeMeta = typeof routeModule.meta === "function" ? routeModule.meta({
|
|
8629
8707
|
data: data2,
|
|
8630
8708
|
loaderData: data2,
|
|
@@ -8723,7 +8801,7 @@ function Scripts(scriptProps) {
|
|
|
8723
8801
|
}
|
|
8724
8802
|
let streamScript = "window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());";
|
|
8725
8803
|
let contextScript = staticContext ? `window.__reactRouterContext = ${serverHandoffString};${streamScript}` : " ";
|
|
8726
|
-
let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access',
|
|
8804
|
+
let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access', _125 => _125.hmr, 'optionalAccess', _126 => _126.runtime]) ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
|
|
8727
8805
|
${matches.map((match, routeIndex) => {
|
|
8728
8806
|
let routeVarName = `route${routeIndex}`;
|
|
8729
8807
|
let manifestEntry = manifest.routes[match.route.id];
|
|
@@ -8954,7 +9032,7 @@ function BoundaryShell({
|
|
|
8954
9032
|
children
|
|
8955
9033
|
}) {
|
|
8956
9034
|
let { routeModules } = useFrameworkContext();
|
|
8957
|
-
if (_optionalChain([routeModules, 'access',
|
|
9035
|
+
if (_optionalChain([routeModules, 'access', _127 => _127.root, 'optionalAccess', _128 => _128.Layout]) && !isOutsideRemixApp) {
|
|
8958
9036
|
return children;
|
|
8959
9037
|
}
|
|
8960
9038
|
return /* @__PURE__ */ React8.createElement("html", { lang: "en" }, /* @__PURE__ */ React8.createElement("head", null, /* @__PURE__ */ React8.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ React8.createElement(
|
|
@@ -9034,20 +9112,20 @@ var hydrationRouteProperties = [
|
|
|
9034
9112
|
];
|
|
9035
9113
|
function createMemoryRouter(routes, opts) {
|
|
9036
9114
|
return createRouter({
|
|
9037
|
-
basename: _optionalChain([opts, 'optionalAccess',
|
|
9038
|
-
getContext: _optionalChain([opts, 'optionalAccess',
|
|
9039
|
-
future: _optionalChain([opts, 'optionalAccess',
|
|
9115
|
+
basename: _optionalChain([opts, 'optionalAccess', _129 => _129.basename]),
|
|
9116
|
+
getContext: _optionalChain([opts, 'optionalAccess', _130 => _130.getContext]),
|
|
9117
|
+
future: _optionalChain([opts, 'optionalAccess', _131 => _131.future]),
|
|
9040
9118
|
history: createMemoryHistory({
|
|
9041
|
-
initialEntries: _optionalChain([opts, 'optionalAccess',
|
|
9042
|
-
initialIndex: _optionalChain([opts, 'optionalAccess',
|
|
9119
|
+
initialEntries: _optionalChain([opts, 'optionalAccess', _132 => _132.initialEntries]),
|
|
9120
|
+
initialIndex: _optionalChain([opts, 'optionalAccess', _133 => _133.initialIndex])
|
|
9043
9121
|
}),
|
|
9044
|
-
hydrationData: _optionalChain([opts, 'optionalAccess',
|
|
9122
|
+
hydrationData: _optionalChain([opts, 'optionalAccess', _134 => _134.hydrationData]),
|
|
9045
9123
|
routes,
|
|
9046
9124
|
hydrationRouteProperties,
|
|
9047
9125
|
mapRouteProperties,
|
|
9048
|
-
dataStrategy: _optionalChain([opts, 'optionalAccess',
|
|
9049
|
-
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess',
|
|
9050
|
-
unstable_instrumentations: _optionalChain([opts, 'optionalAccess',
|
|
9126
|
+
dataStrategy: _optionalChain([opts, 'optionalAccess', _135 => _135.dataStrategy]),
|
|
9127
|
+
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _136 => _136.patchRoutesOnNavigation]),
|
|
9128
|
+
unstable_instrumentations: _optionalChain([opts, 'optionalAccess', _137 => _137.unstable_instrumentations])
|
|
9051
9129
|
}).initialize();
|
|
9052
9130
|
}
|
|
9053
9131
|
var Deferred2 = class {
|
|
@@ -9093,7 +9171,7 @@ function RouterProvider({
|
|
|
9093
9171
|
Object.values(newErrors).forEach(
|
|
9094
9172
|
(error) => onError(error, {
|
|
9095
9173
|
location: newState.location,
|
|
9096
|
-
params: _nullishCoalesce(_optionalChain([newState, 'access',
|
|
9174
|
+
params: _nullishCoalesce(_optionalChain([newState, 'access', _138 => _138.matches, 'access', _139 => _139[0], 'optionalAccess', _140 => _140.params]), () => ( {})),
|
|
9097
9175
|
unstable_pattern: getRoutePattern(newState.matches)
|
|
9098
9176
|
})
|
|
9099
9177
|
);
|
|
@@ -9131,7 +9209,7 @@ function RouterProvider({
|
|
|
9131
9209
|
if (reactDomFlushSyncImpl && flushSync) {
|
|
9132
9210
|
reactDomFlushSyncImpl(() => {
|
|
9133
9211
|
if (transition) {
|
|
9134
|
-
_optionalChain([renderDfd, 'optionalAccess',
|
|
9212
|
+
_optionalChain([renderDfd, 'optionalAccess', _141 => _141.resolve, 'call', _142 => _142()]);
|
|
9135
9213
|
transition.skipTransition();
|
|
9136
9214
|
}
|
|
9137
9215
|
setVtContext({
|
|
@@ -9156,7 +9234,7 @@ function RouterProvider({
|
|
|
9156
9234
|
return;
|
|
9157
9235
|
}
|
|
9158
9236
|
if (transition) {
|
|
9159
|
-
_optionalChain([renderDfd, 'optionalAccess',
|
|
9237
|
+
_optionalChain([renderDfd, 'optionalAccess', _143 => _143.resolve, 'call', _144 => _144()]);
|
|
9160
9238
|
transition.skipTransition();
|
|
9161
9239
|
setInterruption({
|
|
9162
9240
|
state: newState,
|
|
@@ -9245,12 +9323,12 @@ function RouterProvider({
|
|
|
9245
9323
|
go: (n) => router.navigate(n),
|
|
9246
9324
|
push: (to, state2, opts) => router.navigate(to, {
|
|
9247
9325
|
state: state2,
|
|
9248
|
-
preventScrollReset: _optionalChain([opts, 'optionalAccess',
|
|
9326
|
+
preventScrollReset: _optionalChain([opts, 'optionalAccess', _145 => _145.preventScrollReset])
|
|
9249
9327
|
}),
|
|
9250
9328
|
replace: (to, state2, opts) => router.navigate(to, {
|
|
9251
9329
|
replace: true,
|
|
9252
9330
|
state: state2,
|
|
9253
|
-
preventScrollReset: _optionalChain([opts, 'optionalAccess',
|
|
9331
|
+
preventScrollReset: _optionalChain([opts, 'optionalAccess', _146 => _146.preventScrollReset])
|
|
9254
9332
|
})
|
|
9255
9333
|
};
|
|
9256
9334
|
}, [router]);
|
|
@@ -9482,7 +9560,7 @@ function Await({
|
|
|
9482
9560
|
if (dataRouterContext && dataRouterContext.onError && dataRouterStateContext) {
|
|
9483
9561
|
dataRouterContext.onError(error, {
|
|
9484
9562
|
location: dataRouterStateContext.location,
|
|
9485
|
-
params: _optionalChain([dataRouterStateContext, 'access',
|
|
9563
|
+
params: _optionalChain([dataRouterStateContext, 'access', _147 => _147.matches, 'access', _148 => _148[0], 'optionalAccess', _149 => _149.params]) || {},
|
|
9486
9564
|
unstable_pattern: getRoutePattern(dataRouterStateContext.matches),
|
|
9487
9565
|
errorInfo
|
|
9488
9566
|
});
|
|
@@ -9544,7 +9622,7 @@ var AwaitErrorBoundary = class extends React9.Component {
|
|
|
9544
9622
|
promise = resolve.then(
|
|
9545
9623
|
(data2) => Object.defineProperty(resolve, "_data", { get: () => data2 }),
|
|
9546
9624
|
(error) => {
|
|
9547
|
-
_optionalChain([this, 'access',
|
|
9625
|
+
_optionalChain([this, 'access', _150 => _150.props, 'access', _151 => _151.onError, 'optionalCall', _152 => _152(error)]);
|
|
9548
9626
|
Object.defineProperty(resolve, "_error", { get: () => error });
|
|
9549
9627
|
}
|
|
9550
9628
|
);
|
|
@@ -9808,4 +9886,5 @@ function withErrorBoundaryProps(ErrorBoundary) {
|
|
|
9808
9886
|
|
|
9809
9887
|
|
|
9810
9888
|
|
|
9811
|
-
|
|
9889
|
+
|
|
9890
|
+
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.createContext = createContext; exports.RouterContextProvider = RouterContextProvider; exports.convertRoutesToDataRoutes = convertRoutesToDataRoutes; exports.matchRoutes = matchRoutes; 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.ErrorResponseImpl = ErrorResponseImpl; exports.isRouteErrorResponse = isRouteErrorResponse; exports.parseToInfo = parseToInfo; exports.escapeHtml = escapeHtml; 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.invalidProtocols = invalidProtocols; 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.RemixErrorBoundary = RemixErrorBoundary; exports.createServerRoutes = createServerRoutes; exports.createClientRoutesWithHMRRevalidationOptOut = createClientRoutesWithHMRRevalidationOptOut; exports.noActionDefinedError = noActionDefinedError; exports.createClientRoutes = createClientRoutes; exports.shouldHydrateRouteLoader = shouldHydrateRouteLoader; 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 = DataRoutes; 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;
|