react-router 7.10.1-pre.0 → 7.11.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 +30 -2
  2. package/dist/development/{browser-BpxEZgZC.d.ts → browser-Cv4JZyZ5.d.mts} +4 -3
  3. package/dist/{production/browser-BpxEZgZC.d.ts → development/browser-o-qhcuhA.d.ts} +4 -3
  4. package/dist/{production/chunk-7NETFFGG.js → development/chunk-JKMHOZYW.js} +111 -121
  5. package/dist/development/{chunk-SC4UA6B4.mjs → chunk-KRMLYMWA.mjs} +231 -74
  6. package/dist/development/{chunk-VPK5G3S4.js → chunk-OVG6YSZ5.js} +7 -7
  7. package/dist/development/{chunk-X3LLUSK4.mjs → chunk-QMKP6CC3.mjs} +147 -38
  8. package/dist/development/{chunk-BFZIIKOS.js → chunk-UO7KGW2U.js} +279 -110
  9. package/dist/development/dom-export.d.mts +11 -10
  10. package/dist/development/dom-export.d.ts +12 -11
  11. package/dist/development/dom-export.js +30 -31
  12. package/dist/development/dom-export.mjs +6 -7
  13. package/dist/{production/index-react-server-client-CCjKYJTH.d.ts → development/index-react-server-client-Cv5Q9lf0.d.ts} +60 -14
  14. package/dist/development/{index-react-server-client-CipGfVBI.d.mts → index-react-server-client-P7VgYu6T.d.mts} +60 -14
  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 +4 -2
  20. package/dist/development/index-react-server.d.ts +4 -2
  21. package/dist/development/index-react-server.js +72 -19
  22. package/dist/development/index-react-server.mjs +72 -19
  23. package/dist/development/index.d.mts +17 -16
  24. package/dist/development/index.d.ts +17 -16
  25. package/dist/development/index.js +220 -111
  26. package/dist/development/index.mjs +3 -3
  27. package/dist/{production/instrumentation-BB0wRuqz.d.ts → development/instrumentation-BlrVzjbg.d.ts} +30 -15
  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-ODDAAYlf.d.ts → register-BGQUMCK4.d.ts} +1 -1
  33. package/dist/development/{register-C1RwVJAt.d.mts → register-DTJJbt1o.d.mts} +1 -1
  34. package/dist/development/{router-CwNp5l9u.d.mts → router-5fbeEIMQ.d.mts} +30 -15
  35. package/dist/{development/browser-C5z6FZmz.d.mts → production/browser-Cv4JZyZ5.d.mts} +4 -3
  36. package/dist/production/{browser-C5z6FZmz.d.mts → browser-o-qhcuhA.d.ts} +4 -3
  37. package/dist/production/{chunk-322RSYEJ.js → chunk-AO22ZXHI.js} +279 -110
  38. package/dist/production/{chunk-FI4GMOFC.mjs → chunk-IDHO4Q57.mjs} +231 -74
  39. package/dist/production/{chunk-KT4GS4WF.mjs → chunk-J4JITZ76.mjs} +147 -38
  40. package/dist/{development/chunk-NUGUL5OD.js → production/chunk-M5W3Q3T5.js} +111 -121
  41. package/dist/production/{chunk-3WZYQEC5.js → chunk-YGB3JEIP.js} +7 -7
  42. package/dist/production/dom-export.d.mts +11 -10
  43. package/dist/production/dom-export.d.ts +12 -11
  44. package/dist/production/dom-export.js +30 -31
  45. package/dist/production/dom-export.mjs +6 -7
  46. package/dist/{development/index-react-server-client-CCjKYJTH.d.ts → production/index-react-server-client-Cv5Q9lf0.d.ts} +60 -14
  47. package/dist/production/{index-react-server-client-CipGfVBI.d.mts → index-react-server-client-P7VgYu6T.d.mts} +60 -14
  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 +4 -2
  53. package/dist/production/index-react-server.d.ts +4 -2
  54. package/dist/production/index-react-server.js +72 -19
  55. package/dist/production/index-react-server.mjs +72 -19
  56. package/dist/production/index.d.mts +17 -16
  57. package/dist/production/index.d.ts +17 -16
  58. package/dist/production/index.js +220 -111
  59. package/dist/production/index.mjs +3 -3
  60. package/dist/{development/instrumentation-BB0wRuqz.d.ts → production/instrumentation-BlrVzjbg.d.ts} +30 -15
  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-ODDAAYlf.d.ts → register-BGQUMCK4.d.ts} +1 -1
  66. package/dist/production/{register-C1RwVJAt.d.mts → register-DTJJbt1o.d.mts} +1 -1
  67. package/dist/production/{router-CwNp5l9u.d.mts → router-5fbeEIMQ.d.mts} +30 -15
  68. package/package.json +5 -4
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.10.1-pre.0
2
+ * react-router v7.11.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -28,7 +28,7 @@ import {
28
28
  isSession,
29
29
  routeRSCServerRequest,
30
30
  setDevServerHooks
31
- } from "./chunk-KT4GS4WF.mjs";
31
+ } from "./chunk-J4JITZ76.mjs";
32
32
  import {
33
33
  Action,
34
34
  Await,
@@ -139,7 +139,7 @@ import {
139
139
  withComponentProps,
140
140
  withErrorBoundaryProps,
141
141
  withHydrateFallbackProps
142
- } from "./chunk-FI4GMOFC.mjs";
142
+ } from "./chunk-IDHO4Q57.mjs";
143
143
  export {
144
144
  Await,
145
145
  BrowserRouter,
@@ -1440,6 +1440,7 @@ type BaseNavigateOrFetchOptions = {
1440
1440
  preventScrollReset?: boolean;
1441
1441
  relative?: RelativeRoutingType;
1442
1442
  flushSync?: boolean;
1443
+ unstable_defaultShouldRevalidate?: boolean;
1443
1444
  };
1444
1445
  type BaseNavigateOptions = BaseNavigateOrFetchOptions & {
1445
1446
  replace?: boolean;
@@ -1778,7 +1779,7 @@ declare function createMemoryRouter(routes: RouteObject[], opts?: MemoryRouterOp
1778
1779
  * Function signature for client side error handling for loader/actions errors
1779
1780
  * and rendering errors via `componentDidCatch`
1780
1781
  */
1781
- interface unstable_ClientOnErrorFunction {
1782
+ interface ClientOnErrorFunction {
1782
1783
  (error: unknown, info: {
1783
1784
  location: Location;
1784
1785
  params: Params;
@@ -1805,9 +1806,9 @@ interface RouterProviderProps {
1805
1806
  */
1806
1807
  flushSync?: (fn: () => unknown) => undefined;
1807
1808
  /**
1808
- * An error handler function that will be called for any loader/action/render
1809
- * errors that are encountered in your application. This is useful for
1810
- * logging or reporting errors instead of the `ErrorBoundary` because it's not
1809
+ * An error handler function that will be called for any middleware, loader, action,
1810
+ * or render errors that are encountered in your application. This is useful for
1811
+ * logging or reporting errors instead of in the {@link ErrorBoundary} because it's not
1811
1812
  * subject to re-rendering and will only run one time per error.
1812
1813
  *
1813
1814
  * The `errorInfo` parameter is passed along from
@@ -1815,13 +1816,14 @@ interface RouterProviderProps {
1815
1816
  * and is only present for render errors.
1816
1817
  *
1817
1818
  * ```tsx
1818
- * <RouterProvider unstable_onError=(error, errorInfo) => {
1819
- * console.error(error, errorInfo);
1820
- * reportToErrorService(error, errorInfo);
1819
+ * <RouterProvider onError=(error, info) => {
1820
+ * let { location, params, unstable_pattern, errorInfo } = info;
1821
+ * console.error(error, location, errorInfo);
1822
+ * reportToErrorService(error, location, errorInfo);
1821
1823
  * }} />
1822
1824
  * ```
1823
1825
  */
1824
- unstable_onError?: unstable_ClientOnErrorFunction;
1826
+ onError?: ClientOnErrorFunction;
1825
1827
  /**
1826
1828
  * Control whether router state updates are internally wrapped in
1827
1829
  * [`React.startTransition`](https://react.dev/reference/react/startTransition).
@@ -1869,12 +1871,12 @@ interface RouterProviderProps {
1869
1871
  * @mode data
1870
1872
  * @param props Props
1871
1873
  * @param {RouterProviderProps.flushSync} props.flushSync n/a
1872
- * @param {RouterProviderProps.unstable_onError} props.unstable_onError n/a
1874
+ * @param {RouterProviderProps.onError} props.onError n/a
1873
1875
  * @param {RouterProviderProps.router} props.router n/a
1874
1876
  * @param {RouterProviderProps.unstable_useTransitions} props.unstable_useTransitions n/a
1875
1877
  * @returns React element for the rendered router
1876
1878
  */
1877
- declare function RouterProvider({ router, flushSync: reactDomFlushSyncImpl, unstable_onError, unstable_useTransitions, }: RouterProviderProps): React.ReactElement;
1879
+ declare function RouterProvider({ router, flushSync: reactDomFlushSyncImpl, onError, unstable_useTransitions, }: RouterProviderProps): React.ReactElement;
1878
1880
  /**
1879
1881
  * @category Types
1880
1882
  */
@@ -2280,9 +2282,20 @@ interface RouterProps {
2280
2282
  */
2281
2283
  static?: boolean;
2282
2284
  /**
2283
- * Whether this router should wrap navigations in `React.startTransition()`
2285
+ * Control whether router state updates are internally wrapped in
2286
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition).
2287
+ *
2288
+ * - When left `undefined`, all router state updates are wrapped in
2289
+ * `React.startTransition`
2290
+ * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
2291
+ * in `React.startTransition` and all router state updates are wrapped in
2292
+ * `React.startTransition`
2293
+ * - When set to `false`, the router will not leverage `React.startTransition`
2294
+ * on any navigations or state changes.
2295
+ *
2296
+ * For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
2284
2297
  */
2285
- unstable_useTransitions: boolean;
2298
+ unstable_useTransitions?: boolean;
2286
2299
  }
2287
2300
  /**
2288
2301
  * Provides location context for the rest of the app.
@@ -2652,7 +2665,7 @@ type PatchRoutesOnNavigationFunction = AgnosticPatchRoutesOnNavigationFunction<R
2652
2665
  interface DataRouterContextObject extends Omit<NavigationContextObject, "future" | "unstable_useTransitions"> {
2653
2666
  router: Router$1;
2654
2667
  staticContext?: StaticHandlerContext;
2655
- unstable_onError?: unstable_ClientOnErrorFunction;
2668
+ onError?: ClientOnErrorFunction;
2656
2669
  }
2657
2670
  declare const DataRouterContext: React.Context<DataRouterContextObject | null>;
2658
2671
  declare const DataRouterStateContext: React.Context<RouterState | null>;
@@ -2682,6 +2695,8 @@ interface NavigateOptions {
2682
2695
  flushSync?: boolean;
2683
2696
  /** Enables a {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API View Transition} for this navigation by wrapping the final state update in `document.startViewTransition()`. If you need to apply specific styles for this view transition, you will also need to leverage the {@link https://api.reactrouter.com/v7/functions/react_router.useViewTransitionState.html useViewTransitionState()} hook. */
2684
2697
  viewTransition?: boolean;
2698
+ /** Specifies the default revalidation behavior after this submission */
2699
+ unstable_defaultShouldRevalidate?: boolean;
2685
2700
  }
2686
2701
  /**
2687
2702
  * A Navigator is a "location changer"; it's how you get to different locations.
@@ -2703,7 +2718,7 @@ interface NavigationContextObject {
2703
2718
  basename: string;
2704
2719
  navigator: Navigator;
2705
2720
  static: boolean;
2706
- unstable_useTransitions: boolean;
2721
+ unstable_useTransitions: boolean | undefined;
2707
2722
  future: {};
2708
2723
  }
2709
2724
  declare const NavigationContext: React.Context<NavigationContextObject>;
@@ -3270,4 +3285,4 @@ type RequestHandlerInstrumentationInfo = Readonly<{
3270
3285
  context: ReadonlyContext | undefined;
3271
3286
  }>;
3272
3287
 
3273
- export { type RouterState as $, type ActionFunction as A, type BlockerFunction as B, type ClientActionFunction as C, type DataStrategyResult as D, type PathMatch as E, type Func as F, type GetLoaderData as G, type HeadersFunction as H, type Navigation as I, Action as J, type RouteObject as K, type Location as L, type MetaFunction as M, type Normalize as N, type InitialEntry as O, type Params as P, type HydrationState as Q, type RouteModule$1 as R, type ShouldRevalidateFunction as S, type To as T, type UIMatch as U, type IndexRouteObject as V, type RouteComponentType as W, type HydrateFallbackType as X, type ErrorBoundaryType as Y, type NonIndexRouteObject as Z, type Equal as _, type ClientLoaderFunction as a, type RouterProviderProps as a$, type PatchRoutesOnNavigationFunction as a0, type DataRouteObject as a1, type StaticHandler as a2, type GetScrollPositionFunction as a3, type GetScrollRestorationKeyFunction as a4, type StaticHandlerContext as a5, type Fetcher as a6, type NavigationStates as a7, type RouterSubscriber as a8, type RouterNavigateOptions as a9, IDLE_FETCHER as aA, IDLE_BLOCKER as aB, data as aC, generatePath as aD, isRouteErrorResponse as aE, matchPath as aF, matchRoutes as aG, redirect as aH, redirectDocument as aI, replace as aJ, resolvePath as aK, type DataRouteMatch as aL, type Navigator as aM, type PatchRoutesOnNavigationFunctionArgs as aN, type RouteMatch as aO, AwaitContextProvider as aP, type AwaitProps as aQ, type IndexRouteProps as aR, type unstable_ClientOnErrorFunction as aS, type LayoutRouteProps as aT, type MemoryRouterOpts as aU, type MemoryRouterProps as aV, type NavigateProps as aW, type OutletProps as aX, type PathRouteProps as aY, type RouteProps as aZ, type RouterProps as a_, type RouterFetchOptions as aa, type RevalidationState as ab, type ActionFunctionArgs as ac, type DataStrategyFunctionArgs as ad, type DataStrategyMatch as ae, DataWithResponseInit as af, type ErrorResponse as ag, type FormEncType as ah, type FormMethod as ai, type HTMLFormMethod as aj, type LazyRouteFunction as ak, type LoaderFunctionArgs as al, type MiddlewareFunction as am, type PathParam as an, type RedirectFunction as ao, type RouterContext as ap, type ShouldRevalidateFunctionArgs as aq, createContext as ar, createPath as as, parsePath as at, type unstable_ServerInstrumentation as au, type unstable_InstrumentRequestHandlerFunction as av, type unstable_InstrumentRouterFunction as aw, type unstable_InstrumentRouteFunction as ax, type unstable_InstrumentationHandlerResult as ay, IDLE_NAVIGATION as az, type LinksFunction as b, type RoutesProps as b0, Await as b1, MemoryRouter as b2, Navigate as b3, Outlet as b4, Route as b5, Router as b6, RouterProvider as b7, Routes as b8, createMemoryRouter as b9, WithHydrateFallbackProps as bA, withHydrateFallbackProps as bB, WithErrorBoundaryProps as bC, withErrorBoundaryProps as bD, type RouteManifest as bE, type ServerRouteModule as bF, type History as bG, type FutureConfig as bH, type CreateStaticHandlerOptions as bI, createRoutesFromChildren as ba, createRoutesFromElements as bb, renderMatches as bc, type ClientActionFunctionArgs as bd, type ClientLoaderFunctionArgs as be, type HeadersArgs as bf, type MetaArgs as bg, type PageLinkDescriptor as bh, type HtmlLinkDescriptor as bi, type Future as bj, type unstable_SerializesTo as bk, createBrowserHistory as bl, invariant as bm, createRouter as bn, ErrorResponseImpl as bo, DataRouterContext as bp, DataRouterStateContext as bq, FetchersContext as br, LocationContext as bs, NavigationContext as bt, RouteContext as bu, ViewTransitionContext as bv, hydrationRouteProperties as bw, mapRouteProperties as bx, WithComponentProps as by, withComponentProps as bz, RouterContextProvider as c, type LoaderFunction as d, type RouterInit as e, type LinkDescriptor as f, type Pretty as g, type MetaDescriptor as h, type ServerDataFunctionArgs as i, type MiddlewareNextFunction as j, type ClientDataFunctionArgs as k, type ServerDataFrom as l, type GetActionData as m, type Router$1 as n, type RouteModules as o, type DataStrategyFunction as p, type MiddlewareEnabled as q, type AppLoadContext as r, type NavigateOptions as s, type Blocker as t, type unstable_ClientInstrumentation as u, type SerializeFrom as v, type RelativeRoutingType as w, type ParamParseKey as x, type Path as y, type PathPattern as z };
3288
+ export { type RouterState as $, type ActionFunction as A, type BlockerFunction as B, type ClientActionFunction as C, type DataStrategyResult as D, type PathMatch as E, type Func as F, type GetLoaderData as G, type HeadersFunction as H, type Navigation as I, Action as J, type RouteObject as K, type Location as L, type MetaFunction as M, type Normalize as N, type InitialEntry as O, type Params as P, type HydrationState as Q, type RouteModule$1 as R, type ShouldRevalidateFunction as S, type To as T, type UIMatch as U, type IndexRouteObject as V, type RouteComponentType as W, type HydrateFallbackType as X, type ErrorBoundaryType as Y, type NonIndexRouteObject as Z, type Equal as _, type ClientLoaderFunction as a, type RouterProviderProps as a$, type PatchRoutesOnNavigationFunction as a0, type DataRouteObject as a1, type StaticHandler as a2, type GetScrollPositionFunction as a3, type GetScrollRestorationKeyFunction as a4, type StaticHandlerContext as a5, type Fetcher as a6, type NavigationStates as a7, type RouterSubscriber as a8, type RouterNavigateOptions as a9, IDLE_FETCHER as aA, IDLE_BLOCKER as aB, data as aC, generatePath as aD, isRouteErrorResponse as aE, matchPath as aF, matchRoutes as aG, redirect as aH, redirectDocument as aI, replace as aJ, resolvePath as aK, type DataRouteMatch as aL, type Navigator as aM, type PatchRoutesOnNavigationFunctionArgs as aN, type RouteMatch as aO, AwaitContextProvider as aP, type AwaitProps as aQ, type IndexRouteProps as aR, type ClientOnErrorFunction as aS, type LayoutRouteProps as aT, type MemoryRouterOpts as aU, type MemoryRouterProps as aV, type NavigateProps as aW, type OutletProps as aX, type PathRouteProps as aY, type RouteProps as aZ, type RouterProps as a_, type RouterFetchOptions as aa, type RevalidationState as ab, type ActionFunctionArgs as ac, type DataStrategyFunctionArgs as ad, type DataStrategyMatch as ae, DataWithResponseInit as af, type ErrorResponse as ag, type FormEncType as ah, type FormMethod as ai, type HTMLFormMethod as aj, type LazyRouteFunction as ak, type LoaderFunctionArgs as al, type MiddlewareFunction as am, type PathParam as an, type RedirectFunction as ao, type RouterContext as ap, type ShouldRevalidateFunctionArgs as aq, createContext as ar, createPath as as, parsePath as at, type unstable_ServerInstrumentation as au, type unstable_InstrumentRequestHandlerFunction as av, type unstable_InstrumentRouterFunction as aw, type unstable_InstrumentRouteFunction as ax, type unstable_InstrumentationHandlerResult as ay, IDLE_NAVIGATION as az, type LinksFunction as b, type RoutesProps as b0, Await as b1, MemoryRouter as b2, Navigate as b3, Outlet as b4, Route as b5, Router as b6, RouterProvider as b7, Routes as b8, createMemoryRouter as b9, WithHydrateFallbackProps as bA, withHydrateFallbackProps as bB, WithErrorBoundaryProps as bC, withErrorBoundaryProps as bD, type RouteManifest as bE, type ServerRouteModule as bF, type History as bG, type FutureConfig as bH, type CreateStaticHandlerOptions as bI, createRoutesFromChildren as ba, createRoutesFromElements as bb, renderMatches as bc, type ClientActionFunctionArgs as bd, type ClientLoaderFunctionArgs as be, type HeadersArgs as bf, type MetaArgs as bg, type PageLinkDescriptor as bh, type HtmlLinkDescriptor as bi, type Future as bj, type unstable_SerializesTo as bk, createBrowserHistory as bl, invariant as bm, createRouter as bn, ErrorResponseImpl as bo, DataRouterContext as bp, DataRouterStateContext as bq, FetchersContext as br, LocationContext as bs, NavigationContext as bt, RouteContext as bu, ViewTransitionContext as bv, hydrationRouteProperties as bw, mapRouteProperties as bx, WithComponentProps as by, withComponentProps as bz, RouterContextProvider as c, type LoaderFunction as d, type RouterInit as e, type LinkDescriptor as f, type Pretty as g, type MetaDescriptor as h, type ServerDataFunctionArgs as i, type MiddlewareNextFunction as j, type ClientDataFunctionArgs as k, type ServerDataFrom as l, type GetActionData as m, type Router$1 as n, type RouteModules as o, type DataStrategyFunction as p, type MiddlewareEnabled as q, type AppLoadContext as r, type NavigateOptions as s, type Blocker as t, type unstable_ClientInstrumentation as u, type SerializeFrom as v, type RelativeRoutingType as w, type ParamParseKey as x, type Path as y, type PathPattern as z };
@@ -1,5 +1,5 @@
1
- import { R as RouteModule, h as LinkDescriptor, L as Location, F as Func, i as Pretty, j as MetaDescriptor, G as GetLoaderData, k as ServerDataFunctionArgs, l as MiddlewareNextFunction, m as ClientDataFunctionArgs, D as DataStrategyResult, n as ServerDataFrom, N as Normalize, o as GetActionData } from '../../router-CwNp5l9u.mjs';
2
- import { R as RouteFiles, P as Pages } from '../../register-C1RwVJAt.mjs';
1
+ import { R as RouteModule, h as LinkDescriptor, L as Location, F as Func, i as Pretty, j as MetaDescriptor, G as GetLoaderData, k as ServerDataFunctionArgs, l as MiddlewareNextFunction, m as ClientDataFunctionArgs, D as DataStrategyResult, n as ServerDataFrom, N as Normalize, o as GetActionData } from '../../router-5fbeEIMQ.mjs';
2
+ import { R as RouteFiles, P as Pages } from '../../register-DTJJbt1o.mjs';
3
3
  import 'react';
4
4
 
5
5
  type MaybePromise<T> = T | Promise<T>;
@@ -1,5 +1,5 @@
1
- import { R as RouteModule, f as LinkDescriptor, L as Location, F as Func, g as Pretty, h as MetaDescriptor, G as GetLoaderData, i as ServerDataFunctionArgs, j as MiddlewareNextFunction, k as ClientDataFunctionArgs, D as DataStrategyResult, l as ServerDataFrom, N as Normalize, m as GetActionData } from '../../instrumentation-BB0wRuqz.js';
2
- import { R as RouteFiles, P as Pages } from '../../register-ODDAAYlf.js';
1
+ import { R as RouteModule, f as LinkDescriptor, L as Location, F as Func, g as Pretty, h as MetaDescriptor, G as GetLoaderData, i as ServerDataFunctionArgs, j as MiddlewareNextFunction, k as ClientDataFunctionArgs, D as DataStrategyResult, l as ServerDataFrom, N as Normalize, m as GetActionData } from '../../instrumentation-BlrVzjbg.js';
2
+ import { R as RouteFiles, P as Pages } from '../../register-BGQUMCK4.js';
3
3
  import 'react';
4
4
 
5
5
  type MaybePromise<T> = T | Promise<T>;
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * react-router v7.10.1-pre.0
2
+ * react-router v7.11.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.10.1-pre.0
2
+ * react-router v7.11.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { R as RouteModule } from './instrumentation-BB0wRuqz.js';
1
+ import { R as RouteModule } from './instrumentation-BlrVzjbg.js';
2
2
 
3
3
  /**
4
4
  * Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
@@ -1,4 +1,4 @@
1
- import { R as RouteModule } from './router-CwNp5l9u.mjs';
1
+ import { R as RouteModule } from './router-5fbeEIMQ.mjs';
2
2
 
3
3
  /**
4
4
  * Apps can use this interface to "register" app-wide types for React Router via interface declaration merging and module augmentation.
@@ -1215,7 +1215,7 @@ declare function createMemoryRouter(routes: RouteObject[], opts?: MemoryRouterOp
1215
1215
  * Function signature for client side error handling for loader/actions errors
1216
1216
  * and rendering errors via `componentDidCatch`
1217
1217
  */
1218
- interface unstable_ClientOnErrorFunction {
1218
+ interface ClientOnErrorFunction {
1219
1219
  (error: unknown, info: {
1220
1220
  location: Location;
1221
1221
  params: Params;
@@ -1242,9 +1242,9 @@ interface RouterProviderProps {
1242
1242
  */
1243
1243
  flushSync?: (fn: () => unknown) => undefined;
1244
1244
  /**
1245
- * An error handler function that will be called for any loader/action/render
1246
- * errors that are encountered in your application. This is useful for
1247
- * logging or reporting errors instead of the `ErrorBoundary` because it's not
1245
+ * An error handler function that will be called for any middleware, loader, action,
1246
+ * or render errors that are encountered in your application. This is useful for
1247
+ * logging or reporting errors instead of in the {@link ErrorBoundary} because it's not
1248
1248
  * subject to re-rendering and will only run one time per error.
1249
1249
  *
1250
1250
  * The `errorInfo` parameter is passed along from
@@ -1252,13 +1252,14 @@ interface RouterProviderProps {
1252
1252
  * and is only present for render errors.
1253
1253
  *
1254
1254
  * ```tsx
1255
- * <RouterProvider unstable_onError=(error, errorInfo) => {
1256
- * console.error(error, errorInfo);
1257
- * reportToErrorService(error, errorInfo);
1255
+ * <RouterProvider onError=(error, info) => {
1256
+ * let { location, params, unstable_pattern, errorInfo } = info;
1257
+ * console.error(error, location, errorInfo);
1258
+ * reportToErrorService(error, location, errorInfo);
1258
1259
  * }} />
1259
1260
  * ```
1260
1261
  */
1261
- unstable_onError?: unstable_ClientOnErrorFunction;
1262
+ onError?: ClientOnErrorFunction;
1262
1263
  /**
1263
1264
  * Control whether router state updates are internally wrapped in
1264
1265
  * [`React.startTransition`](https://react.dev/reference/react/startTransition).
@@ -1306,12 +1307,12 @@ interface RouterProviderProps {
1306
1307
  * @mode data
1307
1308
  * @param props Props
1308
1309
  * @param {RouterProviderProps.flushSync} props.flushSync n/a
1309
- * @param {RouterProviderProps.unstable_onError} props.unstable_onError n/a
1310
+ * @param {RouterProviderProps.onError} props.onError n/a
1310
1311
  * @param {RouterProviderProps.router} props.router n/a
1311
1312
  * @param {RouterProviderProps.unstable_useTransitions} props.unstable_useTransitions n/a
1312
1313
  * @returns React element for the rendered router
1313
1314
  */
1314
- declare function RouterProvider({ router, flushSync: reactDomFlushSyncImpl, unstable_onError, unstable_useTransitions, }: RouterProviderProps): React.ReactElement;
1315
+ declare function RouterProvider({ router, flushSync: reactDomFlushSyncImpl, onError, unstable_useTransitions, }: RouterProviderProps): React.ReactElement;
1315
1316
  /**
1316
1317
  * @category Types
1317
1318
  */
@@ -1717,9 +1718,20 @@ interface RouterProps {
1717
1718
  */
1718
1719
  static?: boolean;
1719
1720
  /**
1720
- * Whether this router should wrap navigations in `React.startTransition()`
1721
+ * Control whether router state updates are internally wrapped in
1722
+ * [`React.startTransition`](https://react.dev/reference/react/startTransition).
1723
+ *
1724
+ * - When left `undefined`, all router state updates are wrapped in
1725
+ * `React.startTransition`
1726
+ * - When set to `true`, {@link Link} and {@link Form} navigations will be wrapped
1727
+ * in `React.startTransition` and all router state updates are wrapped in
1728
+ * `React.startTransition`
1729
+ * - When set to `false`, the router will not leverage `React.startTransition`
1730
+ * on any navigations or state changes.
1731
+ *
1732
+ * For more information, please see the [docs](https://reactrouter.com/explanation/react-transitions).
1721
1733
  */
1722
- unstable_useTransitions: boolean;
1734
+ unstable_useTransitions?: boolean;
1723
1735
  }
1724
1736
  /**
1725
1737
  * Provides location context for the rest of the app.
@@ -2089,7 +2101,7 @@ type PatchRoutesOnNavigationFunction = AgnosticPatchRoutesOnNavigationFunction<R
2089
2101
  interface DataRouterContextObject extends Omit<NavigationContextObject, "future" | "unstable_useTransitions"> {
2090
2102
  router: Router;
2091
2103
  staticContext?: StaticHandlerContext;
2092
- unstable_onError?: unstable_ClientOnErrorFunction;
2104
+ onError?: ClientOnErrorFunction;
2093
2105
  }
2094
2106
  declare const DataRouterContext: React.Context<DataRouterContextObject | null>;
2095
2107
  declare const DataRouterStateContext: React.Context<RouterState | null>;
@@ -2119,6 +2131,8 @@ interface NavigateOptions {
2119
2131
  flushSync?: boolean;
2120
2132
  /** Enables a {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API View Transition} for this navigation by wrapping the final state update in `document.startViewTransition()`. If you need to apply specific styles for this view transition, you will also need to leverage the {@link https://api.reactrouter.com/v7/functions/react_router.useViewTransitionState.html useViewTransitionState()} hook. */
2121
2133
  viewTransition?: boolean;
2134
+ /** Specifies the default revalidation behavior after this submission */
2135
+ unstable_defaultShouldRevalidate?: boolean;
2122
2136
  }
2123
2137
  /**
2124
2138
  * A Navigator is a "location changer"; it's how you get to different locations.
@@ -2140,7 +2154,7 @@ interface NavigationContextObject {
2140
2154
  basename: string;
2141
2155
  navigator: Navigator;
2142
2156
  static: boolean;
2143
- unstable_useTransitions: boolean;
2157
+ unstable_useTransitions: boolean | undefined;
2144
2158
  future: {};
2145
2159
  }
2146
2160
  declare const NavigationContext: React.Context<NavigationContextObject>;
@@ -3078,6 +3092,7 @@ type BaseNavigateOrFetchOptions = {
3078
3092
  preventScrollReset?: boolean;
3079
3093
  relative?: RelativeRoutingType;
3080
3094
  flushSync?: boolean;
3095
+ unstable_defaultShouldRevalidate?: boolean;
3081
3096
  };
3082
3097
  type BaseNavigateOptions = BaseNavigateOrFetchOptions & {
3083
3098
  replace?: boolean;
@@ -3270,4 +3285,4 @@ interface CreateStaticHandlerOptions {
3270
3285
  future?: {};
3271
3286
  }
3272
3287
 
3273
- export { type NonIndexRouteObject as $, type ActionFunction as A, type BlockerFunction as B, type ClientActionFunction as C, type DataStrategyResult as D, type Path as E, type Func as F, type GetLoaderData as G, type HeadersFunction as H, type PathPattern as I, type PathMatch as J, type Navigation as K, type Location as L, type MetaFunction as M, type Normalize as N, Action as O, type Params as P, type RouteObject as Q, type RouteModule$1 as R, type ShouldRevalidateFunction as S, type To as T, type UIMatch as U, type InitialEntry as V, type HydrationState as W, type IndexRouteObject as X, type RouteComponentType as Y, type HydrateFallbackType as Z, type ErrorBoundaryType as _, type ClientLoaderFunction as a, type RouterProps as a$, type Equal as a0, type RouterState as a1, type PatchRoutesOnNavigationFunction as a2, type DataRouteObject as a3, type StaticHandler as a4, type GetScrollPositionFunction as a5, type GetScrollRestorationKeyFunction as a6, type StaticHandlerContext as a7, type Fetcher as a8, type NavigationStates as a9, type unstable_InstrumentationHandlerResult as aA, IDLE_NAVIGATION as aB, IDLE_FETCHER as aC, IDLE_BLOCKER as aD, data as aE, generatePath as aF, isRouteErrorResponse as aG, matchPath as aH, matchRoutes as aI, redirect as aJ, redirectDocument as aK, replace as aL, resolvePath as aM, type DataRouteMatch as aN, type Navigator as aO, type PatchRoutesOnNavigationFunctionArgs as aP, type RouteMatch as aQ, AwaitContextProvider as aR, type AwaitProps as aS, type IndexRouteProps as aT, type LayoutRouteProps as aU, type MemoryRouterOpts as aV, type MemoryRouterProps as aW, type NavigateProps as aX, type OutletProps as aY, type PathRouteProps as aZ, type RouteProps as a_, type RouterSubscriber as aa, type RouterNavigateOptions as ab, type RouterFetchOptions as ac, type RevalidationState as ad, type ActionFunctionArgs as ae, type DataStrategyFunctionArgs as af, type DataStrategyMatch as ag, DataWithResponseInit as ah, type ErrorResponse as ai, type FormEncType as aj, type FormMethod as ak, type HTMLFormMethod as al, type LazyRouteFunction as am, type LoaderFunctionArgs as an, type MiddlewareFunction as ao, type PathParam as ap, type RedirectFunction as aq, type RouterContext as ar, type ShouldRevalidateFunctionArgs as as, createContext as at, createPath as au, parsePath as av, type unstable_ServerInstrumentation as aw, type unstable_InstrumentRequestHandlerFunction as ax, type unstable_InstrumentRouterFunction as ay, type unstable_InstrumentRouteFunction as az, type LinksFunction as b, type RoutesProps as b0, Await as b1, MemoryRouter as b2, Navigate as b3, Outlet as b4, Route as b5, Router$1 as b6, RouterProvider as b7, Routes as b8, createMemoryRouter as b9, WithHydrateFallbackProps as bA, withHydrateFallbackProps as bB, WithErrorBoundaryProps as bC, withErrorBoundaryProps as bD, type RouteManifest as bE, type ServerRouteModule as bF, type History as bG, type FutureConfig as bH, type CreateStaticHandlerOptions as bI, createRoutesFromChildren as ba, createRoutesFromElements as bb, renderMatches as bc, type ClientActionFunctionArgs as bd, type ClientLoaderFunctionArgs as be, type HeadersArgs as bf, type MetaArgs as bg, type PageLinkDescriptor as bh, type HtmlLinkDescriptor as bi, type Future as bj, type unstable_SerializesTo as bk, createBrowserHistory as bl, invariant as bm, createRouter as bn, ErrorResponseImpl as bo, DataRouterContext as bp, DataRouterStateContext as bq, FetchersContext as br, LocationContext as bs, NavigationContext as bt, RouteContext as bu, ViewTransitionContext as bv, hydrationRouteProperties as bw, mapRouteProperties as bx, WithComponentProps as by, withComponentProps as bz, RouterContextProvider as c, type LoaderFunction as d, type RouterInit as e, type RouterProviderProps as f, type unstable_ClientOnErrorFunction as g, type LinkDescriptor as h, type Pretty as i, type MetaDescriptor as j, type ServerDataFunctionArgs as k, type MiddlewareNextFunction as l, type ClientDataFunctionArgs as m, type ServerDataFrom as n, type GetActionData as o, type Router as p, type RouteModules as q, type DataStrategyFunction as r, type MiddlewareEnabled as s, type AppLoadContext as t, type unstable_ClientInstrumentation as u, type NavigateOptions as v, type Blocker as w, type SerializeFrom as x, type RelativeRoutingType as y, type ParamParseKey as z };
3288
+ export { type NonIndexRouteObject as $, type ActionFunction as A, type BlockerFunction as B, type ClientActionFunction as C, type DataStrategyResult as D, type Path as E, type Func as F, type GetLoaderData as G, type HeadersFunction as H, type PathPattern as I, type PathMatch as J, type Navigation as K, type Location as L, type MetaFunction as M, type Normalize as N, Action as O, type Params as P, type RouteObject as Q, type RouteModule$1 as R, type ShouldRevalidateFunction as S, type To as T, type UIMatch as U, type InitialEntry as V, type HydrationState as W, type IndexRouteObject as X, type RouteComponentType as Y, type HydrateFallbackType as Z, type ErrorBoundaryType as _, type ClientLoaderFunction as a, type RouterProps as a$, type Equal as a0, type RouterState as a1, type PatchRoutesOnNavigationFunction as a2, type DataRouteObject as a3, type StaticHandler as a4, type GetScrollPositionFunction as a5, type GetScrollRestorationKeyFunction as a6, type StaticHandlerContext as a7, type Fetcher as a8, type NavigationStates as a9, type unstable_InstrumentationHandlerResult as aA, IDLE_NAVIGATION as aB, IDLE_FETCHER as aC, IDLE_BLOCKER as aD, data as aE, generatePath as aF, isRouteErrorResponse as aG, matchPath as aH, matchRoutes as aI, redirect as aJ, redirectDocument as aK, replace as aL, resolvePath as aM, type DataRouteMatch as aN, type Navigator as aO, type PatchRoutesOnNavigationFunctionArgs as aP, type RouteMatch as aQ, AwaitContextProvider as aR, type AwaitProps as aS, type IndexRouteProps as aT, type LayoutRouteProps as aU, type MemoryRouterOpts as aV, type MemoryRouterProps as aW, type NavigateProps as aX, type OutletProps as aY, type PathRouteProps as aZ, type RouteProps as a_, type RouterSubscriber as aa, type RouterNavigateOptions as ab, type RouterFetchOptions as ac, type RevalidationState as ad, type ActionFunctionArgs as ae, type DataStrategyFunctionArgs as af, type DataStrategyMatch as ag, DataWithResponseInit as ah, type ErrorResponse as ai, type FormEncType as aj, type FormMethod as ak, type HTMLFormMethod as al, type LazyRouteFunction as am, type LoaderFunctionArgs as an, type MiddlewareFunction as ao, type PathParam as ap, type RedirectFunction as aq, type RouterContext as ar, type ShouldRevalidateFunctionArgs as as, createContext as at, createPath as au, parsePath as av, type unstable_ServerInstrumentation as aw, type unstable_InstrumentRequestHandlerFunction as ax, type unstable_InstrumentRouterFunction as ay, type unstable_InstrumentRouteFunction as az, type LinksFunction as b, type RoutesProps as b0, Await as b1, MemoryRouter as b2, Navigate as b3, Outlet as b4, Route as b5, Router$1 as b6, RouterProvider as b7, Routes as b8, createMemoryRouter as b9, WithHydrateFallbackProps as bA, withHydrateFallbackProps as bB, WithErrorBoundaryProps as bC, withErrorBoundaryProps as bD, type RouteManifest as bE, type ServerRouteModule as bF, type History as bG, type FutureConfig as bH, type CreateStaticHandlerOptions as bI, createRoutesFromChildren as ba, createRoutesFromElements as bb, renderMatches as bc, type ClientActionFunctionArgs as bd, type ClientLoaderFunctionArgs as be, type HeadersArgs as bf, type MetaArgs as bg, type PageLinkDescriptor as bh, type HtmlLinkDescriptor as bi, type Future as bj, type unstable_SerializesTo as bk, createBrowserHistory as bl, invariant as bm, createRouter as bn, ErrorResponseImpl as bo, DataRouterContext as bp, DataRouterStateContext as bq, FetchersContext as br, LocationContext as bs, NavigationContext as bt, RouteContext as bu, ViewTransitionContext as bv, hydrationRouteProperties as bw, mapRouteProperties as bx, WithComponentProps as by, withComponentProps as bz, RouterContextProvider as c, type LoaderFunction as d, type RouterInit as e, type RouterProviderProps as f, type ClientOnErrorFunction as g, type LinkDescriptor as h, type Pretty as i, type MetaDescriptor as j, type ServerDataFunctionArgs as k, type MiddlewareNextFunction as l, type ClientDataFunctionArgs as m, type ServerDataFrom as n, type GetActionData as o, type Router as p, type RouteModules as q, type DataStrategyFunction as r, type MiddlewareEnabled as s, type AppLoadContext as t, type unstable_ClientInstrumentation as u, type NavigateOptions as v, type Blocker as w, type SerializeFrom as x, type RelativeRoutingType as y, type ParamParseKey as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router",
3
- "version": "7.10.1-pre.0",
3
+ "version": "7.11.0-pre.0",
4
4
  "description": "Declarative routing for React",
5
5
  "keywords": [
6
6
  "react",
@@ -107,6 +107,7 @@
107
107
  "build": {
108
108
  "command": "premove dist && tsup && tsup --config tsup.config.rsc.ts",
109
109
  "files": [
110
+ "../../pnpm-workspace.yaml",
110
111
  "lib/**",
111
112
  "*.ts",
112
113
  "tsconfig.json",
@@ -128,11 +129,11 @@
128
129
  "@types/set-cookie-parser": "^2.4.1",
129
130
  "jest-environment-jsdom": "^29.6.2",
130
131
  "premove": "^4.0.0",
131
- "react": "^19.1.0",
132
- "react-dom": "^19.1.0",
132
+ "react": "^19.2.3",
133
+ "react-dom": "^19.2.3",
133
134
  "react-test-renderer": "^19.1.0",
134
135
  "tsup": "^8.3.0",
135
- "typescript": "^5.1.6",
136
+ "typescript": "^5.4.5",
136
137
  "undici": "^6.19.2",
137
138
  "wireit": "0.14.9"
138
139
  },