react-router 7.16.0 → 7.18.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 (157) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/dist/development/{browser-D3uq9sI1.d.ts → browser-B2PdsXXH.d.ts} +2 -2
  3. package/dist/development/{browser-nIQ4Nsyi.d.mts → browser-DBmQ1yAR.d.mts} +2 -2
  4. package/dist/development/{chunk-QUQL4437.mjs → chunk-4ZMWKKQ3.mjs} +115 -38
  5. package/dist/development/{chunk-S54KXAEJ.mjs → chunk-E4MTK73K.mjs} +45 -113
  6. package/dist/development/{chunk-SRID2YZ2.js → chunk-U7ORXROY.js} +113 -35
  7. package/dist/development/{chunk-XEJDWL2B.js → chunk-WW7PN6QI.js} +7 -7
  8. package/dist/{production/chunk-SKEDDLRM.js → development/chunk-YL5M26XI.js} +111 -108
  9. package/dist/development/{context-m8rizgnE.d.mts → context-CeD5LmaF.d.mts} +13 -5
  10. package/dist/{production/data-D4xhSy90.d.ts → development/data-CjO11-hU.d.ts} +9 -1
  11. package/dist/{production/data-U8FS-wNn.d.mts → development/data-DEjBmEfD.d.mts} +9 -1
  12. package/dist/development/dom-export.d.mts +4 -4
  13. package/dist/development/dom-export.d.ts +4 -4
  14. package/dist/development/dom-export.js +46 -44
  15. package/dist/development/dom-export.mjs +23 -21
  16. package/dist/{production/index-react-server-client-BLiUx67a.d.ts → development/index-react-server-client-3ykjivgQ.d.ts} +30 -8
  17. package/dist/development/{index-react-server-client-CdKROblb.d.mts → index-react-server-client-CACgcj2J.d.mts} +19 -5
  18. package/dist/development/index-react-server-client.d.mts +3 -3
  19. package/dist/development/index-react-server-client.d.ts +3 -3
  20. package/dist/development/index-react-server-client.js +4 -4
  21. package/dist/development/index-react-server-client.mjs +2 -2
  22. package/dist/development/index-react-server.d.mts +9 -1
  23. package/dist/development/index-react-server.d.ts +9 -1
  24. package/dist/development/index-react-server.js +144 -121
  25. package/dist/development/index-react-server.mjs +143 -120
  26. package/dist/development/index.d.mts +15 -14
  27. package/dist/development/index.d.ts +15 -14
  28. package/dist/development/index.js +137 -205
  29. package/dist/development/index.mjs +3 -5
  30. package/dist/{production/instrumentation-1q4YhLGP.d.ts → development/instrumentation-Dkmpzd13.d.ts} +2 -2
  31. package/dist/development/lib/types/internal.d.mts +2 -2
  32. package/dist/development/lib/types/internal.d.ts +2 -2
  33. package/dist/development/lib/types/internal.js +1 -1
  34. package/dist/development/lib/types/internal.mjs +1 -1
  35. package/dist/development/{register-CqK96Zfk.d.mts → register-CmkRspdl.d.mts} +1 -1
  36. package/dist/development/{register-CNAx3TXj.d.ts → register-roq_0qYo.d.ts} +1 -1
  37. package/dist/production/{browser-D3uq9sI1.d.ts → browser-B2PdsXXH.d.ts} +2 -2
  38. package/dist/production/{browser-nIQ4Nsyi.d.mts → browser-DBmQ1yAR.d.mts} +2 -2
  39. package/dist/production/{chunk-EAQNHM3N.js → chunk-3Z6WS2WZ.js} +7 -7
  40. package/dist/{development/chunk-IBI7OMNB.js → production/chunk-BIP66BKV.js} +111 -108
  41. package/dist/production/{chunk-NALGHHKE.mjs → chunk-EGOTSXNH.mjs} +45 -113
  42. package/dist/production/{chunk-Y7DNFQZP.js → chunk-IUPBOWYO.js} +113 -35
  43. package/dist/production/{chunk-Q65P7S7Y.mjs → chunk-M7NGGUU6.mjs} +115 -38
  44. package/dist/production/{context-m8rizgnE.d.mts → context-CeD5LmaF.d.mts} +13 -5
  45. package/dist/{development/data-D4xhSy90.d.ts → production/data-CjO11-hU.d.ts} +9 -1
  46. package/dist/{development/data-U8FS-wNn.d.mts → production/data-DEjBmEfD.d.mts} +9 -1
  47. package/dist/production/dom-export.d.mts +4 -4
  48. package/dist/production/dom-export.d.ts +4 -4
  49. package/dist/production/dom-export.js +46 -44
  50. package/dist/production/dom-export.mjs +23 -21
  51. package/dist/{development/index-react-server-client-BLiUx67a.d.ts → production/index-react-server-client-3ykjivgQ.d.ts} +30 -8
  52. package/dist/production/{index-react-server-client-CdKROblb.d.mts → index-react-server-client-CACgcj2J.d.mts} +19 -5
  53. package/dist/production/index-react-server-client.d.mts +3 -3
  54. package/dist/production/index-react-server-client.d.ts +3 -3
  55. package/dist/production/index-react-server-client.js +4 -4
  56. package/dist/production/index-react-server-client.mjs +2 -2
  57. package/dist/production/index-react-server.d.mts +9 -1
  58. package/dist/production/index-react-server.d.ts +9 -1
  59. package/dist/production/index-react-server.js +144 -121
  60. package/dist/production/index-react-server.mjs +143 -120
  61. package/dist/production/index.d.mts +15 -14
  62. package/dist/production/index.d.ts +15 -14
  63. package/dist/production/index.js +137 -205
  64. package/dist/production/index.mjs +3 -5
  65. package/dist/{development/instrumentation-1q4YhLGP.d.ts → production/instrumentation-Dkmpzd13.d.ts} +2 -2
  66. package/dist/production/lib/types/internal.d.mts +2 -2
  67. package/dist/production/lib/types/internal.d.ts +2 -2
  68. package/dist/production/lib/types/internal.js +1 -1
  69. package/dist/production/lib/types/internal.mjs +1 -1
  70. package/dist/production/{register-CqK96Zfk.d.mts → register-CmkRspdl.d.mts} +1 -1
  71. package/dist/production/{register-CNAx3TXj.d.ts → register-roq_0qYo.d.ts} +1 -1
  72. package/docs/explanation/backend-for-frontend.md +50 -0
  73. package/docs/explanation/code-splitting.md +61 -0
  74. package/docs/explanation/concurrency.md +135 -0
  75. package/docs/explanation/form-vs-fetcher.md +292 -0
  76. package/docs/explanation/hot-module-replacement.md +137 -0
  77. package/docs/explanation/hydration.md +14 -0
  78. package/docs/explanation/index-query-param.md +86 -0
  79. package/docs/explanation/index.md +4 -0
  80. package/docs/explanation/lazy-route-discovery.md +78 -0
  81. package/docs/explanation/location.md +6 -0
  82. package/docs/explanation/progressive-enhancement.md +150 -0
  83. package/docs/explanation/race-conditions.md +88 -0
  84. package/docs/explanation/react-transitions.md +160 -0
  85. package/docs/explanation/route-matching.md +7 -0
  86. package/docs/explanation/server-client-execution.md +4 -0
  87. package/docs/explanation/sessions-and-cookies.md +465 -0
  88. package/docs/explanation/special-files.md +16 -0
  89. package/docs/explanation/state-management.md +524 -0
  90. package/docs/explanation/styling.md +87 -0
  91. package/docs/explanation/type-safety.md +82 -0
  92. package/docs/how-to/accessibility.md +44 -0
  93. package/docs/how-to/client-data.md +199 -0
  94. package/docs/how-to/data-strategy.md +317 -0
  95. package/docs/how-to/error-boundary.md +231 -0
  96. package/docs/how-to/error-reporting.md +142 -0
  97. package/docs/how-to/fetchers.md +307 -0
  98. package/docs/how-to/file-route-conventions.md +410 -0
  99. package/docs/how-to/file-uploads.md +217 -0
  100. package/docs/how-to/form-validation.md +120 -0
  101. package/docs/how-to/headers.md +165 -0
  102. package/docs/how-to/index.md +4 -0
  103. package/docs/how-to/instrumentation.md +556 -0
  104. package/docs/how-to/meta.md +40 -0
  105. package/docs/how-to/middleware.md +763 -0
  106. package/docs/how-to/navigation-blocking.md +233 -0
  107. package/docs/how-to/optimize-revalidation.md +12 -0
  108. package/docs/how-to/pre-rendering.md +225 -0
  109. package/docs/how-to/presets.md +103 -0
  110. package/docs/how-to/react-server-components.md +899 -0
  111. package/docs/how-to/resource-routes.md +126 -0
  112. package/docs/how-to/route-module-type-safety.md +100 -0
  113. package/docs/how-to/search-params.md +4 -0
  114. package/docs/how-to/security.md +32 -0
  115. package/docs/how-to/server-bundles.md +66 -0
  116. package/docs/how-to/spa.md +120 -0
  117. package/docs/how-to/status.md +63 -0
  118. package/docs/how-to/suspense.md +132 -0
  119. package/docs/how-to/using-handle.md +117 -0
  120. package/docs/how-to/view-transitions.md +237 -0
  121. package/docs/how-to/webhook.md +50 -0
  122. package/docs/index.md +39 -0
  123. package/docs/start/data/actions.md +138 -0
  124. package/docs/start/data/custom.md +198 -0
  125. package/docs/start/data/data-loading.md +44 -0
  126. package/docs/start/data/index.md +4 -0
  127. package/docs/start/data/installation.md +56 -0
  128. package/docs/start/data/navigating.md +12 -0
  129. package/docs/start/data/pending-ui.md +12 -0
  130. package/docs/start/data/route-object.md +268 -0
  131. package/docs/start/data/routing.md +281 -0
  132. package/docs/start/data/testing.md +8 -0
  133. package/docs/start/declarative/index.md +4 -0
  134. package/docs/start/declarative/installation.md +43 -0
  135. package/docs/start/declarative/navigating.md +133 -0
  136. package/docs/start/declarative/routing.md +237 -0
  137. package/docs/start/declarative/url-values.md +65 -0
  138. package/docs/start/framework/actions.md +174 -0
  139. package/docs/start/framework/data-loading.md +201 -0
  140. package/docs/start/framework/deploying.md +100 -0
  141. package/docs/start/framework/index.md +4 -0
  142. package/docs/start/framework/installation.md +41 -0
  143. package/docs/start/framework/navigating.md +182 -0
  144. package/docs/start/framework/pending-ui.md +142 -0
  145. package/docs/start/framework/rendering.md +59 -0
  146. package/docs/start/framework/route-module.md +527 -0
  147. package/docs/start/framework/routing.md +362 -0
  148. package/docs/start/framework/testing.md +133 -0
  149. package/docs/start/index.md +4 -0
  150. package/docs/start/modes.md +201 -0
  151. package/docs/upgrading/component-routes.md +363 -0
  152. package/docs/upgrading/future.md +280 -0
  153. package/docs/upgrading/index.md +4 -0
  154. package/docs/upgrading/remix.md +403 -0
  155. package/docs/upgrading/router-provider.md +442 -0
  156. package/docs/upgrading/v6.md +382 -0
  157. package/package.json +2 -1
@@ -1,6 +1,6 @@
1
- import { l as ServerInstrumentation, H as HydrationState, f as StaticHandlerContext, c as RelativeRoutingType, a as Router$1, d as RouterState, R as RouterInit, t as FutureConfig$1, C as ClientInstrumentation, e as GetScrollRestorationKeyFunction, F as Fetcher, B as BlockerFunction, u as CreateStaticHandlerOptions$1, S as StaticHandler } from './instrumentation-1q4YhLGP.js';
1
+ import { l as ServerInstrumentation, H as HydrationState, e as StaticHandlerContext, c as RelativeRoutingType, a as Router$1, g as RouterState, R as RouterInit, t as FutureConfig$1, C as ClientInstrumentation, d as GetScrollRestorationKeyFunction, F as Fetcher, B as BlockerFunction, u as CreateStaticHandlerOptions$1, S as StaticHandler } from './instrumentation-Dkmpzd13.js';
2
2
  import * as React from 'react';
3
- import { p as RouteManifest, aE as ServerRouteModule, t as MiddlewareEnabled, c as RouterContextProvider, u as AppLoadContext, s as LoaderFunctionArgs, a0 as ActionFunctionArgs, O as RouteModules, n as DataRouteObject, a as ClientLoaderFunction, o as RouteBranch, aF as TrackedPromise, f as History, T as To, L as Location, i as Action, ac as RouteMatch, Y as InitialEntry, _ as NonIndexRouteObject, a7 as LazyRouteFunction, Z as IndexRouteObject, P as Params, l as DataStrategyFunction, m as PatchRoutesOnNavigationFunction, e as RouteObject, U as UIMatch, q as HTMLFormMethod, F as FormEncType, av as PageLinkDescriptor, Q as SerializeFrom } from './data-D4xhSy90.js';
3
+ import { p as RouteManifest, aE as ServerRouteModule, t as MiddlewareEnabled, c as RouterContextProvider, u as AppLoadContext, s as LoaderFunctionArgs, a0 as ActionFunctionArgs, O as RouteModules, n as DataRouteObject, a as ClientLoaderFunction, o as RouteBranch, aF as TrackedPromise, f as History, T as To, L as Location, i as Action, ac as RouteMatch, Y as InitialEntry, _ as NonIndexRouteObject, a7 as LazyRouteFunction, Z as IndexRouteObject, P as Params, l as DataStrategyFunction, m as PatchRoutesOnNavigationFunction, e as RouteObject, U as UIMatch, q as HTMLFormMethod, F as FormEncType, av as PageLinkDescriptor, Q as SerializeFrom } from './data-CjO11-hU.js';
4
4
 
5
5
  type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
6
6
  interface ServerRoute extends Route$1 {
@@ -106,6 +106,7 @@ interface FrameworkContextObject {
106
106
  ssr: boolean;
107
107
  isSpaMode: boolean;
108
108
  routeDiscovery: ServerBuild["routeDiscovery"];
109
+ nonce?: string;
109
110
  serializeError?(error: Error): SerializedError;
110
111
  renderMeta?: {
111
112
  didRenderScripts?: boolean;
@@ -346,6 +347,10 @@ interface MemoryRouterOpts {
346
347
  * in-memory [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
347
348
  * stack. Useful for non-browser environments without a DOM API.
348
349
  *
350
+ * Data Routers should not be held in React state. You should create your router
351
+ * once outside of the React tree and pass it to {@link RouterProvider | `<RouterProvider>`}.
352
+ * You can use `patchRoutesOnNavigation` to add additional routes programmatically.
353
+ *
349
354
  * @public
350
355
  * @category Data Routers
351
356
  * @mode data
@@ -380,7 +385,9 @@ interface ClientOnErrorFunction {
380
385
  */
381
386
  interface RouterProviderProps {
382
387
  /**
383
- * The {@link DataRouter} instance to use for navigation and data fetching.
388
+ * The {@link DataRouter} instance to use for navigation and data fetching. The
389
+ * router prop should be a single router instance created outside of the React
390
+ * tree. Avoid creating new routers during React renders/re-renders.
384
391
  */
385
392
  router: Router$1;
386
393
  /**
@@ -404,7 +411,7 @@ interface RouterProviderProps {
404
411
  * and is only present for render errors.
405
412
  *
406
413
  * ```tsx
407
- * <RouterProvider onError=(error, info) => {
414
+ * <RouterProvider onError={(error, info) => {
408
415
  * let { location, params, pattern, errorInfo } = info;
409
416
  * console.error(error, location, errorInfo);
410
417
  * reportToErrorService(error, location, errorInfo);
@@ -434,7 +441,9 @@ interface RouterProviderProps {
434
441
  }
435
442
  /**
436
443
  * Render the UI for the given {@link DataRouter}. This component should
437
- * typically be at the top of an app's element tree.
444
+ * typically be at the top of an app's element tree. The router prop should
445
+ * be a single router instance created outside of the React tree. Avoid
446
+ * creating new routers during React renders/re-renders.
438
447
  *
439
448
  * ```tsx
440
449
  * import { createBrowserRouter } from "react-router";
@@ -1347,7 +1356,8 @@ interface LinksProps {
1347
1356
  /**
1348
1357
  * A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
1349
1358
  * attribute to render on the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
1350
- * element
1359
+ * element. If not provided in Framework Mode, it will default to any
1360
+ * {@link ServerRouter | `<ServerRouter nonce>`} prop.
1351
1361
  */
1352
1362
  nonce?: string | undefined;
1353
1363
  /**
@@ -1464,7 +1474,8 @@ type ScriptsProps = Omit<React.HTMLProps<HTMLScriptElement>, "async" | "children
1464
1474
  /**
1465
1475
  * A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
1466
1476
  * attribute to render on the [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
1467
- * element
1477
+ * element. If not provided in Framework Mode, it will default to any
1478
+ * {@link ServerRouter | `<ServerRouter nonce>`} prop.
1468
1479
  */
1469
1480
  nonce?: string | undefined;
1470
1481
  };
@@ -1996,6 +2007,10 @@ interface DOMRouterOpts {
1996
2007
  * path via [`history.pushState`](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState)
1997
2008
  * and [`history.replaceState`](https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState).
1998
2009
  *
2010
+ * Data Routers should not be held in React state. You should create your router
2011
+ * once outside of the React tree and pass it to {@link RouterProvider | `<RouterProvider>`}.
2012
+ * You can use `patchRoutesOnNavigation` to add additional routes programmatically.
2013
+ *
1999
2014
  * @public
2000
2015
  * @category Data Routers
2001
2016
  * @mode data
@@ -2016,6 +2031,10 @@ declare function createBrowserRouter(routes: RouteObject[], opts?: DOMRouterOpts
2016
2031
  * Create a new {@link DataRouter| data router} that manages the application
2017
2032
  * path via the URL [`hash`](https://developer.mozilla.org/en-US/docs/Web/API/URL/hash).
2018
2033
  *
2034
+ * Data Routers should not be held in React state. You should create your router
2035
+ * once outside of the React tree and pass it to {@link RouterProvider | `<RouterProvider>`}.
2036
+ * You can use `patchRoutesOnNavigation` to add additional routes programmatically.
2037
+ *
2019
2038
  * @public
2020
2039
  * @category Data Routers
2021
2040
  * @mode data
@@ -2836,7 +2855,10 @@ type ScrollRestorationProps = ScriptsProps & {
2836
2855
  * }
2837
2856
  * ```
2838
2857
  *
2839
- * This component renders an inline `<script>` to prevent scroll flashing. The `nonce` prop will be passed down to the script tag to allow CSP nonce usage.
2858
+ * This component renders an inline `<script>` to prevent scroll flashing. The
2859
+ * `nonce` prop will be passed down to the script tag to allow CSP nonce usage.
2860
+ * If not provided in Framework Mode, it will default to any
2861
+ * {@link ServerRouter | `<ServerRouter nonce>`} prop.
2840
2862
  *
2841
2863
  * ```tsx
2842
2864
  * <ScrollRestoration nonce={cspNonce} />
@@ -1,6 +1,6 @@
1
- import { o as ServerInstrumentation, H as HydrationState, i as StaticHandlerContext, f as RelativeRoutingType, h as GetScrollRestorationKeyFunction, R as RouterInit, ah as FutureConfig$1, C as ClientInstrumentation, N as NavigateOptions, F as Fetcher, c as Router, B as BlockerFunction, ai as CreateStaticHandlerOptions$1, S as StaticHandler } from './context-m8rizgnE.mjs';
1
+ import { o as ServerInstrumentation, H as HydrationState, h as StaticHandlerContext, f as RelativeRoutingType, g as GetScrollRestorationKeyFunction, R as RouterInit, ah as FutureConfig$1, C as ClientInstrumentation, N as NavigateOptions, F as Fetcher, c as Router, B as BlockerFunction, ai as CreateStaticHandlerOptions$1, S as StaticHandler } from './context-CeD5LmaF.mjs';
2
2
  import * as React from 'react';
3
- import { J as RouteManifest, aF as ServerRouteModule, p as MiddlewareEnabled, c as RouterContextProvider, q as AppLoadContext, o as LoaderFunctionArgs, a3 as ActionFunctionArgs, Z as RouteModules, E as DataRouteObject, a as ClientLoaderFunction, I as RouteBranch, m as HTMLFormMethod, n as FormEncType, aw as PageLinkDescriptor, T as To, s as History, z as DataStrategyFunction, B as PatchRoutesOnNavigationFunction, r as RouteObject, _ as SerializeFrom, L as Location } from './data-U8FS-wNn.mjs';
3
+ import { J as RouteManifest, aF as ServerRouteModule, p as MiddlewareEnabled, c as RouterContextProvider, q as AppLoadContext, o as LoaderFunctionArgs, a3 as ActionFunctionArgs, Z as RouteModules, E as DataRouteObject, a as ClientLoaderFunction, I as RouteBranch, m as HTMLFormMethod, n as FormEncType, aw as PageLinkDescriptor, T as To, s as History, z as DataStrategyFunction, B as PatchRoutesOnNavigationFunction, r as RouteObject, _ as SerializeFrom, L as Location } from './data-DEjBmEfD.mjs';
4
4
 
5
5
  type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
6
6
  interface ServerRoute extends Route {
@@ -106,6 +106,7 @@ interface FrameworkContextObject {
106
106
  ssr: boolean;
107
107
  isSpaMode: boolean;
108
108
  routeDiscovery: ServerBuild["routeDiscovery"];
109
+ nonce?: string;
109
110
  serializeError?(error: Error): SerializedError;
110
111
  renderMeta?: {
111
112
  didRenderScripts?: boolean;
@@ -292,7 +293,8 @@ interface LinksProps {
292
293
  /**
293
294
  * A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
294
295
  * attribute to render on the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
295
- * element
296
+ * element. If not provided in Framework Mode, it will default to any
297
+ * {@link ServerRouter | `<ServerRouter nonce>`} prop.
296
298
  */
297
299
  nonce?: string | undefined;
298
300
  /**
@@ -409,7 +411,8 @@ type ScriptsProps = Omit<React.HTMLProps<HTMLScriptElement>, "async" | "children
409
411
  /**
410
412
  * A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
411
413
  * attribute to render on the [`<script>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)
412
- * element
414
+ * element. If not provided in Framework Mode, it will default to any
415
+ * {@link ServerRouter | `<ServerRouter nonce>`} prop.
413
416
  */
414
417
  nonce?: string | undefined;
415
418
  };
@@ -941,6 +944,10 @@ interface DOMRouterOpts {
941
944
  * path via [`history.pushState`](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState)
942
945
  * and [`history.replaceState`](https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState).
943
946
  *
947
+ * Data Routers should not be held in React state. You should create your router
948
+ * once outside of the React tree and pass it to {@link RouterProvider | `<RouterProvider>`}.
949
+ * You can use `patchRoutesOnNavigation` to add additional routes programmatically.
950
+ *
944
951
  * @public
945
952
  * @category Data Routers
946
953
  * @mode data
@@ -961,6 +968,10 @@ declare function createBrowserRouter(routes: RouteObject[], opts?: DOMRouterOpts
961
968
  * Create a new {@link DataRouter| data router} that manages the application
962
969
  * path via the URL [`hash`](https://developer.mozilla.org/en-US/docs/Web/API/URL/hash).
963
970
  *
971
+ * Data Routers should not be held in React state. You should create your router
972
+ * once outside of the React tree and pass it to {@link RouterProvider | `<RouterProvider>`}.
973
+ * You can use `patchRoutesOnNavigation` to add additional routes programmatically.
974
+ *
964
975
  * @public
965
976
  * @category Data Routers
966
977
  * @mode data
@@ -1781,7 +1792,10 @@ type ScrollRestorationProps = ScriptsProps & {
1781
1792
  * }
1782
1793
  * ```
1783
1794
  *
1784
- * This component renders an inline `<script>` to prevent scroll flashing. The `nonce` prop will be passed down to the script tag to allow CSP nonce usage.
1795
+ * This component renders an inline `<script>` to prevent scroll flashing. The
1796
+ * `nonce` prop will be passed down to the script tag to allow CSP nonce usage.
1797
+ * If not provided in Framework Mode, it will default to any
1798
+ * {@link ServerRouter | `<ServerRouter nonce>`} prop.
1785
1799
  *
1786
1800
  * ```tsx
1787
1801
  * <ScrollRestoration nonce={cspNonce} />
@@ -1,4 +1,4 @@
1
- export { Q as MemoryRouter, T as Navigate, U as Outlet, V as Route, W as Router, X as RouterProvider, Y as Routes, A as UNSAFE_AwaitContextProvider, ab as UNSAFE_WithComponentProps, af as UNSAFE_WithErrorBoundaryProps, ad as UNSAFE_WithHydrateFallbackProps } from './context-m8rizgnE.mjs';
2
- export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-CdKROblb.mjs';
3
- import './data-U8FS-wNn.mjs';
1
+ export { Q as MemoryRouter, T as Navigate, U as Outlet, V as Route, W as Router, X as RouterProvider, Y as Routes, A as UNSAFE_AwaitContextProvider, ab as UNSAFE_WithComponentProps, af as UNSAFE_WithErrorBoundaryProps, ad as UNSAFE_WithHydrateFallbackProps } from './context-CeD5LmaF.mjs';
2
+ export { l as BrowserRouter, q as Form, m as HashRouter, n as Link, X as Links, W as Meta, p as NavLink, r as ScrollRestoration, T as StaticRouter, V as StaticRouterProvider, o as unstable_HistoryRouter } from './index-react-server-client-CACgcj2J.mjs';
3
+ import './data-DEjBmEfD.mjs';
4
4
  import 'react';
@@ -1,4 +1,4 @@
1
- export { W as BrowserRouter, $ as Form, X as HashRouter, Y as Link, an as Links, j as MemoryRouter, am as Meta, _ as NavLink, k as Navigate, l as Outlet, m as Route, n as Router, o as RouterProvider, p as Routes, a0 as ScrollRestoration, ak as StaticRouter, al as StaticRouterProvider, b as UNSAFE_AwaitContextProvider, aH as UNSAFE_WithComponentProps, aL as UNSAFE_WithErrorBoundaryProps, aJ as UNSAFE_WithHydrateFallbackProps, Z as unstable_HistoryRouter } from './index-react-server-client-BLiUx67a.js';
2
- import './instrumentation-1q4YhLGP.js';
3
- import './data-D4xhSy90.js';
1
+ export { W as BrowserRouter, $ as Form, X as HashRouter, Y as Link, an as Links, j as MemoryRouter, am as Meta, _ as NavLink, k as Navigate, l as Outlet, m as Route, n as Router, o as RouterProvider, p as Routes, a0 as ScrollRestoration, ak as StaticRouter, al as StaticRouterProvider, b as UNSAFE_AwaitContextProvider, aH as UNSAFE_WithComponentProps, aL as UNSAFE_WithErrorBoundaryProps, aJ as UNSAFE_WithHydrateFallbackProps, Z as unstable_HistoryRouter } from './index-react-server-client-3ykjivgQ.js';
2
+ import './instrumentation-Dkmpzd13.js';
3
+ import './data-CjO11-hU.js';
4
4
  import 'react';
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
2
- * react-router v7.16.0
2
+ * react-router v7.18.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -19,7 +19,7 @@
19
19
 
20
20
 
21
21
 
22
- var _chunkIBI7OMNBjs = require('./chunk-IBI7OMNB.js');
22
+ var _chunkYL5M26XIjs = require('./chunk-YL5M26XI.js');
23
23
 
24
24
 
25
25
 
@@ -34,7 +34,7 @@ var _chunkIBI7OMNBjs = require('./chunk-IBI7OMNB.js');
34
34
 
35
35
 
36
36
 
37
- var _chunkSRID2YZ2js = require('./chunk-SRID2YZ2.js');
37
+ var _chunkU7ORXROYjs = require('./chunk-U7ORXROY.js');
38
38
 
39
39
 
40
40
 
@@ -58,4 +58,4 @@ var _chunkSRID2YZ2js = require('./chunk-SRID2YZ2.js');
58
58
 
59
59
 
60
60
 
61
- exports.BrowserRouter = _chunkIBI7OMNBjs.BrowserRouter; exports.Form = _chunkIBI7OMNBjs.Form; exports.HashRouter = _chunkIBI7OMNBjs.HashRouter; exports.Link = _chunkIBI7OMNBjs.Link; exports.Links = _chunkSRID2YZ2js.Links; exports.MemoryRouter = _chunkSRID2YZ2js.MemoryRouter; exports.Meta = _chunkSRID2YZ2js.Meta; exports.NavLink = _chunkIBI7OMNBjs.NavLink; exports.Navigate = _chunkSRID2YZ2js.Navigate; exports.Outlet = _chunkSRID2YZ2js.Outlet; exports.Route = _chunkSRID2YZ2js.Route; exports.Router = _chunkSRID2YZ2js.Router; exports.RouterProvider = _chunkSRID2YZ2js.RouterProvider; exports.Routes = _chunkSRID2YZ2js.Routes; exports.ScrollRestoration = _chunkIBI7OMNBjs.ScrollRestoration; exports.StaticRouter = _chunkIBI7OMNBjs.StaticRouter; exports.StaticRouterProvider = _chunkIBI7OMNBjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkSRID2YZ2js.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunkSRID2YZ2js.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkSRID2YZ2js.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkSRID2YZ2js.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkIBI7OMNBjs.HistoryRouter;
61
+ exports.BrowserRouter = _chunkYL5M26XIjs.BrowserRouter; exports.Form = _chunkYL5M26XIjs.Form; exports.HashRouter = _chunkYL5M26XIjs.HashRouter; exports.Link = _chunkYL5M26XIjs.Link; exports.Links = _chunkU7ORXROYjs.Links; exports.MemoryRouter = _chunkU7ORXROYjs.MemoryRouter; exports.Meta = _chunkU7ORXROYjs.Meta; exports.NavLink = _chunkYL5M26XIjs.NavLink; exports.Navigate = _chunkU7ORXROYjs.Navigate; exports.Outlet = _chunkU7ORXROYjs.Outlet; exports.Route = _chunkU7ORXROYjs.Route; exports.Router = _chunkU7ORXROYjs.Router; exports.RouterProvider = _chunkU7ORXROYjs.RouterProvider; exports.Routes = _chunkU7ORXROYjs.Routes; exports.ScrollRestoration = _chunkYL5M26XIjs.ScrollRestoration; exports.StaticRouter = _chunkYL5M26XIjs.StaticRouter; exports.StaticRouterProvider = _chunkYL5M26XIjs.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkU7ORXROYjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunkU7ORXROYjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkU7ORXROYjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkU7ORXROYjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkYL5M26XIjs.HistoryRouter;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.16.0
2
+ * react-router v7.18.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -32,7 +32,7 @@ import {
32
32
  WithComponentProps,
33
33
  WithErrorBoundaryProps,
34
34
  WithHydrateFallbackProps
35
- } from "./chunk-QUQL4437.mjs";
35
+ } from "./chunk-4ZMWKKQ3.mjs";
36
36
  export {
37
37
  BrowserRouter,
38
38
  Form,
@@ -845,6 +845,8 @@ interface RouteMeta<RouteObjectType extends RouteObject = RouteObject> {
845
845
  caseSensitive: boolean;
846
846
  childrenIndex: number;
847
847
  route: RouteObjectType;
848
+ matcher?: RegExp;
849
+ compiledParams?: CompiledPathParam[];
848
850
  }
849
851
  /**
850
852
  * @private
@@ -858,6 +860,10 @@ interface RouteBranch<RouteObjectType extends RouteObject = RouteObject> {
858
860
  score: number;
859
861
  routesMeta: RouteMeta<RouteObjectType>[];
860
862
  }
863
+ type CompiledPathParam = {
864
+ paramName: string;
865
+ isOptional?: boolean;
866
+ };
861
867
  declare class DataWithResponseInit<D> {
862
868
  type: string;
863
869
  data: D;
@@ -1837,7 +1843,9 @@ interface PageLinkDescriptor extends Omit<HtmlLinkDescriptor, "href" | "rel" | "
1837
1843
  /**
1838
1844
  * A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
1839
1845
  * attribute to render on the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
1840
- * element
1846
+ * element. If not provided in Framework Mode, it will default to any
1847
+ * {@link ServerRouter | `<ServerRouter nonce>`} prop.
1848
+
1841
1849
  */
1842
1850
  nonce?: string | undefined;
1843
1851
  /**
@@ -845,6 +845,8 @@ interface RouteMeta<RouteObjectType extends RouteObject = RouteObject> {
845
845
  caseSensitive: boolean;
846
846
  childrenIndex: number;
847
847
  route: RouteObjectType;
848
+ matcher?: RegExp;
849
+ compiledParams?: CompiledPathParam[];
848
850
  }
849
851
  /**
850
852
  * @private
@@ -858,6 +860,10 @@ interface RouteBranch<RouteObjectType extends RouteObject = RouteObject> {
858
860
  score: number;
859
861
  routesMeta: RouteMeta<RouteObjectType>[];
860
862
  }
863
+ type CompiledPathParam = {
864
+ paramName: string;
865
+ isOptional?: boolean;
866
+ };
861
867
  declare class DataWithResponseInit<D> {
862
868
  type: string;
863
869
  data: D;
@@ -1837,7 +1843,9 @@ interface PageLinkDescriptor extends Omit<HtmlLinkDescriptor, "href" | "rel" | "
1837
1843
  /**
1838
1844
  * A [`nonce`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/nonce)
1839
1845
  * attribute to render on the [`<link>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link)
1840
- * element
1846
+ * element. If not provided in Framework Mode, it will default to any
1847
+ * {@link ServerRouter | `<ServerRouter nonce>`} prop.
1848
+
1841
1849
  */
1842
1850
  nonce?: string | undefined;
1843
1851
  /**