react-router 7.9.0 → 7.9.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 (58) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/development/{chunk-S5YDGZLY.mjs → chunk-B7RQU5TL.mjs} +2 -2
  3. package/dist/development/{chunk-UGCJQSTX.js → chunk-LWNHKVDL.js} +131 -131
  4. package/dist/development/{chunk-VHEBI3C5.js → chunk-PW3F6ATG.js} +1 -1
  5. package/dist/development/{chunk-AKKEMMKB.mjs → chunk-SKNKB5VI.mjs} +2 -2
  6. package/dist/development/{context-BH6Jwdoy.d.mts → context-CIdFp11b.d.mts} +1 -1
  7. package/dist/development/dom-export.d.mts +1 -1
  8. package/dist/development/dom-export.js +3 -3
  9. package/dist/development/dom-export.mjs +3 -3
  10. package/dist/{production/index-react-server-client-CMC2eQAY.d.ts → development/index-react-server-client-BYr9g50r.d.ts} +1 -1
  11. package/dist/{production/index-react-server-client-1cWMpKk4.d.mts → development/index-react-server-client-BeVfPpWg.d.mts} +2 -2
  12. package/dist/development/index-react-server-client.d.mts +3 -3
  13. package/dist/development/index-react-server-client.d.ts +2 -2
  14. package/dist/development/index-react-server-client.js +4 -4
  15. package/dist/development/index-react-server-client.mjs +2 -2
  16. package/dist/development/index-react-server.d.mts +1 -1
  17. package/dist/development/index-react-server.d.ts +1 -1
  18. package/dist/development/index-react-server.js +1 -1
  19. package/dist/development/index-react-server.mjs +1 -1
  20. package/dist/development/index.d.mts +6 -6
  21. package/dist/development/index.d.ts +4 -4
  22. package/dist/development/index.js +96 -96
  23. package/dist/development/index.mjs +3 -3
  24. package/dist/development/lib/types/internal.d.mts +39 -14
  25. package/dist/development/lib/types/internal.d.ts +38 -13
  26. package/dist/development/lib/types/internal.js +1 -1
  27. package/dist/development/lib/types/internal.mjs +1 -1
  28. package/dist/development/{route-data-BQkq8Erj.d.mts → route-data-Bpm4liR_.d.mts} +1 -1
  29. package/dist/development/{routeModules-DSKAn01V.d.ts → routeModules-DnUHijGz.d.ts} +1 -1
  30. package/dist/production/{chunk-HDA5IKPB.js → chunk-3SXVZXGI.js} +131 -131
  31. package/dist/production/{chunk-VNPMQDPD.js → chunk-HMYSPRGR.js} +1 -1
  32. package/dist/production/{chunk-MOZTWV63.mjs → chunk-P25HWPOZ.mjs} +2 -2
  33. package/dist/production/{chunk-WOZJCBVO.mjs → chunk-RCAZODXZ.mjs} +2 -2
  34. package/dist/production/{context-BH6Jwdoy.d.mts → context-CIdFp11b.d.mts} +1 -1
  35. package/dist/production/dom-export.d.mts +1 -1
  36. package/dist/production/dom-export.js +3 -3
  37. package/dist/production/dom-export.mjs +3 -3
  38. package/dist/{development/index-react-server-client-CMC2eQAY.d.ts → production/index-react-server-client-BYr9g50r.d.ts} +1 -1
  39. package/dist/{development/index-react-server-client-1cWMpKk4.d.mts → production/index-react-server-client-BeVfPpWg.d.mts} +2 -2
  40. package/dist/production/index-react-server-client.d.mts +3 -3
  41. package/dist/production/index-react-server-client.d.ts +2 -2
  42. package/dist/production/index-react-server-client.js +4 -4
  43. package/dist/production/index-react-server-client.mjs +2 -2
  44. package/dist/production/index-react-server.d.mts +1 -1
  45. package/dist/production/index-react-server.d.ts +1 -1
  46. package/dist/production/index-react-server.js +1 -1
  47. package/dist/production/index-react-server.mjs +1 -1
  48. package/dist/production/index.d.mts +6 -6
  49. package/dist/production/index.d.ts +4 -4
  50. package/dist/production/index.js +96 -96
  51. package/dist/production/index.mjs +3 -3
  52. package/dist/production/lib/types/internal.d.mts +39 -14
  53. package/dist/production/lib/types/internal.d.ts +38 -13
  54. package/dist/production/lib/types/internal.js +1 -1
  55. package/dist/production/lib/types/internal.mjs +1 -1
  56. package/dist/production/{route-data-BQkq8Erj.d.mts → route-data-Bpm4liR_.d.mts} +1 -1
  57. package/dist/production/{routeModules-DSKAn01V.d.ts → routeModules-DnUHijGz.d.ts} +1 -1
  58. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.9.0
2
+ * react-router v7.9.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -31,7 +31,7 @@ import {
31
31
  isSession,
32
32
  routeRSCServerRequest,
33
33
  setDevServerHooks
34
- } from "./chunk-WOZJCBVO.mjs";
34
+ } from "./chunk-RCAZODXZ.mjs";
35
35
  import {
36
36
  Action,
37
37
  Await,
@@ -141,7 +141,7 @@ import {
141
141
  withComponentProps,
142
142
  withErrorBoundaryProps,
143
143
  withHydrateFallbackProps
144
- } from "./chunk-MOZTWV63.mjs";
144
+ } from "./chunk-P25HWPOZ.mjs";
145
145
  export {
146
146
  Await,
147
147
  BrowserRouter,
@@ -1,5 +1,5 @@
1
- import { R as RouteModule, L as LinkDescriptor, F as Func, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, C as ClientDataFunctionArgs, a as ServerDataFrom, N as Normalize, b as GetActionData } from '../../route-data-BQkq8Erj.mjs';
2
- import { L as Location, M as MiddlewareNextFunction, D as DataStrategyResult } from '../../context-BH6Jwdoy.mjs';
1
+ import { R as RouteModule, L as LinkDescriptor, F as Func, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, C as ClientDataFunctionArgs, a as ServerDataFrom, N as Normalize, b as GetActionData } from '../../route-data-Bpm4liR_.mjs';
2
+ import { L as Location, M as MiddlewareNextFunction, D as DataStrategyResult } from '../../context-CIdFp11b.mjs';
3
3
  import { R as RouteFiles, P as Pages } from '../../register-DiOIlEq5.mjs';
4
4
  import 'react';
5
5
 
@@ -69,11 +69,22 @@ type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["par
69
69
  /** This is an asynchronous function that makes the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server action for this route. */
70
70
  serverAction: () => Promise<ServerDataFrom<T["module"]["action"]>>;
71
71
  };
72
- type CreateHydrateFallbackProps<T extends RouteInfo> = {
72
+ type IsServerFirstRoute<T extends RouteInfo, RSCEnabled extends boolean> = RSCEnabled extends true ? T["module"] extends {
73
+ ServerComponent: Func;
74
+ } ? true : false : false;
75
+ type CreateHydrateFallbackProps<T extends RouteInfo, RSCEnabled extends boolean> = {
73
76
  params: T["params"];
77
+ } & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
78
+ /** The data returned from the `loader` */
79
+ loaderData?: ServerDataFrom<T["module"]["loader"]>;
80
+ /** The data returned from the `action` following an action submission. */
81
+ actionData?: ServerDataFrom<T["module"]["action"]>;
82
+ } : {
83
+ /** The data returned from the `loader` or `clientLoader` */
74
84
  loaderData?: T["loaderData"];
85
+ /** The data returned from the `action` or `clientAction` following an action submission. */
75
86
  actionData?: T["actionData"];
76
- };
87
+ });
77
88
  type Match<T extends MatchInfo> = Pretty<{
78
89
  id: T["id"];
79
90
  params: Record<string, string | undefined>;
@@ -84,7 +95,7 @@ type Match<T extends MatchInfo> = Pretty<{
84
95
  handle: unknown;
85
96
  }>;
86
97
  type Matches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [Match<F>, ...Matches<R>] : Array<Match<MatchInfo> | undefined>;
87
- type CreateComponentProps<T extends RouteInfo> = {
98
+ type CreateComponentProps<T extends RouteInfo, RSCEnabled extends boolean> = {
88
99
  /**
89
100
  * {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
90
101
  * @example
@@ -100,14 +111,20 @@ type CreateComponentProps<T extends RouteInfo> = {
100
111
  * }
101
112
  **/
102
113
  params: T["params"];
114
+ /** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
115
+ matches: Matches<T["matches"]>;
116
+ } & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
117
+ /** The data returned from the `loader` */
118
+ loaderData: ServerDataFrom<T["module"]["loader"]>;
119
+ /** The data returned from the `action` following an action submission. */
120
+ actionData?: ServerDataFrom<T["module"]["action"]>;
121
+ } : {
103
122
  /** The data returned from the `loader` or `clientLoader` */
104
123
  loaderData: T["loaderData"];
105
124
  /** The data returned from the `action` or `clientAction` following an action submission. */
106
125
  actionData?: T["actionData"];
107
- /** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
108
- matches: Matches<T["matches"]>;
109
- };
110
- type CreateErrorBoundaryProps<T extends RouteInfo> = {
126
+ });
127
+ type CreateErrorBoundaryProps<T extends RouteInfo, RSCEnabled extends boolean> = {
111
128
  /**
112
129
  * {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
113
130
  * @example
@@ -124,10 +141,18 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
124
141
  **/
125
142
  params: T["params"];
126
143
  error: unknown;
144
+ } & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
145
+ /** The data returned from the `loader` */
146
+ loaderData?: ServerDataFrom<T["module"]["loader"]>;
147
+ /** The data returned from the `action` following an action submission. */
148
+ actionData?: ServerDataFrom<T["module"]["action"]>;
149
+ } : {
150
+ /** The data returned from the `loader` or `clientLoader` */
127
151
  loaderData?: T["loaderData"];
152
+ /** The data returned from the `action` or `clientAction` following an action submission. */
128
153
  actionData?: T["actionData"];
129
- };
130
- type GetAnnotations<Info extends RouteInfo> = {
154
+ });
155
+ type GetAnnotations<Info extends RouteInfo, RSCEnabled extends boolean> = {
131
156
  LinkDescriptors: LinkDescriptor[];
132
157
  LinksFunction: () => LinkDescriptor[];
133
158
  MetaArgs: CreateMetaArgs<Info>;
@@ -141,9 +166,9 @@ type GetAnnotations<Info extends RouteInfo> = {
141
166
  ClientLoaderArgs: CreateClientLoaderArgs<Info>;
142
167
  ActionArgs: CreateServerActionArgs<Info>;
143
168
  ClientActionArgs: CreateClientActionArgs<Info>;
144
- HydrateFallbackProps: CreateHydrateFallbackProps<Info>;
145
- ComponentProps: CreateComponentProps<Info>;
146
- ErrorBoundaryProps: CreateErrorBoundaryProps<Info>;
169
+ HydrateFallbackProps: CreateHydrateFallbackProps<Info, RSCEnabled>;
170
+ ComponentProps: CreateComponentProps<Info, RSCEnabled>;
171
+ ErrorBoundaryProps: CreateErrorBoundaryProps<Info, RSCEnabled>;
147
172
  };
148
173
 
149
174
  type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
@@ -1,4 +1,4 @@
1
- import { R as RouteModule, L as LinkDescriptor, a as Location, F as Func, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, b as MiddlewareNextFunction, C as ClientDataFunctionArgs, D as DataStrategyResult, c as ServerDataFrom, N as Normalize, d as GetActionData } from '../../routeModules-DSKAn01V.js';
1
+ import { R as RouteModule, L as LinkDescriptor, a as Location, F as Func, P as Pretty, M as MetaDescriptor, G as GetLoaderData, S as ServerDataFunctionArgs, b as MiddlewareNextFunction, C as ClientDataFunctionArgs, D as DataStrategyResult, c as ServerDataFrom, N as Normalize, d as GetActionData } from '../../routeModules-DnUHijGz.js';
2
2
  import { R as RouteFiles, P as Pages } from '../../register-DiOIlEq5.js';
3
3
  import 'react';
4
4
 
@@ -68,11 +68,22 @@ type CreateClientActionArgs<T extends RouteInfo> = ClientDataFunctionArgs<T["par
68
68
  /** This is an asynchronous function that makes the {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API fetch} call to the React Router server action for this route. */
69
69
  serverAction: () => Promise<ServerDataFrom<T["module"]["action"]>>;
70
70
  };
71
- type CreateHydrateFallbackProps<T extends RouteInfo> = {
71
+ type IsServerFirstRoute<T extends RouteInfo, RSCEnabled extends boolean> = RSCEnabled extends true ? T["module"] extends {
72
+ ServerComponent: Func;
73
+ } ? true : false : false;
74
+ type CreateHydrateFallbackProps<T extends RouteInfo, RSCEnabled extends boolean> = {
72
75
  params: T["params"];
76
+ } & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
77
+ /** The data returned from the `loader` */
78
+ loaderData?: ServerDataFrom<T["module"]["loader"]>;
79
+ /** The data returned from the `action` following an action submission. */
80
+ actionData?: ServerDataFrom<T["module"]["action"]>;
81
+ } : {
82
+ /** The data returned from the `loader` or `clientLoader` */
73
83
  loaderData?: T["loaderData"];
84
+ /** The data returned from the `action` or `clientAction` following an action submission. */
74
85
  actionData?: T["actionData"];
75
- };
86
+ });
76
87
  type Match<T extends MatchInfo> = Pretty<{
77
88
  id: T["id"];
78
89
  params: Record<string, string | undefined>;
@@ -83,7 +94,7 @@ type Match<T extends MatchInfo> = Pretty<{
83
94
  handle: unknown;
84
95
  }>;
85
96
  type Matches<T extends Array<MatchInfo>> = T extends [infer F extends MatchInfo, ...infer R extends Array<MatchInfo>] ? [Match<F>, ...Matches<R>] : Array<Match<MatchInfo> | undefined>;
86
- type CreateComponentProps<T extends RouteInfo> = {
97
+ type CreateComponentProps<T extends RouteInfo, RSCEnabled extends boolean> = {
87
98
  /**
88
99
  * {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
89
100
  * @example
@@ -99,14 +110,20 @@ type CreateComponentProps<T extends RouteInfo> = {
99
110
  * }
100
111
  **/
101
112
  params: T["params"];
113
+ /** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
114
+ matches: Matches<T["matches"]>;
115
+ } & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
116
+ /** The data returned from the `loader` */
117
+ loaderData: ServerDataFrom<T["module"]["loader"]>;
118
+ /** The data returned from the `action` following an action submission. */
119
+ actionData?: ServerDataFrom<T["module"]["action"]>;
120
+ } : {
102
121
  /** The data returned from the `loader` or `clientLoader` */
103
122
  loaderData: T["loaderData"];
104
123
  /** The data returned from the `action` or `clientAction` following an action submission. */
105
124
  actionData?: T["actionData"];
106
- /** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
107
- matches: Matches<T["matches"]>;
108
- };
109
- type CreateErrorBoundaryProps<T extends RouteInfo> = {
125
+ });
126
+ type CreateErrorBoundaryProps<T extends RouteInfo, RSCEnabled extends boolean> = {
110
127
  /**
111
128
  * {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route.
112
129
  * @example
@@ -123,10 +140,18 @@ type CreateErrorBoundaryProps<T extends RouteInfo> = {
123
140
  **/
124
141
  params: T["params"];
125
142
  error: unknown;
143
+ } & (IsServerFirstRoute<T, RSCEnabled> extends true ? {
144
+ /** The data returned from the `loader` */
145
+ loaderData?: ServerDataFrom<T["module"]["loader"]>;
146
+ /** The data returned from the `action` following an action submission. */
147
+ actionData?: ServerDataFrom<T["module"]["action"]>;
148
+ } : {
149
+ /** The data returned from the `loader` or `clientLoader` */
126
150
  loaderData?: T["loaderData"];
151
+ /** The data returned from the `action` or `clientAction` following an action submission. */
127
152
  actionData?: T["actionData"];
128
- };
129
- type GetAnnotations<Info extends RouteInfo> = {
153
+ });
154
+ type GetAnnotations<Info extends RouteInfo, RSCEnabled extends boolean> = {
130
155
  LinkDescriptors: LinkDescriptor[];
131
156
  LinksFunction: () => LinkDescriptor[];
132
157
  MetaArgs: CreateMetaArgs<Info>;
@@ -140,9 +165,9 @@ type GetAnnotations<Info extends RouteInfo> = {
140
165
  ClientLoaderArgs: CreateClientLoaderArgs<Info>;
141
166
  ActionArgs: CreateServerActionArgs<Info>;
142
167
  ClientActionArgs: CreateClientActionArgs<Info>;
143
- HydrateFallbackProps: CreateHydrateFallbackProps<Info>;
144
- ComponentProps: CreateComponentProps<Info>;
145
- ErrorBoundaryProps: CreateErrorBoundaryProps<Info>;
168
+ HydrateFallbackProps: CreateHydrateFallbackProps<Info, RSCEnabled>;
169
+ ComponentProps: CreateComponentProps<Info, RSCEnabled>;
170
+ ErrorBoundaryProps: CreateErrorBoundaryProps<Info, RSCEnabled>;
146
171
  };
147
172
 
148
173
  type Params<RouteFile extends keyof RouteFiles> = Normalize<Pages[RouteFiles[RouteFile]["page"]]["params"]>;
@@ -1,5 +1,5 @@
1
1
  "use strict";/**
2
- * react-router v7.9.0
2
+ * react-router v7.9.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.9.0
2
+ * react-router v7.9.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import { ComponentType, ReactElement } from 'react';
2
- import { A as ActionFunctionArgs, b as LoaderFunctionArgs, c as ActionFunction, d as LoaderFunction, P as Params, L as Location, e as DataRouteMatch, f as MiddlewareFunction, D as DataStrategyResult, S as ShouldRevalidateFunction, g as RouterContextProvider, h as DataWithResponseInit, i as MiddlewareEnabled } from './context-BH6Jwdoy.mjs';
2
+ import { A as ActionFunctionArgs, b as LoaderFunctionArgs, c as ActionFunction, d as LoaderFunction, P as Params, L as Location, e as DataRouteMatch, f as MiddlewareFunction, D as DataStrategyResult, S as ShouldRevalidateFunction, g as RouterContextProvider, h as DataWithResponseInit, i as MiddlewareEnabled } from './context-CIdFp11b.mjs';
3
3
 
4
4
  /**
5
5
  * An object of unknown type for route loaders and actions provided by the
@@ -213,7 +213,7 @@ type UrlHistoryOptions = {
213
213
  interface Future {
214
214
  }
215
215
  type MiddlewareEnabled = Future extends {
216
- middleware: infer T extends boolean;
216
+ v8_middleware: infer T extends boolean;
217
217
  } ? T : false;
218
218
 
219
219
  type MaybePromise<T> = T | Promise<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router",
3
- "version": "7.9.0",
3
+ "version": "7.9.1",
4
4
  "description": "Declarative routing for React",
5
5
  "keywords": [
6
6
  "react",