react-router 7.10.1 → 7.11.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 +35 -0
  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-B3F6YMOF.js → development/chunk-2JY4UAJA.js} +111 -121
  5. package/dist/{production/chunk-YO5R3LGQ.js → development/chunk-GNDLROV6.js} +7 -7
  6. package/dist/development/{chunk-WWGJGFF6.mjs → chunk-JMJ3UQ3L.mjs} +231 -74
  7. package/dist/development/{chunk-RBZI3ZHD.js → chunk-SZQUWNVJ.js} +279 -110
  8. package/dist/development/{chunk-PMGK554W.mjs → chunk-YNUBSHFH.mjs} +147 -38
  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-UQPBOMFP.js → chunk-2HFJAX7U.js} +279 -110
  38. package/dist/{development/chunk-FKYGG5Z2.js → production/chunk-BEXOWXJO.js} +7 -7
  39. package/dist/production/{chunk-TDCOAFPJ.mjs → chunk-E6GYEQUT.mjs} +147 -38
  40. package/dist/production/{chunk-ANIOYBQK.mjs → chunk-TINMVEA2.mjs} +231 -74
  41. package/dist/{development/chunk-HMTWJNYB.js → production/chunk-ZMYPVUNZ.js} +111 -121
  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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Stabilize `<HydratedRouter onError>`/`<RouterProvider onError>` ([#14546](https://github.com/remix-run/react-router/pull/14546))
8
+
9
+ ### Patch Changes
10
+
11
+ - add support for throwing redirect Response's at RSC render time ([#14596](https://github.com/remix-run/react-router/pull/14596))
12
+
13
+ - Support for throwing `data()` and Response from server component render phase. Response body is not serialized as async work is not allowed as error encoding phase. If you wish to transmit data to the boundary, throw `data()` instead. ([#14632](https://github.com/remix-run/react-router/pull/14632))
14
+
15
+ - Fix `unstable_useTransitions` prop on `<Router>` component to permit omission for backewards compatibility ([#14646](https://github.com/remix-run/react-router/pull/14646))
16
+
17
+ - `routeRSCServerRequest` replace `fetchServer` with `serverResponse` ([#14597](https://github.com/remix-run/react-router/pull/14597))
18
+
19
+ - \[UNSTABLE] Add a new `unstable_defaultShouldRevalidate` flag to various APIs to allow opt-ing out of standard revalidation behaviors. ([#14542](https://github.com/remix-run/react-router/pull/14542))
20
+
21
+ If active routes include a `shouldRevalidate` function, then your value will be passed as `defaultShouldRevalidate` in those function so that the route always has the final revalidation determination.
22
+
23
+ - `<Form method="post" unstable_defaultShouldRevalidate={false}>`
24
+ - `submit(data, { method: "post", unstable_defaultShouldRevalidate: false })`
25
+ - `<fetcher.Form method="post" unstable_defaultShouldRevalidate={false}>`
26
+ - `fetcher.submit(data, { method: "post", unstable_defaultShouldRevalidate: false })`
27
+
28
+ This is also available on non-submission APIs that may trigger revalidations due to changing search params:
29
+
30
+ - `<Link to="/" unstable_defaultShouldRevalidate={false}>`
31
+ - `navigate("/?foo=bar", { unstable_defaultShouldRevalidate: false })`
32
+ - `setSearchParams(params, { unstable_defaultShouldRevalidate: false })`
33
+
34
+ - Allow redirects to be returned from client side middleware ([#14598](https://github.com/remix-run/react-router/pull/14598))
35
+
36
+ - Handle `dataStrategy` implementations that return insufficient result sets by adding errors for routes without any available result ([#14627](https://github.com/remix-run/react-router/pull/14627))
37
+
3
38
  ## 7.10.1
4
39
 
5
40
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './instrumentation-BB0wRuqz.js';
2
+ import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './router-5fbeEIMQ.mjs';
3
3
 
4
4
  type RSCRouteConfigEntryBase = {
5
5
  action?: ActionFunction;
@@ -93,7 +93,7 @@ type RSCMatch = {
93
93
  };
94
94
  type DecodeActionFunction = (formData: FormData) => Promise<() => Promise<unknown>>;
95
95
  type DecodeFormStateFunction = (result: unknown, formData: FormData) => unknown;
96
- type DecodeReplyFunction = (reply: FormData | string, { temporaryReferences }: {
96
+ type DecodeReplyFunction = (reply: FormData | string, options: {
97
97
  temporaryReferences: unknown;
98
98
  }) => Promise<unknown[]>;
99
99
  type LoadServerActionFunction = (id: string) => Promise<Function>;
@@ -178,7 +178,8 @@ declare function matchRSCServerRequest({ createTemporaryReferenceSet, basename,
178
178
  onError?: (error: unknown) => void;
179
179
  request: Request;
180
180
  routes: RSCRouteConfigEntry[];
181
- generateResponse: (match: RSCMatch, { temporaryReferences, }: {
181
+ generateResponse: (match: RSCMatch, { onError, temporaryReferences, }: {
182
+ onError(error: unknown): string | undefined;
182
183
  temporaryReferences: unknown;
183
184
  }) => Response;
184
185
  }): Promise<Response>;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './instrumentation-BB0wRuqz.js';
2
+ import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './instrumentation-BlrVzjbg.js';
3
3
 
4
4
  type RSCRouteConfigEntryBase = {
5
5
  action?: ActionFunction;
@@ -93,7 +93,7 @@ type RSCMatch = {
93
93
  };
94
94
  type DecodeActionFunction = (formData: FormData) => Promise<() => Promise<unknown>>;
95
95
  type DecodeFormStateFunction = (result: unknown, formData: FormData) => unknown;
96
- type DecodeReplyFunction = (reply: FormData | string, { temporaryReferences }: {
96
+ type DecodeReplyFunction = (reply: FormData | string, options: {
97
97
  temporaryReferences: unknown;
98
98
  }) => Promise<unknown[]>;
99
99
  type LoadServerActionFunction = (id: string) => Promise<Function>;
@@ -178,7 +178,8 @@ declare function matchRSCServerRequest({ createTemporaryReferenceSet, basename,
178
178
  onError?: (error: unknown) => void;
179
179
  request: Request;
180
180
  routes: RSCRouteConfigEntry[];
181
- generateResponse: (match: RSCMatch, { temporaryReferences, }: {
181
+ generateResponse: (match: RSCMatch, { onError, temporaryReferences, }: {
182
+ onError(error: unknown): string | undefined;
182
183
  temporaryReferences: unknown;
183
184
  }) => Response;
184
185
  }): Promise<Response>;