react-router 7.9.6 → 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 -10
  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-O4JVZSOY.js → chunk-2VILFZWG.js} +167 -123
  5. package/dist/development/{chunk-4WY6JWTD.mjs → chunk-4BTFPFZR.mjs} +208 -221
  6. package/dist/development/{chunk-G3INQAYP.mjs → chunk-CECIHG5K.mjs} +15 -5
  7. package/dist/development/{chunk-AMVS5XVJ.js → chunk-M4WLV5HP.js} +201 -258
  8. package/dist/development/{chunk-PZWDWJAY.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-EAIF67OW.js → chunk-55FFLVQP.js} +201 -258
  38. package/dist/production/{chunk-QN64DHI4.js → chunk-5DTJHKF7.js} +167 -123
  39. package/dist/production/{chunk-FUSXQSWG.mjs → chunk-KJ5676BZ.mjs} +208 -221
  40. package/dist/production/{chunk-FDUMZGKM.mjs → chunk-QKAGOFED.mjs} +15 -5
  41. package/dist/production/{chunk-G5A35OQU.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
2
+ * react-router v7.10.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -14,7 +14,7 @@ import {
14
14
  deserializeErrors,
15
15
  getHydrationData,
16
16
  populateRSCRouteModules
17
- } from "./chunk-FDUMZGKM.mjs";
17
+ } from "./chunk-QKAGOFED.mjs";
18
18
  import {
19
19
  CRITICAL_CSS_DATA_ATTRIBUTE,
20
20
  ErrorResponseImpl,
@@ -22,7 +22,6 @@ import {
22
22
  RSCRouterContext,
23
23
  RemixErrorBoundary,
24
24
  RouterProvider,
25
- UNSTABLE_TransitionEnabledRouterProvider,
26
25
  createBrowserHistory,
27
26
  createClientRoutes,
28
27
  createClientRoutesWithHMRRevalidationOptOut,
@@ -43,7 +42,7 @@ import {
43
42
  singleFetchUrl,
44
43
  stripIndexParam,
45
44
  useFogOFWarDiscovery
46
- } from "./chunk-FUSXQSWG.mjs";
45
+ } from "./chunk-KJ5676BZ.mjs";
47
46
 
48
47
  // lib/dom-export/dom-router-provider.tsx
49
48
  import * as React from "react";
@@ -245,6 +244,7 @@ function HydratedRouter(props) {
245
244
  RouterProvider2,
246
245
  {
247
246
  router,
247
+ unstable_useTransitions: props.unstable_useTransitions,
248
248
  unstable_onError: props.unstable_onError
249
249
  }
250
250
  ))
@@ -283,66 +283,68 @@ function createCallServer({
283
283
  temporaryReferences
284
284
  });
285
285
  });
286
- globalVar.__reactRouterDataRouter.__setPendingRerender(
287
- Promise.resolve(payloadPromise).then(async (payload) => {
288
- if (payload.type === "redirect") {
289
- if (payload.reload || isExternalLocation(payload.location)) {
290
- window.location.href = payload.location;
291
- return () => {
292
- };
293
- }
294
- return () => {
295
- globalVar.__reactRouterDataRouter.navigate(payload.location, {
296
- replace: payload.replace
297
- });
298
- };
299
- }
300
- if (payload.type !== "action") {
301
- throw new Error("Unexpected payload type");
302
- }
303
- const rerender = await payload.rerender;
304
- if (rerender && landedActionId < actionId && globalVar.__routerActionID <= actionId) {
305
- if (rerender.type === "redirect") {
306
- if (rerender.reload || isExternalLocation(rerender.location)) {
307
- window.location.href = rerender.location;
286
+ React3.startTransition(
287
+ () => (
288
+ // @ts-expect-error - Needs React 19 types
289
+ Promise.resolve(payloadPromise).then(async (payload) => {
290
+ if (payload.type === "redirect") {
291
+ if (payload.reload || isExternalLocation(payload.location)) {
292
+ window.location.href = payload.location;
308
293
  return;
309
294
  }
310
- return () => {
311
- globalVar.__reactRouterDataRouter.navigate(rerender.location, {
312
- replace: rerender.replace
295
+ React3.startTransition(() => {
296
+ globalVar.__reactRouterDataRouter.navigate(payload.location, {
297
+ replace: payload.replace
313
298
  });
314
- };
299
+ });
300
+ return;
315
301
  }
316
- return () => {
317
- let lastMatch;
318
- for (const match of rerender.matches) {
319
- globalVar.__reactRouterDataRouter.patchRoutes(
320
- lastMatch?.id ?? null,
321
- [createRouteFromServerManifest(match)],
322
- true
323
- );
324
- lastMatch = match;
302
+ if (payload.type !== "action") {
303
+ throw new Error("Unexpected payload type");
304
+ }
305
+ const rerender = await payload.rerender;
306
+ if (rerender && landedActionId < actionId && globalVar.__routerActionID <= actionId) {
307
+ if (rerender.type === "redirect") {
308
+ if (rerender.reload || isExternalLocation(rerender.location)) {
309
+ window.location.href = rerender.location;
310
+ return;
311
+ }
312
+ React3.startTransition(() => {
313
+ globalVar.__reactRouterDataRouter.navigate(rerender.location, {
314
+ replace: rerender.replace
315
+ });
316
+ });
317
+ return;
325
318
  }
326
- window.__reactRouterDataRouter._internalSetStateDoNotUseOrYouWillBreakYourApp(
327
- {
328
- loaderData: Object.assign(
329
- {},
330
- globalVar.__reactRouterDataRouter.state.loaderData,
331
- rerender.loaderData
332
- ),
333
- errors: rerender.errors ? Object.assign(
334
- {},
335
- globalVar.__reactRouterDataRouter.state.errors,
336
- rerender.errors
337
- ) : null
319
+ React3.startTransition(() => {
320
+ let lastMatch;
321
+ for (const match of rerender.matches) {
322
+ globalVar.__reactRouterDataRouter.patchRoutes(
323
+ lastMatch?.id ?? null,
324
+ [createRouteFromServerManifest(match)],
325
+ true
326
+ );
327
+ lastMatch = match;
338
328
  }
339
- );
340
- };
341
- }
342
- return () => {
343
- };
344
- }).catch(() => {
345
- })
329
+ window.__reactRouterDataRouter._internalSetStateDoNotUseOrYouWillBreakYourApp(
330
+ {
331
+ loaderData: Object.assign(
332
+ {},
333
+ globalVar.__reactRouterDataRouter.state.loaderData,
334
+ rerender.loaderData
335
+ ),
336
+ errors: rerender.errors ? Object.assign(
337
+ {},
338
+ globalVar.__reactRouterDataRouter.state.errors,
339
+ rerender.errors
340
+ ) : null
341
+ }
342
+ );
343
+ });
344
+ }
345
+ }).catch(() => {
346
+ })
347
+ )
346
348
  );
347
349
  return payloadPromise.then((payload) => {
348
350
  if (payload.type !== "action" && payload.type !== "redirect") {
@@ -541,18 +543,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
541
543
  }
542
544
  renderedRoutesById.get(route.id).push(route);
543
545
  }
544
- for (const match of args.matches) {
545
- const renderedRoutes = renderedRoutesById.get(match.route.id);
546
- if (renderedRoutes) {
547
- for (const rendered of renderedRoutes) {
548
- window.__reactRouterDataRouter.patchRoutes(
549
- rendered.parentId ?? null,
550
- [createRouteFromServerManifest(rendered)],
551
- true
552
- );
546
+ React3.startTransition(() => {
547
+ for (const match of args.matches) {
548
+ const renderedRoutes = renderedRoutesById.get(match.route.id);
549
+ if (renderedRoutes) {
550
+ for (const rendered of renderedRoutes) {
551
+ window.__reactRouterDataRouter.patchRoutes(
552
+ rendered.parentId ?? null,
553
+ [createRouteFromServerManifest(rendered)],
554
+ true
555
+ );
556
+ }
553
557
  }
554
558
  }
555
- }
559
+ });
556
560
  return results;
557
561
  });
558
562
  }
@@ -638,14 +642,29 @@ function RSCHydratedRouter({
638
642
  globalVar.__reactRouterDataRouter.initialize();
639
643
  }
640
644
  }, []);
641
- let [location2, setLocation] = React3.useState(router2.state.location);
645
+ let [{ routes, state }, setState] = React3.useState(() => ({
646
+ routes: cloneRoutes(router2.routes),
647
+ state: router2.state
648
+ }));
642
649
  React3.useLayoutEffect(
643
650
  () => router2.subscribe((newState) => {
644
- if (newState.location !== location2) {
645
- setLocation(newState.location);
646
- }
651
+ if (diffRoutes(router2.routes, routes))
652
+ React3.startTransition(() => {
653
+ setState({
654
+ routes: cloneRoutes(router2.routes),
655
+ state: newState
656
+ });
657
+ });
658
+ }),
659
+ [router2.subscribe, routes, router2]
660
+ );
661
+ const transitionEnabledRouter = React3.useMemo(
662
+ () => ({
663
+ ...router2,
664
+ state,
665
+ routes
647
666
  }),
648
- [router2, location2]
667
+ [router2, routes, state]
649
668
  );
650
669
  React3.useEffect(() => {
651
670
  if (routeDiscovery === "lazy" || // @ts-expect-error - TS doesn't know about this yet
@@ -716,7 +735,14 @@ function RSCHydratedRouter({
716
735
  routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
717
736
  routeModules
718
737
  };
719
- return /* @__PURE__ */ React3.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(RSCRouterGlobalErrorBoundary, { location: location2 }, /* @__PURE__ */ React3.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(UNSTABLE_TransitionEnabledRouterProvider, { router: router2, flushSync: ReactDOM2.flushSync }))));
738
+ return /* @__PURE__ */ React3.createElement(RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
739
+ RouterProvider,
740
+ {
741
+ router: transitionEnabledRouter,
742
+ flushSync: ReactDOM2.flushSync,
743
+ unstable_useTransitions: true
744
+ }
745
+ ))));
720
746
  }
721
747
  function createRouteFromServerManifest(match, payload) {
722
748
  let hasInitialData = payload && match.id in payload.loaderData;
@@ -852,11 +878,13 @@ async function fetchAndApplyManifestPatches(paths, createFromReadableStream, fet
852
878
  throw new Error("Failed to patch routes");
853
879
  }
854
880
  paths.forEach((p) => addToFifoQueue(p, discoveredPaths));
855
- payload.patches.forEach((p) => {
856
- window.__reactRouterDataRouter.patchRoutes(
857
- p.parentId ?? null,
858
- [createRouteFromServerManifest(p)]
859
- );
881
+ React3.startTransition(() => {
882
+ payload.patches.forEach((p) => {
883
+ window.__reactRouterDataRouter.patchRoutes(
884
+ p.parentId ?? null,
885
+ [createRouteFromServerManifest(p)]
886
+ );
887
+ });
860
888
  });
861
889
  }
862
890
  function addToFifoQueue(path, queue) {
@@ -877,6 +905,32 @@ function isExternalLocation(location2) {
877
905
  const newLocation = new URL(location2, window.location.href);
878
906
  return newLocation.origin !== window.location.origin;
879
907
  }
908
+ function cloneRoutes(routes) {
909
+ if (!routes) return void 0;
910
+ return routes.map((route) => ({
911
+ ...route,
912
+ children: cloneRoutes(route.children)
913
+ }));
914
+ }
915
+ function diffRoutes(a, b) {
916
+ if (a.length !== b.length) return true;
917
+ return a.some((route, index) => {
918
+ if (route.element !== b[index].element) return true;
919
+ if (route.errorElement !== b[index].errorElement)
920
+ return true;
921
+ if (route.hydrateFallbackElement !== b[index].hydrateFallbackElement)
922
+ return true;
923
+ if (route.hasErrorBoundary !== b[index].hasErrorBoundary)
924
+ return true;
925
+ if (route.hasLoader !== b[index].hasLoader) return true;
926
+ if (route.hasClientLoader !== b[index].hasClientLoader)
927
+ return true;
928
+ if (route.hasAction !== b[index].hasAction) return true;
929
+ if (route.hasClientAction !== b[index].hasClientAction)
930
+ return true;
931
+ return diffRoutes(route.children || [], b[index].children || []);
932
+ });
933
+ }
880
934
 
881
935
  // lib/rsc/html-stream/browser.ts
882
936
  function getRSCStream() {
@@ -1,4 +1,4 @@
1
- import { bE as RouteManifest, o as RouteModules, Q as HydrationState, a1 as DataRouteObject, a as ClientLoaderFunction, a5 as StaticHandlerContext, bF as ServerRouteModule, q as MiddlewareEnabled, c as RouterContextProvider, r as AppLoadContext, al as LoaderFunctionArgs, ac as ActionFunctionArgs, au as unstable_ServerInstrumentation, aj as HTMLFormMethod, ah as FormEncType, w as RelativeRoutingType, bh as PageLinkDescriptor, T as To, bG as History, a4 as GetScrollRestorationKeyFunction, e as RouterInit, bH as FutureConfig$1, u as unstable_ClientInstrumentation, p as DataStrategyFunction, a0 as PatchRoutesOnNavigationFunction, s as NavigateOptions, a6 as Fetcher, K as RouteObject, n as Router, v as SerializeFrom, B as BlockerFunction, L as Location, bI as CreateStaticHandlerOptions$1, a2 as StaticHandler } from './instrumentation-Unc20tLk.js';
1
+ import { bE as RouteManifest, o as RouteModules, Q as HydrationState, a1 as DataRouteObject, a as ClientLoaderFunction, a5 as StaticHandlerContext, bF as ServerRouteModule, q as MiddlewareEnabled, c as RouterContextProvider, r as AppLoadContext, al as LoaderFunctionArgs, ac as ActionFunctionArgs, au as unstable_ServerInstrumentation, aj as HTMLFormMethod, ah as FormEncType, w as RelativeRoutingType, bh as PageLinkDescriptor, T as To, bG as History, a4 as GetScrollRestorationKeyFunction, e as RouterInit, bH as FutureConfig$1, u as unstable_ClientInstrumentation, p as DataStrategyFunction, a0 as PatchRoutesOnNavigationFunction, s as NavigateOptions, a6 as Fetcher, K as RouteObject, n as Router, v as SerializeFrom, B as BlockerFunction, L as Location, bI as CreateStaticHandlerOptions$1, a2 as StaticHandler } from './instrumentation-Dwf-sTWa.js';
2
2
  import * as React from 'react';
3
3
 
4
4
  interface Route {
@@ -1122,6 +1122,21 @@ interface BrowserRouterProps {
1122
1122
  * {@link Route | `<Route>`} components describing your route configuration
1123
1123
  */
1124
1124
  children?: React.ReactNode;
1125
+ /**
1126
+ * Control whether router state updates are internally wrapped in
1127
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition).
1128
+ *
1129
+ * - When left `undefined`, all router state updates are wrapped in
1130
+ * `React.startTransition`
1131
+ * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1132
+ * in `React.startTransition` and all router state updates are wrapped in
1133
+ * `React.startTransition`
1134
+ * - When set to `false`, the router will not leverage `React.startTransition`
1135
+ * on any navigations or state changes.
1136
+ *
1137
+ * For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
1138
+ */
1139
+ unstable_useTransitions?: boolean;
1125
1140
  /**
1126
1141
  * [`Window`](https://developer.mozilla.org/en-US/docs/Web/API/Window) object
1127
1142
  * override. Defaults to the global `window` instance
@@ -1138,11 +1153,12 @@ interface BrowserRouterProps {
1138
1153
  * @param props Props
1139
1154
  * @param {BrowserRouterProps.basename} props.basename n/a
1140
1155
  * @param {BrowserRouterProps.children} props.children n/a
1156
+ * @param {BrowserRouterProps.unstable_useTransitions} props.unstable_useTransitions n/a
1141
1157
  * @param {BrowserRouterProps.window} props.window n/a
1142
1158
  * @returns A declarative {@link Router | `<Router>`} using the browser [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
1143
1159
  * API for client-side routing.
1144
1160
  */
1145
- declare function BrowserRouter({ basename, children, window, }: BrowserRouterProps): React.JSX.Element;
1161
+ declare function BrowserRouter({ basename, children, unstable_useTransitions, window, }: BrowserRouterProps): React.JSX.Element;
1146
1162
  /**
1147
1163
  * @category Types
1148
1164
  */
@@ -1155,6 +1171,21 @@ interface HashRouterProps {
1155
1171
  * {@link Route | `<Route>`} components describing your route configuration
1156
1172
  */
1157
1173
  children?: React.ReactNode;
1174
+ /**
1175
+ * Control whether router state updates are internally wrapped in
1176
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition).
1177
+ *
1178
+ * - When left `undefined`, all router state updates are wrapped in
1179
+ * `React.startTransition`
1180
+ * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1181
+ * in `React.startTransition` and all router state updates are wrapped in
1182
+ * `React.startTransition`
1183
+ * - When set to `false`, the router will not leverage `React.startTransition`
1184
+ * on any navigations or state changes.
1185
+ *
1186
+ * For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
1187
+ */
1188
+ unstable_useTransitions?: boolean;
1158
1189
  /**
1159
1190
  * [`Window`](https://developer.mozilla.org/en-US/docs/Web/API/Window) object
1160
1191
  * override. Defaults to the global `window` instance
@@ -1172,11 +1203,12 @@ interface HashRouterProps {
1172
1203
  * @param props Props
1173
1204
  * @param {HashRouterProps.basename} props.basename n/a
1174
1205
  * @param {HashRouterProps.children} props.children n/a
1206
+ * @param {HashRouterProps.unstable_useTransitions} props.unstable_useTransitions n/a
1175
1207
  * @param {HashRouterProps.window} props.window n/a
1176
1208
  * @returns A declarative {@link Router | `<Router>`} using the URL [`hash`](https://developer.mozilla.org/en-US/docs/Web/API/URL/hash)
1177
1209
  * for client-side routing.
1178
1210
  */
1179
- declare function HashRouter({ basename, children, window }: HashRouterProps): React.JSX.Element;
1211
+ declare function HashRouter({ basename, children, unstable_useTransitions, window, }: HashRouterProps): React.JSX.Element;
1180
1212
  /**
1181
1213
  * @category Types
1182
1214
  */
@@ -1193,6 +1225,21 @@ interface HistoryRouterProps {
1193
1225
  * A {@link History} implementation for use by the router
1194
1226
  */
1195
1227
  history: History;
1228
+ /**
1229
+ * Control whether router state updates are internally wrapped in
1230
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition).
1231
+ *
1232
+ * - When left `undefined`, all router state updates are wrapped in
1233
+ * `React.startTransition`
1234
+ * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1235
+ * in `React.startTransition` and all router state updates are wrapped in
1236
+ * `React.startTransition`
1237
+ * - When set to `false`, the router will not leverage `React.startTransition`
1238
+ * on any navigations or state changes.
1239
+ *
1240
+ * For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
1241
+ */
1242
+ unstable_useTransitions?: boolean;
1196
1243
  }
1197
1244
  /**
1198
1245
  * A declarative {@link Router | `<Router>`} that accepts a pre-instantiated
@@ -1209,10 +1256,11 @@ interface HistoryRouterProps {
1209
1256
  * @param {HistoryRouterProps.basename} props.basename n/a
1210
1257
  * @param {HistoryRouterProps.children} props.children n/a
1211
1258
  * @param {HistoryRouterProps.history} props.history n/a
1259
+ * @param {HistoryRouterProps.unstable_useTransitions} props.unstable_useTransitions n/a
1212
1260
  * @returns A declarative {@link Router | `<Router>`} using the provided history
1213
1261
  * implementation for client-side routing.
1214
1262
  */
1215
- declare function HistoryRouter({ basename, children, history, }: HistoryRouterProps): React.JSX.Element;
1263
+ declare function HistoryRouter({ basename, children, history, unstable_useTransitions, }: HistoryRouterProps): React.JSX.Element;
1216
1264
  declare namespace HistoryRouter {
1217
1265
  var displayName: string;
1218
1266
  }
@@ -1830,15 +1878,19 @@ declare namespace ScrollRestoration {
1830
1878
  * @param options.viewTransition Enables a [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API)
1831
1879
  * for this navigation. To apply specific styles during the transition, see
1832
1880
  * {@link useViewTransitionState}. Defaults to `false`.
1881
+ * @param options.unstable_useTransitions Wraps the navigation in
1882
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition)
1883
+ * for concurrent rendering. Defaults to `false`.
1833
1884
  * @returns A click handler function that can be used in a custom {@link Link} component.
1834
1885
  */
1835
- declare function useLinkClickHandler<E extends Element = HTMLAnchorElement>(to: To, { target, replace: replaceProp, state, preventScrollReset, relative, viewTransition, }?: {
1886
+ declare function useLinkClickHandler<E extends Element = HTMLAnchorElement>(to: To, { target, replace: replaceProp, state, preventScrollReset, relative, viewTransition, unstable_useTransitions, }?: {
1836
1887
  target?: React.HTMLAttributeAnchorTarget;
1837
1888
  replace?: boolean;
1838
1889
  state?: any;
1839
1890
  preventScrollReset?: boolean;
1840
1891
  relative?: RelativeRoutingType;
1841
1892
  viewTransition?: boolean;
1893
+ unstable_useTransitions?: boolean;
1842
1894
  }): (event: React.MouseEvent<E, MouseEvent>) => void;
1843
1895
  /**
1844
1896
  * Returns a tuple of the current URL's [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams)
@@ -2167,7 +2219,7 @@ type FetcherWithComponents<TData> = Fetcher<TData> & {
2167
2219
  * @param reason Optional `reason` to provide to [`AbortController.abort()`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)
2168
2220
  * @returns void
2169
2221
  */
2170
- unstable_reset: (opts?: {
2222
+ reset: (opts?: {
2171
2223
  reason?: unknown;
2172
2224
  }) => void;
2173
2225
  /**
@@ -2256,7 +2308,7 @@ type FetcherWithComponents<TData> = Fetcher<TData> & {
2256
2308
  * })
2257
2309
  *
2258
2310
  * // reset fetcher
2259
- * fetcher.unstable_reset()
2311
+ * fetcher.reset()
2260
2312
  * }
2261
2313
  *
2262
2314
  * @public
@@ -1,4 +1,4 @@
1
- import { bE as RouteManifest, q as RouteModules, W as HydrationState, a3 as DataRouteObject, a as ClientLoaderFunction, a7 as StaticHandlerContext, bF as ServerRouteModule, s as MiddlewareEnabled, c as RouterContextProvider, t as AppLoadContext, an as LoaderFunctionArgs, ae as ActionFunctionArgs, aw as unstable_ServerInstrumentation, al as HTMLFormMethod, aj as FormEncType, y as RelativeRoutingType, bh as PageLinkDescriptor, T as To, bG as History, a6 as GetScrollRestorationKeyFunction, e as RouterInit, bH as FutureConfig$1, u as unstable_ClientInstrumentation, r as DataStrategyFunction, a2 as PatchRoutesOnNavigationFunction, v as NavigateOptions, a8 as Fetcher, Q as RouteObject, p as Router, x as SerializeFrom, B as BlockerFunction, L as Location, bI as CreateStaticHandlerOptions$1, a4 as StaticHandler } from './router-CAvh_Drx.mjs';
1
+ import { bE as RouteManifest, q as RouteModules, W as HydrationState, a3 as DataRouteObject, a as ClientLoaderFunction, a7 as StaticHandlerContext, bF as ServerRouteModule, s as MiddlewareEnabled, c as RouterContextProvider, t as AppLoadContext, an as LoaderFunctionArgs, ae as ActionFunctionArgs, aw as unstable_ServerInstrumentation, al as HTMLFormMethod, aj as FormEncType, y as RelativeRoutingType, bh as PageLinkDescriptor, T as To, bG as History, a6 as GetScrollRestorationKeyFunction, e as RouterInit, bH as FutureConfig$1, u as unstable_ClientInstrumentation, r as DataStrategyFunction, a2 as PatchRoutesOnNavigationFunction, v as NavigateOptions, a8 as Fetcher, Q as RouteObject, p as Router, x as SerializeFrom, B as BlockerFunction, L as Location, bI as CreateStaticHandlerOptions$1, a4 as StaticHandler } from './router-Dgz_Mh9m.mjs';
2
2
  import * as React from 'react';
3
3
 
4
4
  interface Route {
@@ -1122,6 +1122,21 @@ interface BrowserRouterProps {
1122
1122
  * {@link Route | `<Route>`} components describing your route configuration
1123
1123
  */
1124
1124
  children?: React.ReactNode;
1125
+ /**
1126
+ * Control whether router state updates are internally wrapped in
1127
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition).
1128
+ *
1129
+ * - When left `undefined`, all router state updates are wrapped in
1130
+ * `React.startTransition`
1131
+ * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1132
+ * in `React.startTransition` and all router state updates are wrapped in
1133
+ * `React.startTransition`
1134
+ * - When set to `false`, the router will not leverage `React.startTransition`
1135
+ * on any navigations or state changes.
1136
+ *
1137
+ * For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
1138
+ */
1139
+ unstable_useTransitions?: boolean;
1125
1140
  /**
1126
1141
  * [`Window`](https://developer.mozilla.org/en-US/docs/Web/API/Window) object
1127
1142
  * override. Defaults to the global `window` instance
@@ -1138,11 +1153,12 @@ interface BrowserRouterProps {
1138
1153
  * @param props Props
1139
1154
  * @param {BrowserRouterProps.basename} props.basename n/a
1140
1155
  * @param {BrowserRouterProps.children} props.children n/a
1156
+ * @param {BrowserRouterProps.unstable_useTransitions} props.unstable_useTransitions n/a
1141
1157
  * @param {BrowserRouterProps.window} props.window n/a
1142
1158
  * @returns A declarative {@link Router | `<Router>`} using the browser [`History`](https://developer.mozilla.org/en-US/docs/Web/API/History)
1143
1159
  * API for client-side routing.
1144
1160
  */
1145
- declare function BrowserRouter({ basename, children, window, }: BrowserRouterProps): React.JSX.Element;
1161
+ declare function BrowserRouter({ basename, children, unstable_useTransitions, window, }: BrowserRouterProps): React.JSX.Element;
1146
1162
  /**
1147
1163
  * @category Types
1148
1164
  */
@@ -1155,6 +1171,21 @@ interface HashRouterProps {
1155
1171
  * {@link Route | `<Route>`} components describing your route configuration
1156
1172
  */
1157
1173
  children?: React.ReactNode;
1174
+ /**
1175
+ * Control whether router state updates are internally wrapped in
1176
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition).
1177
+ *
1178
+ * - When left `undefined`, all router state updates are wrapped in
1179
+ * `React.startTransition`
1180
+ * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1181
+ * in `React.startTransition` and all router state updates are wrapped in
1182
+ * `React.startTransition`
1183
+ * - When set to `false`, the router will not leverage `React.startTransition`
1184
+ * on any navigations or state changes.
1185
+ *
1186
+ * For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
1187
+ */
1188
+ unstable_useTransitions?: boolean;
1158
1189
  /**
1159
1190
  * [`Window`](https://developer.mozilla.org/en-US/docs/Web/API/Window) object
1160
1191
  * override. Defaults to the global `window` instance
@@ -1172,11 +1203,12 @@ interface HashRouterProps {
1172
1203
  * @param props Props
1173
1204
  * @param {HashRouterProps.basename} props.basename n/a
1174
1205
  * @param {HashRouterProps.children} props.children n/a
1206
+ * @param {HashRouterProps.unstable_useTransitions} props.unstable_useTransitions n/a
1175
1207
  * @param {HashRouterProps.window} props.window n/a
1176
1208
  * @returns A declarative {@link Router | `<Router>`} using the URL [`hash`](https://developer.mozilla.org/en-US/docs/Web/API/URL/hash)
1177
1209
  * for client-side routing.
1178
1210
  */
1179
- declare function HashRouter({ basename, children, window }: HashRouterProps): React.JSX.Element;
1211
+ declare function HashRouter({ basename, children, unstable_useTransitions, window, }: HashRouterProps): React.JSX.Element;
1180
1212
  /**
1181
1213
  * @category Types
1182
1214
  */
@@ -1193,6 +1225,21 @@ interface HistoryRouterProps {
1193
1225
  * A {@link History} implementation for use by the router
1194
1226
  */
1195
1227
  history: History;
1228
+ /**
1229
+ * Control whether router state updates are internally wrapped in
1230
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition).
1231
+ *
1232
+ * - When left `undefined`, all router state updates are wrapped in
1233
+ * `React.startTransition`
1234
+ * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1235
+ * in `React.startTransition` and all router state updates are wrapped in
1236
+ * `React.startTransition`
1237
+ * - When set to `false`, the router will not leverage `React.startTransition`
1238
+ * on any navigations or state changes.
1239
+ *
1240
+ * For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
1241
+ */
1242
+ unstable_useTransitions?: boolean;
1196
1243
  }
1197
1244
  /**
1198
1245
  * A declarative {@link Router | `<Router>`} that accepts a pre-instantiated
@@ -1209,10 +1256,11 @@ interface HistoryRouterProps {
1209
1256
  * @param {HistoryRouterProps.basename} props.basename n/a
1210
1257
  * @param {HistoryRouterProps.children} props.children n/a
1211
1258
  * @param {HistoryRouterProps.history} props.history n/a
1259
+ * @param {HistoryRouterProps.unstable_useTransitions} props.unstable_useTransitions n/a
1212
1260
  * @returns A declarative {@link Router | `<Router>`} using the provided history
1213
1261
  * implementation for client-side routing.
1214
1262
  */
1215
- declare function HistoryRouter({ basename, children, history, }: HistoryRouterProps): React.JSX.Element;
1263
+ declare function HistoryRouter({ basename, children, history, unstable_useTransitions, }: HistoryRouterProps): React.JSX.Element;
1216
1264
  declare namespace HistoryRouter {
1217
1265
  var displayName: string;
1218
1266
  }
@@ -1830,15 +1878,19 @@ declare namespace ScrollRestoration {
1830
1878
  * @param options.viewTransition Enables a [View Transition](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API)
1831
1879
  * for this navigation. To apply specific styles during the transition, see
1832
1880
  * {@link useViewTransitionState}. Defaults to `false`.
1881
+ * @param options.unstable_useTransitions Wraps the navigation in
1882
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition)
1883
+ * for concurrent rendering. Defaults to `false`.
1833
1884
  * @returns A click handler function that can be used in a custom {@link Link} component.
1834
1885
  */
1835
- declare function useLinkClickHandler<E extends Element = HTMLAnchorElement>(to: To, { target, replace: replaceProp, state, preventScrollReset, relative, viewTransition, }?: {
1886
+ declare function useLinkClickHandler<E extends Element = HTMLAnchorElement>(to: To, { target, replace: replaceProp, state, preventScrollReset, relative, viewTransition, unstable_useTransitions, }?: {
1836
1887
  target?: React.HTMLAttributeAnchorTarget;
1837
1888
  replace?: boolean;
1838
1889
  state?: any;
1839
1890
  preventScrollReset?: boolean;
1840
1891
  relative?: RelativeRoutingType;
1841
1892
  viewTransition?: boolean;
1893
+ unstable_useTransitions?: boolean;
1842
1894
  }): (event: React.MouseEvent<E, MouseEvent>) => void;
1843
1895
  /**
1844
1896
  * Returns a tuple of the current URL's [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams)
@@ -2167,7 +2219,7 @@ type FetcherWithComponents<TData> = Fetcher<TData> & {
2167
2219
  * @param reason Optional `reason` to provide to [`AbortController.abort()`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)
2168
2220
  * @returns void
2169
2221
  */
2170
- unstable_reset: (opts?: {
2222
+ reset: (opts?: {
2171
2223
  reason?: unknown;
2172
2224
  }) => void;
2173
2225
  /**
@@ -2256,7 +2308,7 @@ type FetcherWithComponents<TData> = Fetcher<TData> & {
2256
2308
  * })
2257
2309
  *
2258
2310
  * // reset fetcher
2259
- * fetcher.unstable_reset()
2311
+ * fetcher.reset()
2260
2312
  * }
2261
2313
  *
2262
2314
  * @public
@@ -1,3 +1,3 @@
1
- export { b2 as MemoryRouter, b3 as Navigate, b4 as Outlet, b5 as Route, b6 as Router, b7 as RouterProvider, b8 as Routes, aR as UNSAFE_AwaitContextProvider, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps } from './router-CAvh_Drx.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-rcoGPJhU.mjs';
1
+ export { b2 as MemoryRouter, b3 as Navigate, b4 as Outlet, b5 as Route, b6 as Router, b7 as RouterProvider, b8 as Routes, aR as UNSAFE_AwaitContextProvider, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps } from './router-Dgz_Mh9m.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-DYtvZPLT.mjs';
3
3
  import 'react';
@@ -1,3 +1,3 @@
1
- export { b2 as MemoryRouter, b3 as Navigate, b4 as Outlet, b5 as Route, b6 as Router, b7 as RouterProvider, b8 as Routes, aP as UNSAFE_AwaitContextProvider, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps } from './instrumentation-Unc20tLk.js';
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-Da3kmxNd.js';
1
+ export { b2 as MemoryRouter, b3 as Navigate, b4 as Outlet, b5 as Route, b6 as Router, b7 as RouterProvider, b8 as Routes, aP as UNSAFE_AwaitContextProvider, by as UNSAFE_WithComponentProps, bC as UNSAFE_WithErrorBoundaryProps, bA as UNSAFE_WithHydrateFallbackProps } from './instrumentation-Dwf-sTWa.js';
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-CNrKUHDv.js';
3
3
  import 'react';
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});/**
2
- * react-router v7.9.6
2
+ * react-router v7.10.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -19,7 +19,7 @@
19
19
 
20
20
 
21
21
 
22
- var _chunkQN64DHI4js = require('./chunk-QN64DHI4.js');
22
+ var _chunk5DTJHKF7js = require('./chunk-5DTJHKF7.js');
23
23
 
24
24
 
25
25
 
@@ -34,7 +34,7 @@ var _chunkQN64DHI4js = require('./chunk-QN64DHI4.js');
34
34
 
35
35
 
36
36
 
37
- var _chunkEAIF67OWjs = require('./chunk-EAIF67OW.js');
37
+ var _chunk55FFLVQPjs = require('./chunk-55FFLVQP.js');
38
38
 
39
39
 
40
40
 
@@ -58,4 +58,4 @@ var _chunkEAIF67OWjs = require('./chunk-EAIF67OW.js');
58
58
 
59
59
 
60
60
 
61
- exports.BrowserRouter = _chunkQN64DHI4js.BrowserRouter; exports.Form = _chunkQN64DHI4js.Form; exports.HashRouter = _chunkQN64DHI4js.HashRouter; exports.Link = _chunkQN64DHI4js.Link; exports.Links = _chunkEAIF67OWjs.Links; exports.MemoryRouter = _chunkEAIF67OWjs.MemoryRouter; exports.Meta = _chunkEAIF67OWjs.Meta; exports.NavLink = _chunkQN64DHI4js.NavLink; exports.Navigate = _chunkEAIF67OWjs.Navigate; exports.Outlet = _chunkEAIF67OWjs.Outlet; exports.Route = _chunkEAIF67OWjs.Route; exports.Router = _chunkEAIF67OWjs.Router; exports.RouterProvider = _chunkEAIF67OWjs.RouterProvider; exports.Routes = _chunkEAIF67OWjs.Routes; exports.ScrollRestoration = _chunkQN64DHI4js.ScrollRestoration; exports.StaticRouter = _chunkQN64DHI4js.StaticRouter; exports.StaticRouterProvider = _chunkQN64DHI4js.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunkEAIF67OWjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunkEAIF67OWjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunkEAIF67OWjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunkEAIF67OWjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunkQN64DHI4js.HistoryRouter;
61
+ exports.BrowserRouter = _chunk5DTJHKF7js.BrowserRouter; exports.Form = _chunk5DTJHKF7js.Form; exports.HashRouter = _chunk5DTJHKF7js.HashRouter; exports.Link = _chunk5DTJHKF7js.Link; exports.Links = _chunk55FFLVQPjs.Links; exports.MemoryRouter = _chunk55FFLVQPjs.MemoryRouter; exports.Meta = _chunk55FFLVQPjs.Meta; exports.NavLink = _chunk5DTJHKF7js.NavLink; exports.Navigate = _chunk55FFLVQPjs.Navigate; exports.Outlet = _chunk55FFLVQPjs.Outlet; exports.Route = _chunk55FFLVQPjs.Route; exports.Router = _chunk55FFLVQPjs.Router; exports.RouterProvider = _chunk55FFLVQPjs.RouterProvider; exports.Routes = _chunk55FFLVQPjs.Routes; exports.ScrollRestoration = _chunk5DTJHKF7js.ScrollRestoration; exports.StaticRouter = _chunk5DTJHKF7js.StaticRouter; exports.StaticRouterProvider = _chunk5DTJHKF7js.StaticRouterProvider; exports.UNSAFE_AwaitContextProvider = _chunk55FFLVQPjs.AwaitContextProvider; exports.UNSAFE_WithComponentProps = _chunk55FFLVQPjs.WithComponentProps; exports.UNSAFE_WithErrorBoundaryProps = _chunk55FFLVQPjs.WithErrorBoundaryProps; exports.UNSAFE_WithHydrateFallbackProps = _chunk55FFLVQPjs.WithHydrateFallbackProps; exports.unstable_HistoryRouter = _chunk5DTJHKF7js.HistoryRouter;