react-router 7.8.0-pre.1 → 7.8.0-pre.3

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/development/{chunk-XFFANEXU.mjs → chunk-3R2RUFHW.mjs} +47 -16
  3. package/dist/development/{chunk-I22FVTOY.mjs → chunk-CQQ53FN5.mjs} +19 -4
  4. package/dist/development/{chunk-NGF2R4G7.js → chunk-EMJKA2DP.js} +82 -51
  5. package/dist/development/{chunk-4EVDZJGM.js → chunk-XMXDJESK.js} +130 -130
  6. package/dist/development/dom-export.js +3 -3
  7. package/dist/development/dom-export.mjs +3 -3
  8. package/dist/{production/index-react-server-client-BzBbJLAD.d.ts → development/index-react-server-client-CMphySRb.d.ts} +18 -1
  9. package/dist/{production/index-react-server-client-CuajY2vy.d.mts → development/index-react-server-client-DXb0OgpJ.d.mts} +18 -1
  10. package/dist/development/index-react-server-client.d.mts +1 -1
  11. package/dist/development/index-react-server-client.d.ts +1 -1
  12. package/dist/development/index-react-server-client.js +4 -4
  13. package/dist/development/index-react-server-client.mjs +2 -2
  14. package/dist/development/index-react-server.js +39 -25
  15. package/dist/development/index-react-server.mjs +39 -25
  16. package/dist/development/index.d.mts +2 -2
  17. package/dist/development/index.d.ts +2 -2
  18. package/dist/development/index.js +117 -102
  19. package/dist/development/index.mjs +3 -3
  20. package/dist/development/lib/types/internal.js +1 -1
  21. package/dist/development/lib/types/internal.mjs +1 -1
  22. package/dist/production/{chunk-P2ZJHOXZ.mjs → chunk-3DKAIR2L.mjs} +47 -16
  23. package/dist/production/{chunk-RLJ23MYZ.js → chunk-3DLLP6EB.js} +82 -51
  24. package/dist/production/{chunk-JJOMWYJ4.mjs → chunk-FAP2Y6DN.mjs} +19 -4
  25. package/dist/production/{chunk-4PESVXQ2.js → chunk-P3LQNPHZ.js} +130 -130
  26. package/dist/production/dom-export.js +3 -3
  27. package/dist/production/dom-export.mjs +3 -3
  28. package/dist/{development/index-react-server-client-BzBbJLAD.d.ts → production/index-react-server-client-CMphySRb.d.ts} +18 -1
  29. package/dist/{development/index-react-server-client-CuajY2vy.d.mts → production/index-react-server-client-DXb0OgpJ.d.mts} +18 -1
  30. package/dist/production/index-react-server-client.d.mts +1 -1
  31. package/dist/production/index-react-server-client.d.ts +1 -1
  32. package/dist/production/index-react-server-client.js +4 -4
  33. package/dist/production/index-react-server-client.mjs +2 -2
  34. package/dist/production/index-react-server.js +39 -25
  35. package/dist/production/index-react-server.mjs +39 -25
  36. package/dist/production/index.d.mts +2 -2
  37. package/dist/production/index.d.ts +2 -2
  38. package/dist/production/index.js +117 -102
  39. package/dist/production/index.mjs +3 -3
  40. package/dist/production/lib/types/internal.js +1 -1
  41. package/dist/production/lib/types/internal.mjs +1 -1
  42. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.8.0-pre.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Bubble client-side middleware errors prior to `next` to the appropriate ancestor error boundary ([#14138](https://github.com/remix-run/react-router/pull/14138))
8
+
9
+ ## 7.8.0-pre.2
10
+
11
+ ### Patch Changes
12
+
13
+ - proxy server action side-effect redirects from actions for document and callServer requests ([#14131](https://github.com/remix-run/react-router/pull/14131))
14
+
3
15
  ## 7.8.0-pre.1
4
16
 
5
17
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.8.0-pre.1
2
+ * react-router v7.8.0-pre.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -3920,12 +3920,36 @@ async function defaultDataStrategyWithMiddleware(args) {
3920
3920
  if (!args.matches.some((m) => m.route.unstable_middleware)) {
3921
3921
  return defaultDataStrategy(args);
3922
3922
  }
3923
+ let didCallHandler = false;
3923
3924
  return runClientMiddlewarePipeline(
3924
3925
  args,
3925
- () => defaultDataStrategy(args),
3926
- (error, routeId) => ({ [routeId]: { type: "error", result: error } })
3926
+ () => {
3927
+ didCallHandler = true;
3928
+ return defaultDataStrategy(args);
3929
+ },
3930
+ (error, routeId) => clientMiddlewareErrorHandler(
3931
+ error,
3932
+ routeId,
3933
+ args.matches,
3934
+ didCallHandler
3935
+ )
3927
3936
  );
3928
3937
  }
3938
+ function clientMiddlewareErrorHandler(error, routeId, matches, didCallHandler) {
3939
+ if (didCallHandler) {
3940
+ return {
3941
+ [routeId]: { type: "error", result: error }
3942
+ };
3943
+ } else {
3944
+ let boundaryRouteId = findNearestBoundary(
3945
+ matches,
3946
+ matches.find((m) => m.route.id === routeId || m.route.loader)?.route.id || routeId
3947
+ ).route.id;
3948
+ return {
3949
+ [boundaryRouteId]: { type: "error", result: error }
3950
+ };
3951
+ }
3952
+ }
3929
3953
  async function runServerMiddlewarePipeline(args, handler, errorHandler) {
3930
3954
  let { matches, request, params, context } = args;
3931
3955
  let tuples = matches.flatMap(
@@ -4200,20 +4224,27 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
4200
4224
  );
4201
4225
  } : (cb) => {
4202
4226
  let typedDataStrategyArgs = dataStrategyArgs;
4227
+ let didCallHandler = false;
4203
4228
  return runClientMiddlewarePipeline(
4204
4229
  typedDataStrategyArgs,
4205
- () => cb({
4206
- ...typedDataStrategyArgs,
4207
- fetcherKey,
4208
- unstable_runClientMiddleware: () => {
4209
- throw new Error(
4210
- "Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler"
4211
- );
4212
- }
4213
- }),
4214
- (error, routeId) => ({
4215
- [routeId]: { type: "error", result: error }
4216
- })
4230
+ () => {
4231
+ didCallHandler = true;
4232
+ return cb({
4233
+ ...typedDataStrategyArgs,
4234
+ fetcherKey,
4235
+ unstable_runClientMiddleware: () => {
4236
+ throw new Error(
4237
+ "Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler"
4238
+ );
4239
+ }
4240
+ });
4241
+ },
4242
+ (error, routeId) => clientMiddlewareErrorHandler(
4243
+ error,
4244
+ routeId,
4245
+ matches,
4246
+ didCallHandler
4247
+ )
4217
4248
  );
4218
4249
  };
4219
4250
  let results = await dataStrategyImpl({
@@ -8941,7 +8972,7 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
8941
8972
  try {
8942
8973
  if (isBrowser) {
8943
8974
  window.__reactRouterVersion = // @ts-expect-error
8944
- "7.8.0-pre.1";
8975
+ "7.8.0-pre.3";
8945
8976
  }
8946
8977
  } catch (e) {
8947
8978
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.8.0-pre.1
2
+ * react-router v7.8.0-pre.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -57,7 +57,7 @@ import {
57
57
  withComponentProps,
58
58
  withErrorBoundaryProps,
59
59
  withHydrateFallbackProps
60
- } from "./chunk-XFFANEXU.mjs";
60
+ } from "./chunk-3R2RUFHW.mjs";
61
61
 
62
62
  // lib/dom/ssr/server.tsx
63
63
  import * as React from "react";
@@ -703,7 +703,7 @@ function getDocumentHeaders(context, build) {
703
703
  return route.module.headers;
704
704
  });
705
705
  }
706
- function getDocumentHeadersImpl(context, getRouteHeadersFn) {
706
+ function getDocumentHeadersImpl(context, getRouteHeadersFn, _defaultHeaders) {
707
707
  let boundaryIdx = context.errors ? context.matches.findIndex((m) => context.errors[m.route.id]) : -1;
708
708
  let matches = boundaryIdx >= 0 ? context.matches.slice(0, boundaryIdx + 1) : context.matches;
709
709
  let errorHeaders;
@@ -719,6 +719,7 @@ function getDocumentHeadersImpl(context, getRouteHeadersFn) {
719
719
  return errorHeaders != null;
720
720
  });
721
721
  }
722
+ const defaultHeaders = new Headers(_defaultHeaders);
722
723
  return matches.reduce((parentHeaders, match, idx) => {
723
724
  let { id } = match.route;
724
725
  let loaderHeaders = context.loaderHeaders[id] || new Headers();
@@ -750,7 +751,7 @@ function getDocumentHeadersImpl(context, getRouteHeadersFn) {
750
751
  prependCookies(loaderHeaders, headers);
751
752
  prependCookies(parentHeaders, headers);
752
753
  return headers;
753
- }, new Headers());
754
+ }, new Headers(defaultHeaders));
754
755
  }
755
756
  function prependCookies(parentHeaders, childHeaders) {
756
757
  let parentSetCookieString = parentHeaders.get("Set-Cookie");
@@ -2512,6 +2513,20 @@ async function routeRSCServerRequest({
2512
2513
  return payloadPromise;
2513
2514
  };
2514
2515
  try {
2516
+ const payload = await getPayload();
2517
+ if (serverResponse.status === SINGLE_FETCH_REDIRECT_STATUS && payload.type === "redirect") {
2518
+ const headers2 = new Headers(serverResponse.headers);
2519
+ headers2.delete("Content-Encoding");
2520
+ headers2.delete("Content-Length");
2521
+ headers2.delete("Content-Type");
2522
+ headers2.delete("x-remix-response");
2523
+ headers2.set("Location", payload.location);
2524
+ return new Response(serverResponseB?.body || "", {
2525
+ headers: headers2,
2526
+ status: payload.status,
2527
+ statusText: serverResponse.statusText
2528
+ });
2529
+ }
2515
2530
  const html = await renderHTML(getPayload);
2516
2531
  const headers = new Headers(serverResponse.headers);
2517
2532
  headers.set("Content-Type", "text/html");
@@ -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.8.0-pre.1
2
+ * react-router v7.8.0-pre.3
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -3920,12 +3920,36 @@ async function defaultDataStrategyWithMiddleware(args) {
3920
3920
  if (!args.matches.some((m) => m.route.unstable_middleware)) {
3921
3921
  return defaultDataStrategy(args);
3922
3922
  }
3923
+ let didCallHandler = false;
3923
3924
  return runClientMiddlewarePipeline(
3924
3925
  args,
3925
- () => defaultDataStrategy(args),
3926
- (error, routeId) => ({ [routeId]: { type: "error", result: error } })
3926
+ () => {
3927
+ didCallHandler = true;
3928
+ return defaultDataStrategy(args);
3929
+ },
3930
+ (error, routeId) => clientMiddlewareErrorHandler(
3931
+ error,
3932
+ routeId,
3933
+ args.matches,
3934
+ didCallHandler
3935
+ )
3927
3936
  );
3928
3937
  }
3938
+ function clientMiddlewareErrorHandler(error, routeId, matches, didCallHandler) {
3939
+ if (didCallHandler) {
3940
+ return {
3941
+ [routeId]: { type: "error", result: error }
3942
+ };
3943
+ } else {
3944
+ let boundaryRouteId = findNearestBoundary(
3945
+ matches,
3946
+ _optionalChain([matches, 'access', _37 => _37.find, 'call', _38 => _38((m) => m.route.id === routeId || m.route.loader), 'optionalAccess', _39 => _39.route, 'access', _40 => _40.id]) || routeId
3947
+ ).route.id;
3948
+ return {
3949
+ [boundaryRouteId]: { type: "error", result: error }
3950
+ };
3951
+ }
3952
+ }
3929
3953
  async function runServerMiddlewarePipeline(args, handler, errorHandler) {
3930
3954
  let { matches, request, params, context } = args;
3931
3955
  let tuples = matches.flatMap(
@@ -4144,8 +4168,8 @@ function getDataStrategyMatch(mapRouteProperties, manifest, request, match, lazy
4144
4168
  return callLoaderOrAction({
4145
4169
  request,
4146
4170
  match,
4147
- lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess', _37 => _37.handler]),
4148
- lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess', _38 => _38.route]),
4171
+ lazyHandlerPromise: _optionalChain([_lazyPromises, 'optionalAccess', _41 => _41.handler]),
4172
+ lazyRoutePromise: _optionalChain([_lazyPromises, 'optionalAccess', _42 => _42.route]),
4149
4173
  handlerOverride,
4150
4174
  scopedContext
4151
4175
  });
@@ -4185,8 +4209,8 @@ function getTargetedDataStrategyMatches(mapRouteProperties, manifest, request, m
4185
4209
  });
4186
4210
  }
4187
4211
  async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherKey, scopedContext, isStaticHandler) {
4188
- if (matches.some((m) => _optionalChain([m, 'access', _39 => _39._lazyPromises, 'optionalAccess', _40 => _40.middleware]))) {
4189
- await Promise.all(matches.map((m) => _optionalChain([m, 'access', _41 => _41._lazyPromises, 'optionalAccess', _42 => _42.middleware])));
4212
+ if (matches.some((m) => _optionalChain([m, 'access', _43 => _43._lazyPromises, 'optionalAccess', _44 => _44.middleware]))) {
4213
+ await Promise.all(matches.map((m) => _optionalChain([m, 'access', _45 => _45._lazyPromises, 'optionalAccess', _46 => _46.middleware])));
4190
4214
  }
4191
4215
  let dataStrategyArgs = {
4192
4216
  request,
@@ -4200,20 +4224,27 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
4200
4224
  );
4201
4225
  } : (cb) => {
4202
4226
  let typedDataStrategyArgs = dataStrategyArgs;
4227
+ let didCallHandler = false;
4203
4228
  return runClientMiddlewarePipeline(
4204
4229
  typedDataStrategyArgs,
4205
- () => cb({
4206
- ...typedDataStrategyArgs,
4207
- fetcherKey,
4208
- unstable_runClientMiddleware: () => {
4209
- throw new Error(
4210
- "Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler"
4211
- );
4212
- }
4213
- }),
4214
- (error, routeId) => ({
4215
- [routeId]: { type: "error", result: error }
4216
- })
4230
+ () => {
4231
+ didCallHandler = true;
4232
+ return cb({
4233
+ ...typedDataStrategyArgs,
4234
+ fetcherKey,
4235
+ unstable_runClientMiddleware: () => {
4236
+ throw new Error(
4237
+ "Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler"
4238
+ );
4239
+ }
4240
+ });
4241
+ },
4242
+ (error, routeId) => clientMiddlewareErrorHandler(
4243
+ error,
4244
+ routeId,
4245
+ matches,
4246
+ didCallHandler
4247
+ )
4217
4248
  );
4218
4249
  };
4219
4250
  let results = await dataStrategyImpl({
@@ -4224,8 +4255,8 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
4224
4255
  try {
4225
4256
  await Promise.all(
4226
4257
  matches.flatMap((m) => [
4227
- _optionalChain([m, 'access', _43 => _43._lazyPromises, 'optionalAccess', _44 => _44.handler]),
4228
- _optionalChain([m, 'access', _45 => _45._lazyPromises, 'optionalAccess', _46 => _46.route])
4258
+ _optionalChain([m, 'access', _47 => _47._lazyPromises, 'optionalAccess', _48 => _48.handler]),
4259
+ _optionalChain([m, 'access', _49 => _49._lazyPromises, 'optionalAccess', _50 => _50.route])
4229
4260
  ])
4230
4261
  );
4231
4262
  } catch (e) {
@@ -4370,19 +4401,19 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
4370
4401
  return {
4371
4402
  type: "error" /* error */,
4372
4403
  error: result.data,
4373
- statusCode: _optionalChain([result, 'access', _47 => _47.init, 'optionalAccess', _48 => _48.status]),
4374
- headers: _optionalChain([result, 'access', _49 => _49.init, 'optionalAccess', _50 => _50.headers]) ? new Headers(result.init.headers) : void 0
4404
+ statusCode: _optionalChain([result, 'access', _51 => _51.init, 'optionalAccess', _52 => _52.status]),
4405
+ headers: _optionalChain([result, 'access', _53 => _53.init, 'optionalAccess', _54 => _54.headers]) ? new Headers(result.init.headers) : void 0
4375
4406
  };
4376
4407
  }
4377
4408
  return {
4378
4409
  type: "error" /* error */,
4379
4410
  error: new ErrorResponseImpl(
4380
- _optionalChain([result, 'access', _51 => _51.init, 'optionalAccess', _52 => _52.status]) || 500,
4411
+ _optionalChain([result, 'access', _55 => _55.init, 'optionalAccess', _56 => _56.status]) || 500,
4381
4412
  void 0,
4382
4413
  result.data
4383
4414
  ),
4384
4415
  statusCode: isRouteErrorResponse(result) ? result.status : void 0,
4385
- headers: _optionalChain([result, 'access', _53 => _53.init, 'optionalAccess', _54 => _54.headers]) ? new Headers(result.init.headers) : void 0
4416
+ headers: _optionalChain([result, 'access', _57 => _57.init, 'optionalAccess', _58 => _58.headers]) ? new Headers(result.init.headers) : void 0
4386
4417
  };
4387
4418
  }
4388
4419
  return {
@@ -4395,8 +4426,8 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
4395
4426
  return {
4396
4427
  type: "data" /* data */,
4397
4428
  data: result.data,
4398
- statusCode: _optionalChain([result, 'access', _55 => _55.init, 'optionalAccess', _56 => _56.status]),
4399
- headers: _optionalChain([result, 'access', _57 => _57.init, 'optionalAccess', _58 => _58.headers]) ? new Headers(result.init.headers) : void 0
4429
+ statusCode: _optionalChain([result, 'access', _59 => _59.init, 'optionalAccess', _60 => _60.status]),
4430
+ headers: _optionalChain([result, 'access', _61 => _61.init, 'optionalAccess', _62 => _62.headers]) ? new Headers(result.init.headers) : void 0
4400
4431
  };
4401
4432
  }
4402
4433
  return { type: "data" /* data */, data: result };
@@ -4545,7 +4576,7 @@ function processLoaderData(state, matches, results, pendingActionResult, revalid
4545
4576
  let result = fetcherResults[key];
4546
4577
  invariant(result, "Did not find corresponding fetcher result");
4547
4578
  if (isErrorResult(result)) {
4548
- let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess', _59 => _59.route, 'access', _60 => _60.id]));
4579
+ let boundaryMatch = findNearestBoundary(state.matches, _optionalChain([match, 'optionalAccess', _63 => _63.route, 'access', _64 => _64.id]));
4549
4580
  if (!(errors && errors[boundaryMatch.route.id])) {
4550
4581
  errors = {
4551
4582
  ...errors,
@@ -4682,8 +4713,8 @@ function dataWithResponseInitToResponse(data2) {
4682
4713
  }
4683
4714
  function dataWithResponseInitToErrorResponse(data2) {
4684
4715
  return new ErrorResponseImpl(
4685
- _nullishCoalesce(_optionalChain([data2, 'access', _61 => _61.init, 'optionalAccess', _62 => _62.status]), () => ( 500)),
4686
- _nullishCoalesce(_optionalChain([data2, 'access', _63 => _63.init, 'optionalAccess', _64 => _64.statusText]), () => ( "Internal Server Error")),
4716
+ _nullishCoalesce(_optionalChain([data2, 'access', _65 => _65.init, 'optionalAccess', _66 => _66.status]), () => ( 500)),
4717
+ _nullishCoalesce(_optionalChain([data2, 'access', _67 => _67.init, 'optionalAccess', _68 => _68.statusText]), () => ( "Internal Server Error")),
4687
4718
  data2.data
4688
4719
  );
4689
4720
  }
@@ -5722,7 +5753,7 @@ function getTurboStreamSingleFetchDataStrategy(getRouter, manifest, routeModules
5722
5753
  return {
5723
5754
  hasLoader: manifestRoute.hasLoader,
5724
5755
  hasClientLoader: manifestRoute.hasClientLoader,
5725
- hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess', _65 => _65.shouldRevalidate]))
5756
+ hasShouldRevalidate: Boolean(_optionalChain([routeModule, 'optionalAccess', _69 => _69.shouldRevalidate]))
5726
5757
  };
5727
5758
  },
5728
5759
  fetchAndDecodeViaTurboStream,
@@ -5889,7 +5920,7 @@ async function bubbleMiddlewareErrors(singleFetchPromise, matches, routesParams,
5889
5920
  let routeResult = fetchedData.routes[match.route.id];
5890
5921
  if ("error" in routeResult) {
5891
5922
  middlewareError = routeResult.error;
5892
- if (_optionalChain([results, 'access', _66 => _66[match.route.id], 'optionalAccess', _67 => _67.result]) == null) {
5923
+ if (_optionalChain([results, 'access', _70 => _70[match.route.id], 'optionalAccess', _71 => _71.result]) == null) {
5893
5924
  results[match.route.id] = {
5894
5925
  type: "error",
5895
5926
  result: middlewareError
@@ -6002,7 +6033,7 @@ async function fetchAndDecodeViaTurboStream(args, basename, targetRoutes) {
6002
6033
  }
6003
6034
  } else {
6004
6035
  let typed = decoded.value;
6005
- let routeId = _optionalChain([targetRoutes, 'optionalAccess', _68 => _68[0]]);
6036
+ let routeId = _optionalChain([targetRoutes, 'optionalAccess', _72 => _72[0]]);
6006
6037
  invariant2(routeId, "No routeId found for single fetch call decoding");
6007
6038
  if ("redirect" in typed) {
6008
6039
  data2 = { redirect: typed };
@@ -6313,7 +6344,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
6313
6344
  if (locationArg) {
6314
6345
  let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
6315
6346
  invariant(
6316
- parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access', _69 => _69.pathname, 'optionalAccess', _70 => _70.startsWith, 'call', _71 => _71(parentPathnameBase)]),
6347
+ parentPathnameBase === "/" || _optionalChain([parsedLocationArg, 'access', _73 => _73.pathname, 'optionalAccess', _74 => _74.startsWith, 'call', _75 => _75(parentPathnameBase)]),
6317
6348
  `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.`
6318
6349
  );
6319
6350
  location = parsedLocationArg;
@@ -6461,10 +6492,10 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
6461
6492
  }
6462
6493
  }
6463
6494
  let renderedMatches = matches;
6464
- let errors = _optionalChain([dataRouterState, 'optionalAccess', _72 => _72.errors]);
6495
+ let errors = _optionalChain([dataRouterState, 'optionalAccess', _76 => _76.errors]);
6465
6496
  if (errors != null) {
6466
6497
  let errorIndex = renderedMatches.findIndex(
6467
- (m) => m.route.id && _optionalChain([errors, 'optionalAccess', _73 => _73[m.route.id]]) !== void 0
6498
+ (m) => m.route.id && _optionalChain([errors, 'optionalAccess', _77 => _77[m.route.id]]) !== void 0
6468
6499
  );
6469
6500
  invariant(
6470
6501
  errorIndex >= 0,
@@ -6641,15 +6672,15 @@ function useRouteError() {
6641
6672
  if (error !== void 0) {
6642
6673
  return error;
6643
6674
  }
6644
- return _optionalChain([state, 'access', _74 => _74.errors, 'optionalAccess', _75 => _75[routeId]]);
6675
+ return _optionalChain([state, 'access', _78 => _78.errors, 'optionalAccess', _79 => _79[routeId]]);
6645
6676
  }
6646
6677
  function useAsyncValue() {
6647
6678
  let value = React3.useContext(AwaitContext);
6648
- return _optionalChain([value, 'optionalAccess', _76 => _76._data]);
6679
+ return _optionalChain([value, 'optionalAccess', _80 => _80._data]);
6649
6680
  }
6650
6681
  function useAsyncError() {
6651
6682
  let value = React3.useContext(AwaitContext);
6652
- return _optionalChain([value, 'optionalAccess', _77 => _77._error]);
6683
+ return _optionalChain([value, 'optionalAccess', _81 => _81._error]);
6653
6684
  }
6654
6685
  var blockerId = 0;
6655
6686
  function useBlocker(shouldBlock) {
@@ -6761,7 +6792,7 @@ function getKeyedLinksForMatches(matches, routeModules, manifest) {
6761
6792
  let route = manifest.routes[match.route.id];
6762
6793
  return [
6763
6794
  route && route.css ? route.css.map((href) => ({ rel: "stylesheet", href })) : [],
6764
- _optionalChain([module, 'optionalAccess', _78 => _78.links, 'optionalCall', _79 => _79()]) || []
6795
+ _optionalChain([module, 'optionalAccess', _82 => _82.links, 'optionalCall', _83 => _83()]) || []
6765
6796
  ];
6766
6797
  }).flat(2);
6767
6798
  let preloads = getModuleLinkHrefs(matches, manifest);
@@ -6862,7 +6893,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
6862
6893
  // param change, /users/123 -> /users/456
6863
6894
  currentMatches[index].pathname !== match.pathname || // splat param changed, which is not present in match.path
6864
6895
  // e.g. /files/images/avatar.jpg -> files/finances.xls
6865
- _optionalChain([currentMatches, 'access', _80 => _80[index], 'access', _81 => _81.route, 'access', _82 => _82.path, 'optionalAccess', _83 => _83.endsWith, 'call', _84 => _84("*")]) && currentMatches[index].params["*"] !== match.params["*"]
6896
+ _optionalChain([currentMatches, 'access', _84 => _84[index], 'access', _85 => _85.route, 'access', _86 => _86.path, 'optionalAccess', _87 => _87.endsWith, 'call', _88 => _88("*")]) && currentMatches[index].params["*"] !== match.params["*"]
6866
6897
  );
6867
6898
  };
6868
6899
  if (mode === "assets") {
@@ -6885,7 +6916,7 @@ function getNewMatchesForLinks(page, nextMatches, currentMatches, manifest, loca
6885
6916
  location.pathname + location.search + location.hash,
6886
6917
  window.origin
6887
6918
  ),
6888
- currentParams: _optionalChain([currentMatches, 'access', _85 => _85[0], 'optionalAccess', _86 => _86.params]) || {},
6919
+ currentParams: _optionalChain([currentMatches, 'access', _89 => _89[0], 'optionalAccess', _90 => _90.params]) || {},
6889
6920
  nextUrl: new URL(page, window.origin),
6890
6921
  nextParams: match.params,
6891
6922
  defaultShouldRevalidate: true
@@ -7157,10 +7188,10 @@ function createClientRoutes(manifest, routeModulesCache, initialState, ssr, isSp
7157
7188
  )
7158
7189
  });
7159
7190
  let hasInitialData = initialState && initialState.loaderData && route.id in initialState.loaderData;
7160
- let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess', _87 => _87.loaderData, 'optionalAccess', _88 => _88[route.id]]) : void 0;
7191
+ let initialData = hasInitialData ? _optionalChain([initialState, 'optionalAccess', _91 => _91.loaderData, 'optionalAccess', _92 => _92[route.id]]) : void 0;
7161
7192
  let hasInitialError = initialState && initialState.errors && route.id in initialState.errors;
7162
- let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess', _89 => _89.errors, 'optionalAccess', _90 => _90[route.id]]) : void 0;
7163
- let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access', _91 => _91.clientLoader, 'optionalAccess', _92 => _92.hydrate]) === true || !route.hasLoader);
7193
+ let initialError = hasInitialError ? _optionalChain([initialState, 'optionalAccess', _93 => _93.errors, 'optionalAccess', _94 => _94[route.id]]) : void 0;
7194
+ let isHydrationRequest = needsRevalidation == null && (_optionalChain([routeModule, 'access', _95 => _95.clientLoader, 'optionalAccess', _96 => _96.hydrate]) === true || !route.hasLoader);
7164
7195
  dataRoute.loader = async ({ request, params, context }, singleFetch) => {
7165
7196
  try {
7166
7197
  let result = await prefetchStylesAndCallHandler(async () => {
@@ -7457,7 +7488,7 @@ function getPatchRoutesOnNavigationFunction(manifest, routeModules, ssr, routeDi
7457
7488
  function useFogOFWarDiscovery(router, manifest, routeModules, ssr, routeDiscovery, isSpaMode) {
7458
7489
  React6.useEffect(() => {
7459
7490
  if (!isFogOfWarEnabled(routeDiscovery, ssr) || // @ts-expect-error - TS doesn't know about this yet
7460
- _optionalChain([window, 'access', _93 => _93.navigator, 'optionalAccess', _94 => _94.connection, 'optionalAccess', _95 => _95.saveData]) === true) {
7491
+ _optionalChain([window, 'access', _97 => _97.navigator, 'optionalAccess', _98 => _98.connection, 'optionalAccess', _99 => _99.saveData]) === true) {
7461
7492
  return;
7462
7493
  }
7463
7494
  function registerElement(el) {
@@ -7560,7 +7591,7 @@ async function fetchAndApplyManifestPatches(paths, errorReloadPath, manifest, ro
7560
7591
  sessionStorage.removeItem(MANIFEST_VERSION_STORAGE_KEY);
7561
7592
  serverPatches = await res.json();
7562
7593
  } catch (e) {
7563
- if (_optionalChain([signal, 'optionalAccess', _96 => _96.aborted])) return;
7594
+ if (_optionalChain([signal, 'optionalAccess', _100 => _100.aborted])) return;
7564
7595
  throw e;
7565
7596
  }
7566
7597
  let knownRoutes = new Set(Object.keys(manifest.routes));
@@ -7801,7 +7832,7 @@ function PrefetchPageLinksImpl({
7801
7832
  if (!manifestRoute || !manifestRoute.hasLoader) {
7802
7833
  return;
7803
7834
  }
7804
- if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access', _97 => _97[m.route.id], 'optionalAccess', _98 => _98.shouldRevalidate])) {
7835
+ if (!newMatchesForData.some((m2) => m2.route.id === m.route.id) && m.route.id in loaderData && _optionalChain([routeModules, 'access', _101 => _101[m.route.id], 'optionalAccess', _102 => _102.shouldRevalidate])) {
7805
7836
  foundOptOutRoute = true;
7806
7837
  } else if (manifestRoute.hasClientLoader) {
7807
7838
  foundOptOutRoute = true;
@@ -7875,7 +7906,7 @@ function Meta() {
7875
7906
  error
7876
7907
  };
7877
7908
  matches[i] = match;
7878
- if (_optionalChain([routeModule, 'optionalAccess', _99 => _99.meta])) {
7909
+ if (_optionalChain([routeModule, 'optionalAccess', _103 => _103.meta])) {
7879
7910
  routeMeta = typeof routeModule.meta === "function" ? routeModule.meta({
7880
7911
  data: data2,
7881
7912
  loaderData: data2,
@@ -7971,7 +8002,7 @@ function Scripts(scriptProps) {
7971
8002
  }
7972
8003
  let streamScript = "window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());";
7973
8004
  let contextScript = staticContext ? `window.__reactRouterContext = ${serverHandoffString};${streamScript}` : " ";
7974
- let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access', _100 => _100.hmr, 'optionalAccess', _101 => _101.runtime]) ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
8005
+ let routeModulesScript = !isStatic ? " " : `${_optionalChain([manifest, 'access', _104 => _104.hmr, 'optionalAccess', _105 => _105.runtime]) ? `import ${JSON.stringify(manifest.hmr.runtime)};` : ""}${!enableFogOfWar ? `import ${JSON.stringify(manifest.url)}` : ""};
7975
8006
  ${matches.map((match, routeIndex) => {
7976
8007
  let routeVarName = `route${routeIndex}`;
7977
8008
  let manifestEntry = manifest.routes[match.route.id];
@@ -8201,7 +8232,7 @@ function BoundaryShell({
8201
8232
  children
8202
8233
  }) {
8203
8234
  let { routeModules } = useFrameworkContext();
8204
- if (_optionalChain([routeModules, 'access', _102 => _102.root, 'optionalAccess', _103 => _103.Layout]) && !isOutsideRemixApp) {
8235
+ if (_optionalChain([routeModules, 'access', _106 => _106.root, 'optionalAccess', _107 => _107.Layout]) && !isOutsideRemixApp) {
8205
8236
  return children;
8206
8237
  }
8207
8238
  return /* @__PURE__ */ React8.createElement("html", { lang: "en" }, /* @__PURE__ */ React8.createElement("head", null, /* @__PURE__ */ React8.createElement("meta", { charSet: "utf-8" }), /* @__PURE__ */ React8.createElement(