react-router 7.9.6-pre.1 → 7.10.0-pre.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +69 -4
  2. package/dist/development/{browser-C07r42Tt.d.mts → browser-BHySFrZ2.d.mts} +1 -1
  3. package/dist/development/{browser-BbBXFHbO.d.ts → browser-eL-tAN4R.d.ts} +1 -1
  4. package/dist/development/{chunk-HSVNPM3C.js → chunk-2VILFZWG.js} +167 -123
  5. package/dist/development/{chunk-DKSAHU2I.mjs → chunk-4BTFPFZR.mjs} +208 -221
  6. package/dist/development/{chunk-RGKEVI2W.mjs → chunk-CECIHG5K.mjs} +15 -5
  7. package/dist/development/{chunk-CYHICRRW.js → chunk-M4WLV5HP.js} +201 -258
  8. package/dist/development/{chunk-OLIKX45O.js → chunk-Z4R76DXJ.js} +7 -7
  9. package/dist/development/dom-export.d.mts +21 -2
  10. package/dist/development/dom-export.d.ts +21 -2
  11. package/dist/development/dom-export.js +158 -103
  12. package/dist/development/dom-export.mjs +133 -79
  13. package/dist/development/{index-react-server-client-Da3kmxNd.d.ts → index-react-server-client-CNrKUHDv.d.ts} +59 -7
  14. package/dist/{production/index-react-server-client-rcoGPJhU.d.mts → development/index-react-server-client-DYtvZPLT.d.mts} +59 -7
  15. package/dist/development/index-react-server-client.d.mts +2 -2
  16. package/dist/development/index-react-server-client.d.ts +2 -2
  17. package/dist/development/index-react-server-client.js +4 -4
  18. package/dist/development/index-react-server-client.mjs +2 -2
  19. package/dist/development/index-react-server.d.mts +19 -4
  20. package/dist/development/index-react-server.d.ts +19 -4
  21. package/dist/development/index-react-server.js +30 -24
  22. package/dist/development/index-react-server.mjs +30 -24
  23. package/dist/development/index.d.mts +19 -15
  24. package/dist/development/index.d.ts +19 -15
  25. package/dist/development/index.js +92 -82
  26. package/dist/development/index.mjs +3 -3
  27. package/dist/{production/instrumentation-Unc20tLk.d.ts → development/instrumentation-Dwf-sTWa.d.ts} +66 -8
  28. package/dist/development/lib/types/internal.d.mts +2 -2
  29. package/dist/development/lib/types/internal.d.ts +2 -2
  30. package/dist/development/lib/types/internal.js +1 -1
  31. package/dist/development/lib/types/internal.mjs +1 -1
  32. package/dist/development/{register-BpU9rFBJ.d.ts → register-BnQsYkwj.d.ts} +1 -1
  33. package/dist/development/{register-QkB3HGjm.d.mts → register-C97Jz2jB.d.mts} +1 -1
  34. package/dist/development/{router-CAvh_Drx.d.mts → router-Dgz_Mh9m.d.mts} +66 -8
  35. package/dist/production/{browser-C07r42Tt.d.mts → browser-BHySFrZ2.d.mts} +1 -1
  36. package/dist/production/{browser-BbBXFHbO.d.ts → browser-eL-tAN4R.d.ts} +1 -1
  37. package/dist/production/{chunk-2DNJUQK6.js → chunk-55FFLVQP.js} +201 -258
  38. package/dist/production/{chunk-EDK3MRM6.js → chunk-5DTJHKF7.js} +167 -123
  39. package/dist/production/{chunk-LESYMMDQ.mjs → chunk-KJ5676BZ.mjs} +208 -221
  40. package/dist/production/{chunk-LC2OWLJG.mjs → chunk-QKAGOFED.mjs} +15 -5
  41. package/dist/production/{chunk-JLDESRHY.js → chunk-SGCRBGEM.js} +7 -7
  42. package/dist/production/dom-export.d.mts +21 -2
  43. package/dist/production/dom-export.d.ts +21 -2
  44. package/dist/production/dom-export.js +158 -103
  45. package/dist/production/dom-export.mjs +133 -79
  46. package/dist/production/{index-react-server-client-Da3kmxNd.d.ts → index-react-server-client-CNrKUHDv.d.ts} +59 -7
  47. package/dist/{development/index-react-server-client-rcoGPJhU.d.mts → production/index-react-server-client-DYtvZPLT.d.mts} +59 -7
  48. package/dist/production/index-react-server-client.d.mts +2 -2
  49. package/dist/production/index-react-server-client.d.ts +2 -2
  50. package/dist/production/index-react-server-client.js +4 -4
  51. package/dist/production/index-react-server-client.mjs +2 -2
  52. package/dist/production/index-react-server.d.mts +19 -4
  53. package/dist/production/index-react-server.d.ts +19 -4
  54. package/dist/production/index-react-server.js +30 -24
  55. package/dist/production/index-react-server.mjs +30 -24
  56. package/dist/production/index.d.mts +19 -15
  57. package/dist/production/index.d.ts +19 -15
  58. package/dist/production/index.js +92 -82
  59. package/dist/production/index.mjs +3 -3
  60. package/dist/{development/instrumentation-Unc20tLk.d.ts → production/instrumentation-Dwf-sTWa.d.ts} +66 -8
  61. package/dist/production/lib/types/internal.d.mts +2 -2
  62. package/dist/production/lib/types/internal.d.ts +2 -2
  63. package/dist/production/lib/types/internal.js +1 -1
  64. package/dist/production/lib/types/internal.mjs +1 -1
  65. package/dist/production/{register-BpU9rFBJ.d.ts → register-BnQsYkwj.d.ts} +1 -1
  66. package/dist/production/{register-QkB3HGjm.d.mts → register-C97Jz2jB.d.mts} +1 -1
  67. package/dist/production/{router-CAvh_Drx.d.mts → router-Dgz_Mh9m.d.mts} +66 -8
  68. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.9.6-pre.1
2
+ * react-router v7.10.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -49,7 +49,7 @@ import {
49
49
  withComponentProps,
50
50
  withErrorBoundaryProps,
51
51
  withHydrateFallbackProps
52
- } from "./chunk-DKSAHU2I.mjs";
52
+ } from "./chunk-4BTFPFZR.mjs";
53
53
 
54
54
  // lib/dom/ssr/server.tsx
55
55
  import * as React from "react";
@@ -1655,12 +1655,12 @@ function createMemorySessionStorage({ cookie } = {}) {
1655
1655
  // lib/href.ts
1656
1656
  function href(path, ...args) {
1657
1657
  let params = args[0];
1658
- let result = path.replace(/\/*\*?$/, "").replace(
1658
+ let result = trimTrailingSplat(path).replace(
1659
1659
  /\/:([\w-]+)(\?)?/g,
1660
1660
  // same regex as in .\router\utils.ts: compilePath().
1661
1661
  (_, param, questionMark) => {
1662
1662
  const isRequired = questionMark === void 0;
1663
- const value = params ? params[param] : void 0;
1663
+ const value = params?.[param];
1664
1664
  if (isRequired && value === void 0) {
1665
1665
  throw new Error(
1666
1666
  `Path '${path}' requires param '${param}' but it was not provided`
@@ -1670,13 +1670,23 @@ function href(path, ...args) {
1670
1670
  }
1671
1671
  );
1672
1672
  if (path.endsWith("*")) {
1673
- const value = params ? params["*"] : void 0;
1673
+ const value = params?.["*"];
1674
1674
  if (value !== void 0) {
1675
1675
  result += "/" + value;
1676
1676
  }
1677
1677
  }
1678
1678
  return result || "/";
1679
1679
  }
1680
+ function trimTrailingSplat(path) {
1681
+ let i = path.length - 1;
1682
+ let char = path[i];
1683
+ if (char !== "*" && char !== "/") return path;
1684
+ i--;
1685
+ for (; i >= 0; i--) {
1686
+ if (path[i] !== "/") break;
1687
+ }
1688
+ return path.slice(0, i + 1);
1689
+ }
1680
1690
 
1681
1691
  // lib/rsc/server.ssr.tsx
1682
1692
  import * as React4 from "react";