react-router 7.6.3 → 7.7.0-pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/development/browser-BSrXyLft.d.mts +157 -0
  3. package/dist/development/chunk-6ZHKKNZG.js +1898 -0
  4. package/dist/development/{chunk-QMGIS6GS.mjs → chunk-YNUF36W5.mjs} +1483 -3019
  5. package/dist/development/chunk-YP7CIEHK.mjs +2695 -0
  6. package/dist/development/chunk-Z7T4GLA7.js +8217 -0
  7. package/dist/development/components-IaVqGBuO.d.mts +816 -0
  8. package/dist/development/dom-export.d.mts +4 -2
  9. package/dist/development/dom-export.js +64 -76
  10. package/dist/development/dom-export.mjs +17 -8
  11. package/dist/development/index-react-server-client-DOK8MfYF.d.mts +1360 -0
  12. package/dist/development/{lib-B33EY9A0.d.mts → index-react-server-client-LrDNRnlX.d.ts} +39 -5
  13. package/dist/development/index-react-server-client.d.mts +4 -0
  14. package/dist/development/index-react-server-client.d.ts +3 -0
  15. package/dist/development/index-react-server-client.js +55 -0
  16. package/dist/development/index-react-server-client.mjs +53 -0
  17. package/dist/development/index-react-server.d.mts +1863 -0
  18. package/dist/development/index-react-server.d.ts +1863 -0
  19. package/dist/development/index-react-server.js +3196 -0
  20. package/dist/development/index-react-server.mjs +3083 -0
  21. package/dist/development/index.d.mts +33 -47
  22. package/dist/development/index.d.ts +195 -2190
  23. package/dist/development/index.js +2600 -11447
  24. package/dist/development/index.mjs +33 -18
  25. package/dist/development/lib/types/internal.d.mts +2 -2
  26. package/dist/development/lib/types/internal.d.ts +2 -1
  27. package/dist/development/lib/types/internal.js +2 -20
  28. package/dist/development/lib/types/internal.mjs +1 -1
  29. package/dist/{production/register-DeIo2iHO.d.mts → development/register-DiOIlEq5.d.mts} +1 -1
  30. package/dist/development/{register-DeIo2iHO.d.mts → register-DiOIlEq5.d.ts} +1 -1
  31. package/dist/development/{route-data-D7Xbr_Ww.d.mts → route-data-7aXBQ4I3.d.ts} +26 -15
  32. package/dist/{production/route-data-D7Xbr_Ww.d.mts → development/route-data-DAw7Esur.d.mts} +16 -5
  33. package/dist/production/browser-BSrXyLft.d.mts +157 -0
  34. package/dist/production/{chunk-S4Z2UWCU.mjs → chunk-4FKAWASN.mjs} +1483 -3019
  35. package/dist/production/chunk-KZZC37RO.mjs +2695 -0
  36. package/dist/production/chunk-SH44XSL4.js +8217 -0
  37. package/dist/production/chunk-W77PDD2Y.js +1898 -0
  38. package/dist/production/components-IaVqGBuO.d.mts +816 -0
  39. package/dist/production/dom-export.d.mts +4 -2
  40. package/dist/production/dom-export.js +64 -76
  41. package/dist/production/dom-export.mjs +17 -8
  42. package/dist/production/index-react-server-client-DOK8MfYF.d.mts +1360 -0
  43. package/dist/production/{lib-B33EY9A0.d.mts → index-react-server-client-LrDNRnlX.d.ts} +39 -5
  44. package/dist/production/index-react-server-client.d.mts +4 -0
  45. package/dist/production/index-react-server-client.d.ts +3 -0
  46. package/dist/production/index-react-server-client.js +55 -0
  47. package/dist/production/index-react-server-client.mjs +53 -0
  48. package/dist/production/index-react-server.d.mts +1863 -0
  49. package/dist/production/index-react-server.d.ts +1863 -0
  50. package/dist/production/index-react-server.js +3196 -0
  51. package/dist/production/index-react-server.mjs +3083 -0
  52. package/dist/production/index.d.mts +33 -47
  53. package/dist/production/index.d.ts +195 -2190
  54. package/dist/production/index.js +2600 -11447
  55. package/dist/production/index.mjs +33 -18
  56. package/dist/production/lib/types/internal.d.mts +2 -2
  57. package/dist/production/lib/types/internal.d.ts +2 -1
  58. package/dist/production/lib/types/internal.js +2 -20
  59. package/dist/production/lib/types/internal.mjs +1 -1
  60. package/dist/production/register-DiOIlEq5.d.mts +24 -0
  61. package/dist/production/register-DiOIlEq5.d.ts +24 -0
  62. package/dist/production/{register-COAKzST_.d.ts → route-data-7aXBQ4I3.d.ts} +26 -38
  63. package/dist/{development/register-COAKzST_.d.ts → production/route-data-DAw7Esur.d.mts} +16 -28
  64. package/package.json +56 -11
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.6.3
2
+ * react-router v7.7.0-pre.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8,6 +8,30 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
+ "use client";
12
+ import {
13
+ RSCDefaultRootErrorBoundary,
14
+ RSCHydratedRouter,
15
+ RSCStaticRouter,
16
+ ServerMode,
17
+ ServerRouter,
18
+ createCallServer,
19
+ createCookie,
20
+ createCookieSessionStorage,
21
+ createMemorySessionStorage,
22
+ createRequestHandler,
23
+ createRoutesStub,
24
+ createSession,
25
+ createSessionStorage,
26
+ deserializeErrors,
27
+ getHydrationData,
28
+ getRSCStream,
29
+ href,
30
+ isCookie,
31
+ isSession,
32
+ routeRSCServerRequest,
33
+ setDevServerHooks
34
+ } from "./chunk-YP7CIEHK.mjs";
11
35
  import {
12
36
  Action,
13
37
  Await,
@@ -41,8 +65,6 @@ import {
41
65
  Routes,
42
66
  Scripts,
43
67
  ScrollRestoration,
44
- ServerMode,
45
- ServerRouter,
46
68
  SingleFetchRedirectSymbol,
47
69
  StaticRouter,
48
70
  StaticRouterProvider,
@@ -51,35 +73,23 @@ import {
51
73
  createBrowserRouter,
52
74
  createClientRoutes,
53
75
  createClientRoutesWithHMRRevalidationOptOut,
54
- createCookie,
55
- createCookieSessionStorage,
56
76
  createHashRouter,
57
77
  createMemoryRouter,
58
- createMemorySessionStorage,
59
78
  createPath,
60
- createRequestHandler,
61
79
  createRouter,
62
80
  createRoutesFromChildren,
63
81
  createRoutesFromElements,
64
- createRoutesStub,
65
82
  createSearchParams,
66
- createSession,
67
- createSessionStorage,
68
- createStaticHandler,
83
+ createStaticHandler2 as createStaticHandler,
69
84
  createStaticRouter,
70
85
  data,
71
86
  decodeViaTurboStream,
72
- deserializeErrors,
73
87
  generatePath,
74
- getHydrationData,
75
88
  getPatchRoutesOnNavigationFunction,
76
89
  getTurboStreamSingleFetchDataStrategy,
77
- href,
78
90
  hydrationRouteProperties,
79
91
  invariant,
80
- isCookie,
81
92
  isRouteErrorResponse,
82
- isSession,
83
93
  mapRouteProperties,
84
94
  matchPath,
85
95
  matchRoutes,
@@ -89,7 +99,6 @@ import {
89
99
  renderMatches,
90
100
  replace,
91
101
  resolvePath,
92
- setDevServerHooks,
93
102
  shouldHydrateRouteLoader,
94
103
  unstable_RouterContextProvider,
95
104
  unstable_createContext,
@@ -128,7 +137,7 @@ import {
128
137
  withComponentProps,
129
138
  withErrorBoundaryProps,
130
139
  withHydrateFallbackProps
131
- } from "./chunk-QMGIS6GS.mjs";
140
+ } from "./chunk-YNUF36W5.mjs";
132
141
  export {
133
142
  Await,
134
143
  BrowserRouter,
@@ -162,6 +171,7 @@ export {
162
171
  FrameworkContext as UNSAFE_FrameworkContext,
163
172
  LocationContext as UNSAFE_LocationContext,
164
173
  NavigationContext as UNSAFE_NavigationContext,
174
+ RSCDefaultRootErrorBoundary as UNSAFE_RSCDefaultRootErrorBoundary,
165
175
  RemixErrorBoundary as UNSAFE_RemixErrorBoundary,
166
176
  RouteContext as UNSAFE_RouteContext,
167
177
  ServerMode as UNSAFE_ServerMode,
@@ -216,8 +226,13 @@ export {
216
226
  replace,
217
227
  resolvePath,
218
228
  HistoryRouter as unstable_HistoryRouter,
229
+ RSCHydratedRouter as unstable_RSCHydratedRouter,
230
+ RSCStaticRouter as unstable_RSCStaticRouter,
219
231
  unstable_RouterContextProvider,
232
+ createCallServer as unstable_createCallServer,
220
233
  unstable_createContext,
234
+ getRSCStream as unstable_getRSCStream,
235
+ routeRSCServerRequest as unstable_routeRSCServerRequest,
221
236
  setDevServerHooks as unstable_setDevServerHooks,
222
237
  usePrompt as unstable_usePrompt,
223
238
  useActionData,
@@ -1,5 +1,5 @@
1
- import { aV as RouteModule, aD as LinkDescriptor, L as Location, aW as Pretty, aA as MetaDescriptor, aX as GetLoaderData, aY as ServerDataFunctionArgs, aZ as unstable_MiddlewareNextFunction, a_ as ClientDataFunctionArgs, a$ as ServerDataFrom, b0 as Normalize, b1 as GetActionData } from '../../route-data-D7Xbr_Ww.mjs';
2
- import { a as RouteFiles, P as Pages } from '../../register-DeIo2iHO.mjs';
1
+ import { w as RouteModule, x as LinkDescriptor, L as Location, y as Pretty, z as MetaDescriptor, G as GetLoaderData, E as ServerDataFunctionArgs, J as unstable_MiddlewareNextFunction, K as ClientDataFunctionArgs, O as ServerDataFrom, Q as Normalize, V as GetActionData } from '../../route-data-DAw7Esur.mjs';
2
+ import { R as RouteFiles, P as Pages } from '../../register-DiOIlEq5.mjs';
3
3
  import 'react';
4
4
 
5
5
  type MaybePromise<T> = T | Promise<T>;
@@ -1,4 +1,5 @@
1
- import { aX as RouteModule, aI as LinkDescriptor, i as Location, aY as Pretty, aG as MetaDescriptor, aZ as GetLoaderData, a_ as ServerDataFunctionArgs, a$ as unstable_MiddlewareNextFunction, b0 as ClientDataFunctionArgs, b1 as ServerDataFrom, b2 as RouteFiles, b3 as Normalize, _ as Pages, b4 as GetActionData } from '../../register-COAKzST_.js';
1
+ import { R as RouteModule, L as LinkDescriptor, a as Location, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, u as unstable_MiddlewareNextFunction, C as ClientDataFunctionArgs, b as ServerDataFrom, N as Normalize, c as GetActionData } from '../../route-data-7aXBQ4I3.js';
2
+ import { R as RouteFiles, P as Pages } from '../../register-DiOIlEq5.js';
2
3
  import 'react';
3
4
 
4
5
  type MaybePromise<T> = T | Promise<T>;
@@ -1,5 +1,5 @@
1
- /**
2
- * react-router v7.6.3
1
+ "use strict";/**
2
+ * react-router v7.7.0-pre.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8,21 +8,3 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- "use strict";
12
- var __defProp = Object.defineProperty;
13
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
14
- var __getOwnPropNames = Object.getOwnPropertyNames;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __copyProps = (to, from, except, desc) => {
17
- if (from && typeof from === "object" || typeof from === "function") {
18
- for (let key of __getOwnPropNames(from))
19
- if (!__hasOwnProp.call(to, key) && key !== except)
20
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
- }
22
- return to;
23
- };
24
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
-
26
- // lib/types/internal.ts
27
- var internal_exports = {};
28
- module.exports = __toCommonJS(internal_exports);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.6.3
2
+ * react-router v7.7.0-pre.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -21,4 +21,4 @@ type RouteFiles = Register extends {
21
21
  routeFiles: infer Registered extends AnyRouteFiles;
22
22
  } ? Registered : AnyRouteFiles;
23
23
 
24
- export type { Pages as P, Register as R, RouteFiles as a };
24
+ export type { Pages as P, RouteFiles as R, Register as a };
@@ -21,4 +21,4 @@ type RouteFiles = Register extends {
21
21
  routeFiles: infer Registered extends AnyRouteFiles;
22
22
  } ? Registered : AnyRouteFiles;
23
23
 
24
- export type { Pages as P, Register as R, RouteFiles as a };
24
+ export type { Pages as P, RouteFiles as R, Register as a };
@@ -1,6 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { ComponentType, ReactElement } from 'react';
3
3
 
4
+ /**
5
+ * An augmentable interface users can modify in their app-code to opt into
6
+ * future-flag-specific types
7
+ */
8
+ interface Future {
9
+ }
10
+ type MiddlewareEnabled = Future extends {
11
+ unstable_middleware: infer T extends boolean;
12
+ } ? T : false;
13
+
4
14
  /**
5
15
  * Actions represent the type of change to a location value.
6
16
  */
@@ -206,16 +216,6 @@ type UrlHistoryOptions = {
206
216
  v5Compat?: boolean;
207
217
  };
208
218
 
209
- /**
210
- * An augmentable interface users can modify in their app-code to opt into
211
- * future-flag-specific types
212
- */
213
- interface Future {
214
- }
215
- type MiddlewareEnabled = Future extends {
216
- unstable_middleware: infer T extends boolean;
217
- } ? T : false;
218
-
219
219
  type MaybePromise<T> = T | Promise<T>;
220
220
  /**
221
221
  * Map of routeId -> data returned from a loader/action/error
@@ -912,8 +912,11 @@ interface Router {
912
912
  * @param routeId The parent route id or a callback function accepting `patch`
913
913
  * to perform batch patching
914
914
  * @param children The additional children routes
915
+ * @param unstable_allowElementMutations Allow mutation or route elements on
916
+ * existing routes. Intended for RSC-usage
917
+ * only.
915
918
  */
916
- patchRoutes(routeId: string | null, children: AgnosticRouteObject[]): void;
919
+ patchRoutes(routeId: string | null, children: AgnosticRouteObject[], unstable_allowElementMutations?: boolean): void;
917
920
  /**
918
921
  * @private
919
922
  * PRIVATE - DO NOT USE
@@ -922,6 +925,13 @@ interface Router {
922
925
  * TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)
923
926
  */
924
927
  _internalSetRoutes(routes: AgnosticRouteObject[]): void;
928
+ /**
929
+ * @private
930
+ * PRIVATE - DO NOT USE
931
+ *
932
+ * Cause subscribers to re-render. This is used to force a re-render.
933
+ */
934
+ _internalSetStateDoNotUseOrYouWillBreakYourApp(state: Partial<RouterState>): void;
925
935
  /**
926
936
  * @private
927
937
  * PRIVATE - DO NOT USE
@@ -954,7 +964,7 @@ interface RouterState {
954
964
  /**
955
965
  * Current scroll position we should start at for a new view
956
966
  * - number -> scroll position to restore to
957
- * - false -> do not restore scroll at all (used during submissions)
967
+ * - false -> do not restore scroll at all (used during submissions/revalidations)
958
968
  * - null -> don't have a saved position, scroll to hash or top of page
959
969
  */
960
970
  restoreScrollPosition: number | false | null;
@@ -1045,6 +1055,7 @@ interface StaticHandler {
1045
1055
  skipRevalidation?: boolean;
1046
1056
  dataStrategy?: DataStrategyFunction<unknown>;
1047
1057
  unstable_respond?: (staticContext: StaticHandlerContext) => MaybePromise<Response>;
1058
+ unstable_stream?: (context: unstable_RouterContextProvider, query: (r: Request) => Promise<StaticHandlerContext | Response>) => MaybePromise<Response>;
1048
1059
  }): Promise<StaticHandlerContext | Response>;
1049
1060
  queryRoute(request: Request, opts?: {
1050
1061
  routeId?: string;
@@ -1245,8 +1256,8 @@ type FetcherStates<TData = any> = {
1245
1256
  type Fetcher<TData = any> = FetcherStates<TData>[keyof FetcherStates<TData>];
1246
1257
  interface BlockerBlocked {
1247
1258
  state: "blocked";
1248
- reset(): void;
1249
- proceed(): void;
1259
+ reset: () => void;
1260
+ proceed: () => void;
1250
1261
  location: Location;
1251
1262
  }
1252
1263
  interface BlockerUnblocked {
@@ -1856,4 +1867,4 @@ type _DataActionData<ServerActionData, ClientActionData> = Awaited<[
1856
1867
  IsDefined<ClientActionData>
1857
1868
  ] extends [true, true] ? ServerActionData | ClientActionData : IsDefined<ClientActionData> extends true ? ClientActionData : IsDefined<ServerActionData> extends true ? ServerActionData : undefined>;
1858
1869
 
1859
- export { type Params as $, type ActionFunction as A, type Blocker as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type DataStrategyMatch as J, type DataStrategyResult as K, type Location as L, type MetaFunction as M, type NonIndexRouteObject as N, DataWithResponseInit as O, type PatchRoutesOnNavigationFunction as P, type ErrorResponse as Q, type RouterInit as R, type StaticHandlerContext as S, type To as T, type FormEncType as U, type FormMethod as V, type HTMLFormMethod as W, type LazyRouteFunction as X, type LoaderFunctionArgs as Y, type unstable_MiddlewareFunction as Z, type ParamParseKey as _, type Router as a, type ServerDataFrom as a$, type PathMatch as a0, type PathParam as a1, type PathPattern as a2, type RedirectFunction as a3, type unstable_RouterContext as a4, type ShouldRevalidateFunction as a5, type ShouldRevalidateFunctionArgs as a6, type UIMatch as a7, unstable_createContext as a8, unstable_RouterContextProvider as a9, type MetaDescriptor as aA, type PageLinkDescriptor as aB, type HtmlLinkDescriptor as aC, type LinkDescriptor as aD, type Future as aE, type unstable_SerializesTo as aF, createBrowserHistory as aG, invariant as aH, createRouter as aI, ErrorResponseImpl as aJ, DataRouterContext as aK, DataRouterStateContext as aL, FetchersContext as aM, LocationContext as aN, NavigationContext as aO, RouteContext as aP, ViewTransitionContext as aQ, type RouteManifest as aR, type ServerRouteModule as aS, type SerializeFrom as aT, type History as aU, type RouteModule as aV, type Pretty as aW, type GetLoaderData as aX, type ServerDataFunctionArgs as aY, type unstable_MiddlewareNextFunction as aZ, type ClientDataFunctionArgs as a_, Action as aa, createPath as ab, parsePath as ac, IDLE_NAVIGATION as ad, IDLE_FETCHER as ae, IDLE_BLOCKER as af, data as ag, generatePath as ah, isRouteErrorResponse as ai, matchPath as aj, matchRoutes as ak, redirect as al, redirectDocument as am, replace as an, resolvePath as ao, type DataRouteMatch as ap, type NavigateOptions as aq, type Navigator as ar, type PatchRoutesOnNavigationFunctionArgs as as, type RouteMatch as at, type ClientActionFunction as au, type ClientActionFunctionArgs as av, type ClientLoaderFunctionArgs as aw, type HeadersArgs as ax, type HeadersFunction as ay, type MetaArgs as az, type RouteModules as b, type Normalize as b0, type GetActionData as b1, type RouteObject as c, type StaticHandler as d, type IndexRouteObject as e, type LoaderFunction as f, type LinksFunction as g, type MiddlewareEnabled as h, type AppLoadContext as i, type RouterState as j, type DataRouteObject as k, type ClientLoaderFunction as l, type Path as m, type GetScrollRestorationKeyFunction as n, type Fetcher as o, type Navigation as p, type NavigationStates as q, type RelativeRoutingType as r, type BlockerFunction as s, type RouterSubscriber as t, type unstable_InitialContext as u, type RouterNavigateOptions as v, type RouterFetchOptions as w, type RevalidationState as x, type ActionFunctionArgs as y, type DataStrategyFunctionArgs as z };
1870
+ export { type ActionFunctionArgs as $, type ActionFunction as A, type GetScrollPositionFunction as B, type ClientDataFunctionArgs as C, type DataStrategyFunction as D, type Equal as E, type GetScrollRestorationKeyFunction as F, type GetLoaderData as G, type HydrationState as H, type InitialEntry as I, type StaticHandlerContext as J, type Fetcher as K, type LinkDescriptor as L, type MetaDescriptor as M, type Normalize as N, type Navigation as O, type Pretty as P, type NavigationStates as Q, type RouteModule as R, type ServerDataFunctionArgs as S, type To as T, type RelativeRoutingType as U, type Blocker as V, type BlockerFunction as W, type RouterSubscriber as X, type RouterNavigateOptions as Y, type RouterFetchOptions as Z, type RevalidationState as _, type Location as a, type FutureConfig as a$, type DataStrategyFunctionArgs as a0, type DataStrategyMatch as a1, type DataStrategyResult as a2, DataWithResponseInit as a3, type ErrorResponse as a4, type FormEncType as a5, type FormMethod as a6, type HTMLFormMethod as a7, type LazyRouteFunction as a8, type LoaderFunctionArgs as a9, type NavigateOptions as aA, type Navigator as aB, type PatchRoutesOnNavigationFunctionArgs as aC, type RouteMatch as aD, type RouteObject as aE, type ClientActionFunctionArgs as aF, type ClientLoaderFunctionArgs as aG, type HeadersArgs as aH, type MetaArgs as aI, type PageLinkDescriptor as aJ, type HtmlLinkDescriptor as aK, type Future as aL, type unstable_SerializesTo as aM, createBrowserHistory as aN, invariant as aO, createRouter as aP, ErrorResponseImpl as aQ, DataRouterContext as aR, DataRouterStateContext as aS, FetchersContext as aT, LocationContext as aU, NavigationContext as aV, RouteContext as aW, ViewTransitionContext as aX, type RouteManifest as aY, type ServerRouteModule as aZ, type SerializeFrom as a_, type unstable_MiddlewareFunction as aa, type ParamParseKey as ab, type PathMatch as ac, type PathParam as ad, type PathPattern as ae, type RedirectFunction as af, type unstable_RouterContext as ag, type ShouldRevalidateFunctionArgs as ah, type UIMatch as ai, unstable_createContext as aj, Action as ak, createPath as al, parsePath as am, IDLE_NAVIGATION as an, IDLE_FETCHER as ao, IDLE_BLOCKER as ap, data as aq, generatePath as ar, isRouteErrorResponse as as, matchPath as at, matchRoutes as au, redirect as av, redirectDocument as aw, replace as ax, resolvePath as ay, type DataRouteMatch as az, type ServerDataFrom as b, type History as b0, type CreateStaticHandlerOptions as b1, type GetActionData as c, type Router as d, type RouteModules as e, type IndexRouteObject as f, type LoaderFunction as g, type MetaFunction as h, type LinksFunction as i, type NonIndexRouteObject as j, type AppLoadContext as k, unstable_RouterContextProvider as l, type MiddlewareEnabled as m, type unstable_InitialContext as n, type ClientActionFunction as o, type ClientLoaderFunction as p, type HeadersFunction as q, type ShouldRevalidateFunction as r, type Params as s, type RouterInit as t, type unstable_MiddlewareNextFunction as u, type RouterState as v, type PatchRoutesOnNavigationFunction as w, type DataRouteObject as x, type Path as y, type StaticHandler as z };
@@ -912,8 +912,11 @@ interface Router {
912
912
  * @param routeId The parent route id or a callback function accepting `patch`
913
913
  * to perform batch patching
914
914
  * @param children The additional children routes
915
+ * @param unstable_allowElementMutations Allow mutation or route elements on
916
+ * existing routes. Intended for RSC-usage
917
+ * only.
915
918
  */
916
- patchRoutes(routeId: string | null, children: AgnosticRouteObject[]): void;
919
+ patchRoutes(routeId: string | null, children: AgnosticRouteObject[], unstable_allowElementMutations?: boolean): void;
917
920
  /**
918
921
  * @private
919
922
  * PRIVATE - DO NOT USE
@@ -922,6 +925,13 @@ interface Router {
922
925
  * TODO: Replace this with granular route update APIs (addRoute, updateRoute, deleteRoute)
923
926
  */
924
927
  _internalSetRoutes(routes: AgnosticRouteObject[]): void;
928
+ /**
929
+ * @private
930
+ * PRIVATE - DO NOT USE
931
+ *
932
+ * Cause subscribers to re-render. This is used to force a re-render.
933
+ */
934
+ _internalSetStateDoNotUseOrYouWillBreakYourApp(state: Partial<RouterState>): void;
925
935
  /**
926
936
  * @private
927
937
  * PRIVATE - DO NOT USE
@@ -954,7 +964,7 @@ interface RouterState {
954
964
  /**
955
965
  * Current scroll position we should start at for a new view
956
966
  * - number -> scroll position to restore to
957
- * - false -> do not restore scroll at all (used during submissions)
967
+ * - false -> do not restore scroll at all (used during submissions/revalidations)
958
968
  * - null -> don't have a saved position, scroll to hash or top of page
959
969
  */
960
970
  restoreScrollPosition: number | false | null;
@@ -1045,6 +1055,7 @@ interface StaticHandler {
1045
1055
  skipRevalidation?: boolean;
1046
1056
  dataStrategy?: DataStrategyFunction<unknown>;
1047
1057
  unstable_respond?: (staticContext: StaticHandlerContext) => MaybePromise<Response>;
1058
+ unstable_stream?: (context: unstable_RouterContextProvider, query: (r: Request) => Promise<StaticHandlerContext | Response>) => MaybePromise<Response>;
1048
1059
  }): Promise<StaticHandlerContext | Response>;
1049
1060
  queryRoute(request: Request, opts?: {
1050
1061
  routeId?: string;
@@ -1245,8 +1256,8 @@ type FetcherStates<TData = any> = {
1245
1256
  type Fetcher<TData = any> = FetcherStates<TData>[keyof FetcherStates<TData>];
1246
1257
  interface BlockerBlocked {
1247
1258
  state: "blocked";
1248
- reset(): void;
1249
- proceed(): void;
1259
+ reset: () => void;
1260
+ proceed: () => void;
1250
1261
  location: Location;
1251
1262
  }
1252
1263
  interface BlockerUnblocked {
@@ -1856,4 +1867,4 @@ type _DataActionData<ServerActionData, ClientActionData> = Awaited<[
1856
1867
  IsDefined<ClientActionData>
1857
1868
  ] extends [true, true] ? ServerActionData | ClientActionData : IsDefined<ClientActionData> extends true ? ClientActionData : IsDefined<ServerActionData> extends true ? ServerActionData : undefined>;
1858
1869
 
1859
- export { type Params as $, type ActionFunction as A, type Blocker as B, type CreateStaticHandlerOptions as C, type DataStrategyFunction as D, type Equal as E, type FutureConfig as F, type GetScrollPositionFunction as G, type HydrationState as H, type InitialEntry as I, type DataStrategyMatch as J, type DataStrategyResult as K, type Location as L, type MetaFunction as M, type NonIndexRouteObject as N, DataWithResponseInit as O, type PatchRoutesOnNavigationFunction as P, type ErrorResponse as Q, type RouterInit as R, type StaticHandlerContext as S, type To as T, type FormEncType as U, type FormMethod as V, type HTMLFormMethod as W, type LazyRouteFunction as X, type LoaderFunctionArgs as Y, type unstable_MiddlewareFunction as Z, type ParamParseKey as _, type Router as a, type ServerDataFrom as a$, type PathMatch as a0, type PathParam as a1, type PathPattern as a2, type RedirectFunction as a3, type unstable_RouterContext as a4, type ShouldRevalidateFunction as a5, type ShouldRevalidateFunctionArgs as a6, type UIMatch as a7, unstable_createContext as a8, unstable_RouterContextProvider as a9, type MetaDescriptor as aA, type PageLinkDescriptor as aB, type HtmlLinkDescriptor as aC, type LinkDescriptor as aD, type Future as aE, type unstable_SerializesTo as aF, createBrowserHistory as aG, invariant as aH, createRouter as aI, ErrorResponseImpl as aJ, DataRouterContext as aK, DataRouterStateContext as aL, FetchersContext as aM, LocationContext as aN, NavigationContext as aO, RouteContext as aP, ViewTransitionContext as aQ, type RouteManifest as aR, type ServerRouteModule as aS, type SerializeFrom as aT, type History as aU, type RouteModule as aV, type Pretty as aW, type GetLoaderData as aX, type ServerDataFunctionArgs as aY, type unstable_MiddlewareNextFunction as aZ, type ClientDataFunctionArgs as a_, Action as aa, createPath as ab, parsePath as ac, IDLE_NAVIGATION as ad, IDLE_FETCHER as ae, IDLE_BLOCKER as af, data as ag, generatePath as ah, isRouteErrorResponse as ai, matchPath as aj, matchRoutes as ak, redirect as al, redirectDocument as am, replace as an, resolvePath as ao, type DataRouteMatch as ap, type NavigateOptions as aq, type Navigator as ar, type PatchRoutesOnNavigationFunctionArgs as as, type RouteMatch as at, type ClientActionFunction as au, type ClientActionFunctionArgs as av, type ClientLoaderFunctionArgs as aw, type HeadersArgs as ax, type HeadersFunction as ay, type MetaArgs as az, type RouteModules as b, type Normalize as b0, type GetActionData as b1, type RouteObject as c, type StaticHandler as d, type IndexRouteObject as e, type LoaderFunction as f, type LinksFunction as g, type MiddlewareEnabled as h, type AppLoadContext as i, type RouterState as j, type DataRouteObject as k, type ClientLoaderFunction as l, type Path as m, type GetScrollRestorationKeyFunction as n, type Fetcher as o, type Navigation as p, type NavigationStates as q, type RelativeRoutingType as r, type BlockerFunction as s, type RouterSubscriber as t, type unstable_InitialContext as u, type RouterNavigateOptions as v, type RouterFetchOptions as w, type RevalidationState as x, type ActionFunctionArgs as y, type DataStrategyFunctionArgs as z };
1870
+ export { type RouterState as $, Action as A, type BlockerFunction as B, type ClientActionFunction as C, type DataStrategyFunction as D, type ServerDataFunctionArgs as E, type FutureConfig as F, type GetLoaderData as G, type HydrationState as H, type InitialEntry as I, type unstable_MiddlewareNextFunction as J, type ClientDataFunctionArgs as K, type Location as L, type MetaFunction as M, type NavigateOptions as N, type ServerDataFrom as O, type ParamParseKey as P, type Normalize as Q, type RouterInit as R, type SerializeFrom as S, type To as T, type UIMatch as U, type GetActionData as V, type RouteModules as W, type AppLoadContext as X, type MiddlewareEnabled as Y, type unstable_InitialContext as Z, type Equal as _, type Blocker as a, type ServerRouteModule as a$, type DataRouteObject as a0, type StaticHandler as a1, type GetScrollPositionFunction as a2, type GetScrollRestorationKeyFunction as a3, type StaticHandlerContext as a4, type Fetcher as a5, type NavigationStates as a6, type RouterSubscriber as a7, type RouterNavigateOptions as a8, type RouterFetchOptions as a9, matchRoutes as aA, redirect as aB, redirectDocument as aC, replace as aD, resolvePath as aE, type DataRouteMatch as aF, type PatchRoutesOnNavigationFunctionArgs as aG, type ClientActionFunctionArgs as aH, type ClientLoaderFunctionArgs as aI, type HeadersArgs as aJ, type MetaArgs as aK, type PageLinkDescriptor as aL, type HtmlLinkDescriptor as aM, type Future as aN, type unstable_SerializesTo as aO, createBrowserHistory as aP, invariant as aQ, createRouter as aR, ErrorResponseImpl as aS, DataRouterContext as aT, DataRouterStateContext as aU, FetchersContext as aV, LocationContext as aW, NavigationContext as aX, RouteContext as aY, ViewTransitionContext as aZ, type RouteManifest as a_, type RevalidationState as aa, type ActionFunctionArgs as ab, type DataStrategyFunctionArgs as ac, type DataStrategyMatch as ad, type DataStrategyResult as ae, DataWithResponseInit as af, type ErrorResponse as ag, type FormEncType as ah, type FormMethod as ai, type HTMLFormMethod as aj, type LoaderFunctionArgs as ak, type unstable_MiddlewareFunction as al, type PathParam as am, type RedirectFunction as an, type unstable_RouterContext as ao, type ShouldRevalidateFunctionArgs as ap, unstable_createContext as aq, createPath as ar, parsePath as as, IDLE_NAVIGATION as at, IDLE_FETCHER as au, IDLE_BLOCKER as av, data as aw, generatePath as ax, isRouteErrorResponse as ay, matchPath as az, type RelativeRoutingType as b, type History as b0, type CreateStaticHandlerOptions as b1, type Path as c, type PathPattern as d, type PathMatch as e, type Navigation as f, type Params as g, type Router as h, type RouteObject as i, type NonIndexRouteObject as j, type LazyRouteFunction as k, type IndexRouteObject as l, type Navigator as m, type PatchRoutesOnNavigationFunction as n, type RouteMatch as o, type ActionFunction as p, type ClientLoaderFunction as q, type HeadersFunction as r, type LinksFunction as s, type LoaderFunction as t, unstable_RouterContextProvider as u, type ShouldRevalidateFunction as v, type RouteModule as w, type LinkDescriptor as x, type Pretty as y, type MetaDescriptor as z };
@@ -0,0 +1,157 @@
1
+ import * as React from 'react';
2
+ import { u as unstable_RouterContextProvider, p as ActionFunction, C as ClientActionFunction, q as ClientLoaderFunction, r as HeadersFunction, s as LinksFunction, t as LoaderFunction, M as MetaFunction, v as ShouldRevalidateFunction, L as Location, g as Params, h as Router, R as RouterInit } from './route-data-DAw7Esur.mjs';
3
+ import { AsyncLocalStorage } from 'node:async_hooks';
4
+
5
+ type ServerContext = {
6
+ redirect?: Response;
7
+ };
8
+ declare global {
9
+ var ___reactRouterServerStorage___: AsyncLocalStorage<ServerContext> | undefined;
10
+ }
11
+ type RSCRouteConfigEntryBase = {
12
+ action?: ActionFunction;
13
+ clientAction?: ClientActionFunction;
14
+ clientLoader?: ClientLoaderFunction;
15
+ ErrorBoundary?: React.ComponentType<any>;
16
+ handle?: any;
17
+ headers?: HeadersFunction;
18
+ HydrateFallback?: React.ComponentType<any>;
19
+ Layout?: React.ComponentType<any>;
20
+ links?: LinksFunction;
21
+ loader?: LoaderFunction;
22
+ meta?: MetaFunction;
23
+ shouldRevalidate?: ShouldRevalidateFunction;
24
+ };
25
+ type RSCRouteConfigEntry = RSCRouteConfigEntryBase & {
26
+ id: string;
27
+ path?: string;
28
+ Component?: React.ComponentType<any>;
29
+ lazy?: () => Promise<RSCRouteConfigEntryBase & ({
30
+ default?: React.ComponentType<any>;
31
+ Component?: never;
32
+ } | {
33
+ default?: never;
34
+ Component?: React.ComponentType<any>;
35
+ })>;
36
+ } & ({
37
+ index: true;
38
+ } | {
39
+ children?: RSCRouteConfigEntry[];
40
+ });
41
+ type RSCRouteConfig = Array<RSCRouteConfigEntry>;
42
+ type RSCRouteManifest = {
43
+ clientAction?: ClientActionFunction;
44
+ clientLoader?: ClientLoaderFunction;
45
+ element?: React.ReactElement | false;
46
+ errorElement?: React.ReactElement;
47
+ handle?: any;
48
+ hasAction: boolean;
49
+ hasComponent: boolean;
50
+ hasErrorBoundary: boolean;
51
+ hasLoader: boolean;
52
+ hydrateFallbackElement?: React.ReactElement;
53
+ id: string;
54
+ index?: boolean;
55
+ links?: LinksFunction;
56
+ meta?: MetaFunction;
57
+ parentId?: string;
58
+ path?: string;
59
+ shouldRevalidate?: ShouldRevalidateFunction;
60
+ };
61
+ type RSCRouteMatch = RSCRouteManifest & {
62
+ params: Params;
63
+ pathname: string;
64
+ pathnameBase: string;
65
+ };
66
+ type RSCRenderPayload = {
67
+ type: "render";
68
+ actionData: Record<string, any> | null;
69
+ basename: string | undefined;
70
+ errors: Record<string, any> | null;
71
+ loaderData: Record<string, any>;
72
+ location: Location;
73
+ matches: RSCRouteMatch[];
74
+ patches?: RSCRouteManifest[];
75
+ nonce?: string;
76
+ formState?: unknown;
77
+ };
78
+ type RSCManifestPayload = {
79
+ type: "manifest";
80
+ patches: RSCRouteManifest[];
81
+ };
82
+ type RSCActionPayload = {
83
+ type: "action";
84
+ actionResult: Promise<unknown>;
85
+ rerender?: Promise<RSCRenderPayload | RSCRedirectPayload>;
86
+ };
87
+ type RSCRedirectPayload = {
88
+ type: "redirect";
89
+ status: number;
90
+ location: string;
91
+ replace: boolean;
92
+ reload: boolean;
93
+ actionResult?: Promise<unknown>;
94
+ };
95
+ type RSCPayload = RSCRenderPayload | RSCManifestPayload | RSCActionPayload | RSCRedirectPayload;
96
+ type RSCMatch = {
97
+ statusCode: number;
98
+ headers: Headers;
99
+ payload: RSCPayload;
100
+ };
101
+ type DecodeActionFunction = (formData: FormData) => Promise<() => Promise<unknown>>;
102
+ type DecodeFormStateFunction = (result: unknown, formData: FormData) => unknown;
103
+ type DecodeReplyFunction = (reply: FormData | string, { temporaryReferences }: {
104
+ temporaryReferences: unknown;
105
+ }) => Promise<unknown[]>;
106
+ type LoadServerActionFunction = (id: string) => Promise<Function>;
107
+ declare function matchRSCServerRequest({ createTemporaryReferenceSet, basename, decodeReply, requestContext, loadServerAction, decodeAction, decodeFormState, onError, request, routes, generateResponse, }: {
108
+ createTemporaryReferenceSet: () => unknown;
109
+ basename?: string;
110
+ decodeReply?: DecodeReplyFunction;
111
+ decodeAction?: DecodeActionFunction;
112
+ decodeFormState?: DecodeFormStateFunction;
113
+ requestContext?: unstable_RouterContextProvider;
114
+ loadServerAction?: LoadServerActionFunction;
115
+ onError?: (error: unknown) => void;
116
+ request: Request;
117
+ routes: RSCRouteConfigEntry[];
118
+ generateResponse: (match: RSCMatch, { temporaryReferences, }: {
119
+ temporaryReferences: unknown;
120
+ }) => Response;
121
+ }): Promise<Response>;
122
+
123
+ type BrowserCreateFromReadableStreamFunction = (body: ReadableStream<Uint8Array>, { temporaryReferences, }: {
124
+ temporaryReferences: unknown;
125
+ }) => Promise<unknown>;
126
+ type EncodeReplyFunction = (args: unknown[], options: {
127
+ temporaryReferences: unknown;
128
+ }) => Promise<BodyInit>;
129
+ declare global {
130
+ interface Window {
131
+ __router: Router;
132
+ __routerInitialized: boolean;
133
+ __routerActionID: number;
134
+ }
135
+ }
136
+ declare function createCallServer({ createFromReadableStream, createTemporaryReferenceSet, encodeReply, fetch: fetchImplementation, }: {
137
+ createFromReadableStream: BrowserCreateFromReadableStreamFunction;
138
+ createTemporaryReferenceSet: () => unknown;
139
+ encodeReply: EncodeReplyFunction;
140
+ fetch?: (request: Request) => Promise<Response>;
141
+ }): (id: string, args: unknown[]) => Promise<unknown>;
142
+ declare function RSCHydratedRouter({ createFromReadableStream, fetch: fetchImplementation, payload, routeDiscovery, unstable_getContext, }: {
143
+ createFromReadableStream: BrowserCreateFromReadableStreamFunction;
144
+ fetch?: (request: Request) => Promise<Response>;
145
+ payload: RSCPayload;
146
+ routeDiscovery?: "eager" | "lazy";
147
+ unstable_getContext?: RouterInit["unstable_getContext"];
148
+ }): React.JSX.Element;
149
+
150
+ declare global {
151
+ interface Window {
152
+ __FLIGHT_DATA: any[];
153
+ }
154
+ }
155
+ declare function getRSCStream(): ReadableStream<any>;
156
+
157
+ export { type BrowserCreateFromReadableStreamFunction as B, type DecodeActionFunction as D, type EncodeReplyFunction as E, type LoadServerActionFunction as L, type RSCPayload as R, RSCHydratedRouter as a, type DecodeFormStateFunction as b, createCallServer as c, type DecodeReplyFunction as d, type RSCManifestPayload as e, type RSCMatch as f, getRSCStream as g, type RSCRenderPayload as h, type RSCRouteManifest as i, type RSCRouteMatch as j, type RSCRouteConfigEntry as k, type RSCRouteConfig as l, matchRSCServerRequest as m };