react-router 7.9.6-pre.1 → 7.10.0-pre.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +69 -4
  2. package/dist/development/{browser-C07r42Tt.d.mts → browser-BHySFrZ2.d.mts} +1 -1
  3. package/dist/development/{browser-BbBXFHbO.d.ts → browser-eL-tAN4R.d.ts} +1 -1
  4. package/dist/development/{chunk-HSVNPM3C.js → chunk-2VILFZWG.js} +167 -123
  5. package/dist/development/{chunk-DKSAHU2I.mjs → chunk-4BTFPFZR.mjs} +208 -221
  6. package/dist/development/{chunk-RGKEVI2W.mjs → chunk-CECIHG5K.mjs} +15 -5
  7. package/dist/development/{chunk-CYHICRRW.js → chunk-M4WLV5HP.js} +201 -258
  8. package/dist/development/{chunk-OLIKX45O.js → chunk-Z4R76DXJ.js} +7 -7
  9. package/dist/development/dom-export.d.mts +21 -2
  10. package/dist/development/dom-export.d.ts +21 -2
  11. package/dist/development/dom-export.js +158 -103
  12. package/dist/development/dom-export.mjs +133 -79
  13. package/dist/development/{index-react-server-client-Da3kmxNd.d.ts → index-react-server-client-CNrKUHDv.d.ts} +59 -7
  14. package/dist/{production/index-react-server-client-rcoGPJhU.d.mts → development/index-react-server-client-DYtvZPLT.d.mts} +59 -7
  15. package/dist/development/index-react-server-client.d.mts +2 -2
  16. package/dist/development/index-react-server-client.d.ts +2 -2
  17. package/dist/development/index-react-server-client.js +4 -4
  18. package/dist/development/index-react-server-client.mjs +2 -2
  19. package/dist/development/index-react-server.d.mts +19 -4
  20. package/dist/development/index-react-server.d.ts +19 -4
  21. package/dist/development/index-react-server.js +30 -24
  22. package/dist/development/index-react-server.mjs +30 -24
  23. package/dist/development/index.d.mts +19 -15
  24. package/dist/development/index.d.ts +19 -15
  25. package/dist/development/index.js +92 -82
  26. package/dist/development/index.mjs +3 -3
  27. package/dist/{production/instrumentation-Unc20tLk.d.ts → development/instrumentation-Dwf-sTWa.d.ts} +66 -8
  28. package/dist/development/lib/types/internal.d.mts +2 -2
  29. package/dist/development/lib/types/internal.d.ts +2 -2
  30. package/dist/development/lib/types/internal.js +1 -1
  31. package/dist/development/lib/types/internal.mjs +1 -1
  32. package/dist/development/{register-BpU9rFBJ.d.ts → register-BnQsYkwj.d.ts} +1 -1
  33. package/dist/development/{register-QkB3HGjm.d.mts → register-C97Jz2jB.d.mts} +1 -1
  34. package/dist/development/{router-CAvh_Drx.d.mts → router-Dgz_Mh9m.d.mts} +66 -8
  35. package/dist/production/{browser-C07r42Tt.d.mts → browser-BHySFrZ2.d.mts} +1 -1
  36. package/dist/production/{browser-BbBXFHbO.d.ts → browser-eL-tAN4R.d.ts} +1 -1
  37. package/dist/production/{chunk-2DNJUQK6.js → chunk-55FFLVQP.js} +201 -258
  38. package/dist/production/{chunk-EDK3MRM6.js → chunk-5DTJHKF7.js} +167 -123
  39. package/dist/production/{chunk-LESYMMDQ.mjs → chunk-KJ5676BZ.mjs} +208 -221
  40. package/dist/production/{chunk-LC2OWLJG.mjs → chunk-QKAGOFED.mjs} +15 -5
  41. package/dist/production/{chunk-JLDESRHY.js → chunk-SGCRBGEM.js} +7 -7
  42. package/dist/production/dom-export.d.mts +21 -2
  43. package/dist/production/dom-export.d.ts +21 -2
  44. package/dist/production/dom-export.js +158 -103
  45. package/dist/production/dom-export.mjs +133 -79
  46. package/dist/production/{index-react-server-client-Da3kmxNd.d.ts → index-react-server-client-CNrKUHDv.d.ts} +59 -7
  47. package/dist/{development/index-react-server-client-rcoGPJhU.d.mts → production/index-react-server-client-DYtvZPLT.d.mts} +59 -7
  48. package/dist/production/index-react-server-client.d.mts +2 -2
  49. package/dist/production/index-react-server-client.d.ts +2 -2
  50. package/dist/production/index-react-server-client.js +4 -4
  51. package/dist/production/index-react-server-client.mjs +2 -2
  52. package/dist/production/index-react-server.d.mts +19 -4
  53. package/dist/production/index-react-server.d.ts +19 -4
  54. package/dist/production/index-react-server.js +30 -24
  55. package/dist/production/index-react-server.mjs +30 -24
  56. package/dist/production/index.d.mts +19 -15
  57. package/dist/production/index.d.ts +19 -15
  58. package/dist/production/index.js +92 -82
  59. package/dist/production/index.mjs +3 -3
  60. package/dist/{development/instrumentation-Unc20tLk.d.ts → production/instrumentation-Dwf-sTWa.d.ts} +66 -8
  61. package/dist/production/lib/types/internal.d.mts +2 -2
  62. package/dist/production/lib/types/internal.d.ts +2 -2
  63. package/dist/production/lib/types/internal.js +1 -1
  64. package/dist/production/lib/types/internal.mjs +1 -1
  65. package/dist/production/{register-BpU9rFBJ.d.ts → register-BnQsYkwj.d.ts} +1 -1
  66. package/dist/production/{register-QkB3HGjm.d.mts → register-C97Jz2jB.d.mts} +1 -1
  67. package/dist/production/{router-CAvh_Drx.d.mts → router-Dgz_Mh9m.d.mts} +66 -8
  68. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,16 +1,78 @@
1
1
  # `react-router`
2
2
 
3
- ## 7.9.6-pre.1
3
+ ## 7.10.0-pre.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Stabilize `fetcher.reset()` ([#14545](https://github.com/remix-run/react-router/pull/14545))
8
+ - ⚠️ This is a breaking change if you have begun using `fetcher.unstable_reset()`
9
+
10
+ - Stabilize the `dataStrategy` `match.shouldRevalidateArgs`/`match.shouldCallHandler()` APIs. ([#14592](https://github.com/remix-run/react-router/pull/14592))
11
+ - The `match.shouldLoad` API is now marked deprecated in favor of these more powerful alternatives
12
+ - If you're using this API in a custom `dataStrategy` today, you can swap to the new API at your convenience:
13
+
14
+ ```tsx
15
+ // Before
16
+ const matchesToLoad = matches.filter((m) => m.shouldLoad);
17
+
18
+ // After
19
+ const matchesToLoad = matches.filter((m) => m.shouldCallHandler());
20
+ ```
21
+
22
+ - `match.shouldRevalidateArgs` is the argument that will be passed to the route `shouldRevaliate` function
23
+ - Combined with the parameter accepted by `match.shouldCallHandler`, you can define a custom revalidation behavior for your `dataStrategy`:
24
+
25
+ ```tsx
26
+ const matchesToLoad = matches.filter((m) => {
27
+ const defaultShouldRevalidate = customRevalidationBehavior(
28
+ match.shouldRevalidateArgs,
29
+ );
30
+ return m.shouldCallHandler(defaultShouldRevalidate);
31
+ // The argument here will override the internal `defaultShouldRevalidate` value
32
+ });
33
+ ```
4
34
 
5
35
  ### Patch Changes
6
36
 
7
- - Normalize double-slashes in `resolvePath` ([#14529](https://github.com/remix-run/react-router/pull/14529))
37
+ - Fix a Framework Mode bug where the `defaultShouldRevalidate` parameter to `shouldRevalidate` would not be correct after `action` returned a 4xx/5xx response (`true` when it should have been `false`) ([#14592](https://github.com/remix-run/react-router/pull/14592))
38
+ - If your `shouldRevalidate` function relied on that parameter, you may have seen unintended revalidations
39
+
40
+ - Fix `fetcher.submit` failing with plain objects containing a `tagName` property ([#14534](https://github.com/remix-run/react-router/pull/14534))
41
+ - [UNSTABLE] Add `unstable_pattern` to the parameters for client side `unstable_onError`, refactor how it's called by `RouterProvider` to avoid potential strict mode issues ([#14573](https://github.com/remix-run/react-router/pull/14573))
42
+ - Add new `unstable_useTransitions` flag to routers to give users control over the usage of [`React.startTransition`](https://react.dev/reference/react/startTransition) and [`React.useOptimistic`](https://react.dev/reference/react/useOptimistic). ([#14524](https://github.com/remix-run/react-router/pull/14524))
43
+ - Framework Mode + Data Mode:
44
+ - `<HydratedRouter unstable_transition>`/`<RouterProvider unstable_transition>`
45
+ - When left unset (current default behavior)
46
+ - Router state updates are wrapped in `React.startTransition`
47
+ - ⚠️ This can lead to buggy behaviors if you are wrapping your own navigations/fetchers in `React.startTransition`
48
+ - You should set the flag to `true` if you run into this scenario to get the enhanced `useOptimistic` behavior (requires React 19)
49
+ - When set to `true`
50
+ - Router state updates remain wrapped in `React.startTransition` (as they are without the flag)
51
+ - `Link`/`Form` navigations will be wrapped in `React.startTransition`
52
+ - A subset of router state info will be surfaced to the UI _during_ navigations via `React.useOptimistic` (i.e., `useNavigation()`, `useFetchers()`, etc.)
53
+ - ⚠️ This is a React 19 API so you must also be React 19 to opt into this flag for Framework/Data Mode
54
+ - When set to `false`
55
+ - The router will not leverage `React.startTransition` or `React.useOptimistic` on any navigations or state changes
56
+ - Declarative Mode
57
+ - `<BrowserRouter unstable_useTransitions>`
58
+ - When left unset
59
+ - Router state updates are wrapped in `React.startTransition`
60
+ - When set to `true`
61
+ - Router state updates remain wrapped in `React.startTransition` (as they are without the flag)
62
+ - `Link`/`Form` navigations will be wrapped in `React.startTransition`
63
+ - When set to `false`
64
+ - the router will not leverage `React.startTransition` on any navigations or state changes
8
65
 
9
- ## 7.9.6-pre.0
66
+ - Fix the promise returned from `useNavigate` in Framework/Data Mode so that it properly tracks the duration of `popstate` navigations (i.e., `navigate(-1)`) ([#14524](https://github.com/remix-run/react-router/pull/14524))
67
+ - Fix internal type error in useRoute types that surfaces when skipLibCheck is disabled ([#14577](https://github.com/remix-run/react-router/pull/14577))
68
+ - Preserve `statusText` on the `ErrorResponse` instance when throwing `data()` from a route handler ([#14555](https://github.com/remix-run/react-router/pull/14555))
69
+ - Optimize href() to avoid backtracking regex on splat ([#14329](https://github.com/remix-run/react-router/pull/14329))
70
+
71
+ ## 7.9.6
10
72
 
11
73
  ### Patch Changes
12
74
 
13
- - [UNSTABLE] Add `location`/`params` as arguments to client-side `unstable_onError` to permit enhanced error reporting. ([#14509](https://github.com/remix-run/react-router/pull/14509))
75
+ - \[UNSTABLE] Add `location`/`params` as arguments to client-side `unstable_onError` to permit enhanced error reporting. ([#14509](https://github.com/remix-run/react-router/pull/14509))
14
76
 
15
77
  ⚠️ This is a breaking change if you've already adopted `unstable_onError`. The second `errorInfo` parameter is now an object with `location` and `params`:
16
78
 
@@ -34,8 +96,11 @@
34
96
  ```
35
97
 
36
98
  - Properly handle ancestor thrown middleware errors before `next()` on fetcher submissions ([#14517](https://github.com/remix-run/react-router/pull/14517))
99
+
37
100
  - Fix issue with splat routes interfering with multiple calls to patchRoutesOnNavigation ([#14487](https://github.com/remix-run/react-router/pull/14487))
38
101
 
102
+ - Normalize double-slashes in `resolvePath` ([#14529](https://github.com/remix-run/react-router/pull/14529))
103
+
39
104
  ## 7.9.5
40
105
 
41
106
  ### 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 './router-CAvh_Drx.mjs';
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-Dgz_Mh9m.mjs';
3
3
 
4
4
  type RSCRouteConfigEntryBase = {
5
5
  action?: ActionFunction;
@@ -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-Unc20tLk.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-Dwf-sTWa.js';
3
3
 
4
4
  type RSCRouteConfigEntryBase = {
5
5
  action?: ActionFunction;