react-router 7.7.0 → 7.7.1

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 (68) hide show
  1. package/CHANGELOG.md +11 -23
  2. package/dist/development/{browser-CcxeZJcQ.d.mts → browser-7LYX59NK.d.mts} +97 -1
  3. package/dist/development/{chunk-EF7DTUVF.mjs → chunk-C37GKA54.mjs} +83 -80
  4. package/dist/development/{chunk-V6PEDDZI.js → chunk-K7YFBME3.js} +79 -76
  5. package/dist/{production/chunk-GNZILI6H.mjs → development/chunk-KIUJAIYX.mjs} +3 -5
  6. package/dist/{production/chunk-2TYFPE3B.js → development/chunk-R73PQUJU.js} +132 -132
  7. package/dist/development/components-CjQijYga.d.mts +802 -0
  8. package/dist/development/dom-export.d.mts +13 -6
  9. package/dist/development/dom-export.d.ts +10 -3
  10. package/dist/development/dom-export.js +3 -3
  11. package/dist/development/dom-export.mjs +3 -3
  12. package/dist/development/index-react-server-client-Bi_fx8qz.d.ts +3163 -0
  13. package/dist/development/index-react-server-client-KLg-U4nr.d.mts +2366 -0
  14. package/dist/development/index-react-server-client.d.mts +3 -3
  15. package/dist/development/index-react-server-client.d.ts +2 -2
  16. package/dist/development/index-react-server-client.js +4 -4
  17. package/dist/development/index-react-server-client.mjs +2 -2
  18. package/dist/development/index-react-server.d.mts +109 -2
  19. package/dist/development/index-react-server.d.ts +109 -2
  20. package/dist/development/index-react-server.js +28 -20
  21. package/dist/development/index-react-server.mjs +29 -21
  22. package/dist/development/index.d.mts +918 -287
  23. package/dist/development/index.d.ts +1010 -283
  24. package/dist/development/index.js +98 -100
  25. package/dist/development/index.mjs +3 -3
  26. package/dist/development/lib/types/internal.d.mts +1 -1
  27. package/dist/development/lib/types/internal.d.ts +1 -1
  28. package/dist/development/lib/types/internal.js +1 -1
  29. package/dist/development/lib/types/internal.mjs +1 -1
  30. package/dist/{production/route-data-DjzmHYNR.d.mts → development/route-data-CqEmXQub.d.mts} +48 -2
  31. package/dist/{production/routeModules-g5PTiDfO.d.ts → development/routeModules-BR2FO0ix.d.ts} +48 -2
  32. package/dist/production/{browser-CcxeZJcQ.d.mts → browser-7LYX59NK.d.mts} +97 -1
  33. package/dist/{development/chunk-4ADB4KIO.js → production/chunk-4DGLNKXF.js} +132 -132
  34. package/dist/production/{chunk-5KHO4FML.js → chunk-7OQROU2D.js} +79 -76
  35. package/dist/production/{chunk-WPPIQDYG.mjs → chunk-IZ57JD2V.mjs} +83 -80
  36. package/dist/{development/chunk-T3VM44WY.mjs → production/chunk-K3SBCRK4.mjs} +3 -5
  37. package/dist/production/components-CjQijYga.d.mts +802 -0
  38. package/dist/production/dom-export.d.mts +13 -6
  39. package/dist/production/dom-export.d.ts +10 -3
  40. package/dist/production/dom-export.js +3 -3
  41. package/dist/production/dom-export.mjs +3 -3
  42. package/dist/production/index-react-server-client-Bi_fx8qz.d.ts +3163 -0
  43. package/dist/production/index-react-server-client-KLg-U4nr.d.mts +2366 -0
  44. package/dist/production/index-react-server-client.d.mts +3 -3
  45. package/dist/production/index-react-server-client.d.ts +2 -2
  46. package/dist/production/index-react-server-client.js +4 -4
  47. package/dist/production/index-react-server-client.mjs +2 -2
  48. package/dist/production/index-react-server.d.mts +109 -2
  49. package/dist/production/index-react-server.d.ts +109 -2
  50. package/dist/production/index-react-server.js +28 -20
  51. package/dist/production/index-react-server.mjs +29 -21
  52. package/dist/production/index.d.mts +918 -287
  53. package/dist/production/index.d.ts +1010 -283
  54. package/dist/production/index.js +98 -100
  55. package/dist/production/index.mjs +3 -3
  56. package/dist/production/lib/types/internal.d.mts +1 -1
  57. package/dist/production/lib/types/internal.d.ts +1 -1
  58. package/dist/production/lib/types/internal.js +1 -1
  59. package/dist/production/lib/types/internal.mjs +1 -1
  60. package/dist/{development/route-data-DjzmHYNR.d.mts → production/route-data-CqEmXQub.d.mts} +48 -2
  61. package/dist/{development/routeModules-g5PTiDfO.d.ts → production/routeModules-BR2FO0ix.d.ts} +48 -2
  62. package/package.json +1 -1
  63. package/dist/development/components-DzqPLVI1.d.mts +0 -464
  64. package/dist/development/index-react-server-client-CUidsuu_.d.mts +0 -1360
  65. package/dist/development/index-react-server-client-kY8DvDF3.d.ts +0 -1819
  66. package/dist/production/components-DzqPLVI1.d.mts +0 -464
  67. package/dist/production/index-react-server-client-CUidsuu_.d.mts +0 -1360
  68. package/dist/production/index-react-server-client-kY8DvDF3.d.ts +0 -1819
@@ -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.7.0
2
+ * react-router v7.7.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -2305,9 +2305,7 @@ function createRouter(init) {
2305
2305
  )
2306
2306
  };
2307
2307
  } else {
2308
- dataResults[routeId] = await convertDataStrategyResultToDataResult(
2309
- result
2310
- );
2308
+ dataResults[routeId] = await convertDataStrategyResultToDataResult(result);
2311
2309
  }
2312
2310
  }
2313
2311
  return dataResults;
@@ -4163,7 +4161,10 @@ async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherK
4163
4161
  });
4164
4162
  try {
4165
4163
  await Promise.all(
4166
- matches.flatMap((m) => [_optionalChain([m, 'access', _43 => _43._lazyPromises, 'optionalAccess', _44 => _44.handler]), _optionalChain([m, 'access', _45 => _45._lazyPromises, 'optionalAccess', _46 => _46.route])])
4164
+ matches.flatMap((m) => [
4165
+ _optionalChain([m, 'access', _43 => _43._lazyPromises, 'optionalAccess', _44 => _44.handler]),
4166
+ _optionalChain([m, 'access', _45 => _45._lazyPromises, 'optionalAccess', _46 => _46.route])
4167
+ ])
4167
4168
  );
4168
4169
  } catch (e) {
4169
4170
  }
@@ -5478,8 +5479,10 @@ function encode(input, options) {
5478
5479
  lastSentIndex++;
5479
5480
  } else if (id2 < 0) {
5480
5481
  controller.enqueue(
5481
- textEncoder.encode(`${TYPE_ERROR}${deferredId}:${id2}
5482
- `)
5482
+ textEncoder.encode(
5483
+ `${TYPE_ERROR}${deferredId}:${id2}
5484
+ `
5485
+ )
5483
5486
  );
5484
5487
  } else {
5485
5488
  const values = encoder.stringified.slice(lastSentIndex + 1).join(",");
@@ -6406,68 +6409,71 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, fut
6406
6409
  }
6407
6410
  }
6408
6411
  }
6409
- return renderedMatches.reduceRight((outlet, match, index) => {
6410
- let error;
6411
- let shouldRenderHydrateFallback = false;
6412
- let errorElement = null;
6413
- let hydrateFallbackElement = null;
6414
- if (dataRouterState) {
6415
- error = errors && match.route.id ? errors[match.route.id] : void 0;
6416
- errorElement = match.route.errorElement || defaultErrorElement;
6417
- if (renderFallback) {
6418
- if (fallbackIndex < 0 && index === 0) {
6419
- warningOnce(
6420
- "route-fallback",
6421
- false,
6422
- "No `HydrateFallback` element provided to render during initial hydration"
6423
- );
6424
- shouldRenderHydrateFallback = true;
6425
- hydrateFallbackElement = null;
6426
- } else if (fallbackIndex === index) {
6427
- shouldRenderHydrateFallback = true;
6428
- hydrateFallbackElement = match.route.hydrateFallbackElement || null;
6412
+ return renderedMatches.reduceRight(
6413
+ (outlet, match, index) => {
6414
+ let error;
6415
+ let shouldRenderHydrateFallback = false;
6416
+ let errorElement = null;
6417
+ let hydrateFallbackElement = null;
6418
+ if (dataRouterState) {
6419
+ error = errors && match.route.id ? errors[match.route.id] : void 0;
6420
+ errorElement = match.route.errorElement || defaultErrorElement;
6421
+ if (renderFallback) {
6422
+ if (fallbackIndex < 0 && index === 0) {
6423
+ warningOnce(
6424
+ "route-fallback",
6425
+ false,
6426
+ "No `HydrateFallback` element provided to render during initial hydration"
6427
+ );
6428
+ shouldRenderHydrateFallback = true;
6429
+ hydrateFallbackElement = null;
6430
+ } else if (fallbackIndex === index) {
6431
+ shouldRenderHydrateFallback = true;
6432
+ hydrateFallbackElement = match.route.hydrateFallbackElement || null;
6433
+ }
6429
6434
  }
6430
6435
  }
6431
- }
6432
- let matches2 = parentMatches.concat(renderedMatches.slice(0, index + 1));
6433
- let getChildren = () => {
6434
- let children;
6435
- if (error) {
6436
- children = errorElement;
6437
- } else if (shouldRenderHydrateFallback) {
6438
- children = hydrateFallbackElement;
6439
- } else if (match.route.Component) {
6440
- children = /* @__PURE__ */ React3.createElement(match.route.Component, null);
6441
- } else if (match.route.element) {
6442
- children = match.route.element;
6443
- } else {
6444
- children = outlet;
6445
- }
6446
- return /* @__PURE__ */ React3.createElement(
6447
- RenderedRoute,
6436
+ let matches2 = parentMatches.concat(renderedMatches.slice(0, index + 1));
6437
+ let getChildren = () => {
6438
+ let children;
6439
+ if (error) {
6440
+ children = errorElement;
6441
+ } else if (shouldRenderHydrateFallback) {
6442
+ children = hydrateFallbackElement;
6443
+ } else if (match.route.Component) {
6444
+ children = /* @__PURE__ */ React3.createElement(match.route.Component, null);
6445
+ } else if (match.route.element) {
6446
+ children = match.route.element;
6447
+ } else {
6448
+ children = outlet;
6449
+ }
6450
+ return /* @__PURE__ */ React3.createElement(
6451
+ RenderedRoute,
6452
+ {
6453
+ match,
6454
+ routeContext: {
6455
+ outlet,
6456
+ matches: matches2,
6457
+ isDataRoute: dataRouterState != null
6458
+ },
6459
+ children
6460
+ }
6461
+ );
6462
+ };
6463
+ return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /* @__PURE__ */ React3.createElement(
6464
+ RenderErrorBoundary,
6448
6465
  {
6449
- match,
6450
- routeContext: {
6451
- outlet,
6452
- matches: matches2,
6453
- isDataRoute: dataRouterState != null
6454
- },
6455
- children
6466
+ location: dataRouterState.location,
6467
+ revalidation: dataRouterState.revalidation,
6468
+ component: errorElement,
6469
+ error,
6470
+ children: getChildren(),
6471
+ routeContext: { outlet: null, matches: matches2, isDataRoute: true }
6456
6472
  }
6457
- );
6458
- };
6459
- return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /* @__PURE__ */ React3.createElement(
6460
- RenderErrorBoundary,
6461
- {
6462
- location: dataRouterState.location,
6463
- revalidation: dataRouterState.revalidation,
6464
- component: errorElement,
6465
- error,
6466
- children: getChildren(),
6467
- routeContext: { outlet: null, matches: matches2, isDataRoute: true }
6468
- }
6469
- ) : getChildren();
6470
- }, null);
6473
+ ) : getChildren();
6474
+ },
6475
+ null
6476
+ );
6471
6477
  }
6472
6478
  function getDataRouterConsoleError(hookName) {
6473
6479
  return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
@@ -7630,10 +7636,7 @@ function Links() {
7630
7636
  ({ key, link }) => isPageLinkDescriptor(link) ? /* @__PURE__ */ React7.createElement(PrefetchPageLinks, { key, ...link }) : /* @__PURE__ */ React7.createElement("link", { key, ...link })
7631
7637
  ));
7632
7638
  }
7633
- function PrefetchPageLinks({
7634
- page,
7635
- ...dataLinkProps
7636
- }) {
7639
+ function PrefetchPageLinks({ page, ...linkProps }) {
7637
7640
  let { router } = useDataRouterContext2();
7638
7641
  let matches = React7.useMemo(
7639
7642
  () => matchRoutes(router.routes, page, router.basename),
@@ -7642,7 +7645,7 @@ function PrefetchPageLinks({
7642
7645
  if (!matches) {
7643
7646
  return null;
7644
7647
  }
7645
- return /* @__PURE__ */ React7.createElement(PrefetchPageLinksImpl, { page, matches, ...dataLinkProps });
7648
+ return /* @__PURE__ */ React7.createElement(PrefetchPageLinksImpl, { page, matches, ...linkProps });
7646
7649
  }
7647
7650
  function useKeyedPrefetchLinks(matches) {
7648
7651
  let { manifest, routeModules } = useFrameworkContext();
@@ -7846,7 +7849,7 @@ function isValidMetaTag(tagName) {
7846
7849
  return typeof tagName === "string" && /^(meta|link)$/.test(tagName);
7847
7850
  }
7848
7851
  var isHydrated = false;
7849
- function Scripts(props) {
7852
+ function Scripts(scriptProps) {
7850
7853
  let {
7851
7854
  manifest,
7852
7855
  serverHandoffString,
@@ -7932,7 +7935,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
7932
7935
  return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(
7933
7936
  "script",
7934
7937
  {
7935
- ...props,
7938
+ ...scriptProps,
7936
7939
  suppressHydrationWarning: true,
7937
7940
  dangerouslySetInnerHTML: createHtml(contextScript),
7938
7941
  type: void 0
@@ -7940,7 +7943,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
7940
7943
  ), /* @__PURE__ */ React7.createElement(
7941
7944
  "script",
7942
7945
  {
7943
- ...props,
7946
+ ...scriptProps,
7944
7947
  suppressHydrationWarning: true,
7945
7948
  dangerouslySetInnerHTML: createHtml(routeModulesScript),
7946
7949
  type: "module",
@@ -7977,7 +7980,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
7977
7980
  {
7978
7981
  rel: "modulepreload",
7979
7982
  href: manifest.url,
7980
- crossOrigin: props.crossOrigin,
7983
+ crossOrigin: scriptProps.crossOrigin,
7981
7984
  integrity: sri[manifest.url],
7982
7985
  suppressHydrationWarning: true
7983
7986
  }
@@ -7986,7 +7989,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
7986
7989
  {
7987
7990
  rel: "modulepreload",
7988
7991
  href: manifest.entry.module,
7989
- crossOrigin: props.crossOrigin,
7992
+ crossOrigin: scriptProps.crossOrigin,
7990
7993
  integrity: sri[manifest.entry.module],
7991
7994
  suppressHydrationWarning: true
7992
7995
  }
@@ -7996,7 +7999,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
7996
7999
  key: path,
7997
8000
  rel: "modulepreload",
7998
8001
  href: path,
7999
- crossOrigin: props.crossOrigin,
8002
+ crossOrigin: scriptProps.crossOrigin,
8000
8003
  integrity: sri[path],
8001
8004
  suppressHydrationWarning: true
8002
8005
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.7.0
2
+ * react-router v7.7.1
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-WPPIQDYG.mjs";
60
+ } from "./chunk-C37GKA54.mjs";
61
61
 
62
62
  // lib/dom/ssr/server.tsx
63
63
  import * as React from "react";
@@ -2493,9 +2493,7 @@ async function routeRSCServerRequest({
2493
2493
  throw reason;
2494
2494
  }
2495
2495
  }
2496
- function RSCStaticRouter({
2497
- getPayload
2498
- }) {
2496
+ function RSCStaticRouter({ getPayload }) {
2499
2497
  const payload = React5.use(getPayload());
2500
2498
  if (payload.type === "redirect") {
2501
2499
  throw new Response(null, {