react-router 0.0.0-experimental-112589a91 → 0.0.0-experimental-bfc808d6c

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 +75 -0
  2. package/dist/development/{browser-B5KCrHLj.d.ts → browser-BpxEZgZC.d.ts} +1 -1
  3. package/dist/development/{browser-Bhni69qL.d.mts → browser-C5z6FZmz.d.mts} +1 -1
  4. package/dist/development/{chunk-I543CM6H.js → chunk-FMMLASRE.js} +96 -105
  5. package/dist/development/{chunk-U67KY2SK.mjs → chunk-IQBGQZGG.mjs} +3 -4
  6. package/dist/development/{chunk-34FZZGUI.js → chunk-LAC6TU7N.js} +46 -76
  7. package/dist/{production/chunk-M6HTRD6I.js → development/chunk-TI7OZZDO.js} +7 -7
  8. package/dist/development/{chunk-ZEWYAG3Y.mjs → chunk-ULP5ONEK.mjs} +45 -84
  9. package/dist/development/dom-export.d.mts +10 -10
  10. package/dist/development/dom-export.d.ts +10 -10
  11. package/dist/development/dom-export.js +27 -27
  12. package/dist/development/dom-export.mjs +3 -3
  13. package/dist/{production/index-react-server-client-DFItmx61.d.ts → development/index-react-server-client-CCjKYJTH.d.ts} +18 -220
  14. package/dist/{production/index-react-server-client-P8Q6V881.d.mts → development/index-react-server-client-CipGfVBI.d.mts} +18 -220
  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 +0 -1
  20. package/dist/development/index-react-server.d.ts +0 -1
  21. package/dist/development/index-react-server.js +2 -2
  22. package/dist/development/index-react-server.mjs +2 -2
  23. package/dist/development/index.d.mts +13 -15
  24. package/dist/development/index.d.ts +13 -15
  25. package/dist/development/index.js +77 -78
  26. package/dist/development/index.mjs +3 -3
  27. package/dist/{production/instrumentation-C-GSKoyE.d.ts → development/instrumentation-BB0wRuqz.d.ts} +27 -6
  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-D9FGHcfa.d.mts → register-C1RwVJAt.d.mts} +1 -1
  33. package/dist/development/{register-C8OrDrUD.d.ts → register-ODDAAYlf.d.ts} +1 -1
  34. package/dist/development/{router-J2UInuv0.d.mts → router-CwNp5l9u.d.mts} +27 -6
  35. package/dist/production/{browser-B5KCrHLj.d.ts → browser-BpxEZgZC.d.ts} +1 -1
  36. package/dist/production/{browser-Bhni69qL.d.mts → browser-C5z6FZmz.d.mts} +1 -1
  37. package/dist/{development/chunk-3G4UDB3X.js → production/chunk-4KIWW7RS.js} +7 -7
  38. package/dist/production/{chunk-MIFJVNHY.mjs → chunk-6FO4NWD5.mjs} +3 -4
  39. package/dist/production/{chunk-B34BDRRY.mjs → chunk-AT6RJ6WZ.mjs} +45 -84
  40. package/dist/production/{chunk-GY2EIGWW.js → chunk-IVXNSP6Y.js} +46 -76
  41. package/dist/production/{chunk-LFIV6UYU.js → chunk-UPSW6CVM.js} +96 -105
  42. package/dist/production/dom-export.d.mts +10 -10
  43. package/dist/production/dom-export.d.ts +10 -10
  44. package/dist/production/dom-export.js +27 -27
  45. package/dist/production/dom-export.mjs +3 -3
  46. package/dist/{development/index-react-server-client-DFItmx61.d.ts → production/index-react-server-client-CCjKYJTH.d.ts} +18 -220
  47. package/dist/{development/index-react-server-client-P8Q6V881.d.mts → production/index-react-server-client-CipGfVBI.d.mts} +18 -220
  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 +0 -1
  53. package/dist/production/index-react-server.d.ts +0 -1
  54. package/dist/production/index-react-server.js +2 -2
  55. package/dist/production/index-react-server.mjs +2 -2
  56. package/dist/production/index.d.mts +13 -15
  57. package/dist/production/index.d.ts +13 -15
  58. package/dist/production/index.js +77 -78
  59. package/dist/production/index.mjs +3 -3
  60. package/dist/{development/instrumentation-C-GSKoyE.d.ts → production/instrumentation-BB0wRuqz.d.ts} +27 -6
  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-D9FGHcfa.d.mts → register-C1RwVJAt.d.mts} +1 -1
  66. package/dist/production/{register-C8OrDrUD.d.ts → register-ODDAAYlf.d.ts} +1 -1
  67. package/dist/production/{router-J2UInuv0.d.mts → router-CwNp5l9u.d.mts} +27 -6
  68. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,80 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.10.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
+
13
+ - If you're using this API in a custom `dataStrategy` today, you can swap to the new API at your convenience:
14
+
15
+ ```tsx
16
+ // Before
17
+ const matchesToLoad = matches.filter((m) => m.shouldLoad);
18
+
19
+ // After
20
+ const matchesToLoad = matches.filter((m) => m.shouldCallHandler());
21
+ ```
22
+
23
+ - `match.shouldRevalidateArgs` is the argument that will be passed to the route `shouldRevaliate` function
24
+
25
+ - Combined with the parameter accepted by `match.shouldCallHandler`, you can define a custom revalidation behavior for your `dataStrategy`:
26
+
27
+ ```tsx
28
+ const matchesToLoad = matches.filter((m) => {
29
+ const defaultShouldRevalidate = customRevalidationBehavior(
30
+ match.shouldRevalidateArgs,
31
+ );
32
+ return m.shouldCallHandler(defaultShouldRevalidate);
33
+ // The argument here will override the internal `defaultShouldRevalidate` value
34
+ });
35
+ ```
36
+
37
+ ### Patch Changes
38
+
39
+ - 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))
40
+ - If your `shouldRevalidate` function relied on that parameter, you may have seen unintended revalidations
41
+
42
+ - Fix `fetcher.submit` failing with plain objects containing a `tagName` property ([#14534](https://github.com/remix-run/react-router/pull/14534))
43
+
44
+ - \[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))
45
+
46
+ - 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))
47
+ - Framework Mode + Data Mode:
48
+ - `<HydratedRouter unstable_transition>`/`<RouterProvider unstable_transition>`
49
+ - When left unset (current default behavior)
50
+ - Router state updates are wrapped in `React.startTransition`
51
+ - ⚠️ This can lead to buggy behaviors if you are wrapping your own navigations/fetchers in `React.startTransition`
52
+ - You should set the flag to `true` if you run into this scenario to get the enhanced `useOptimistic` behavior (requires React 19)
53
+ - When set to `true`
54
+ - Router state updates remain wrapped in `React.startTransition` (as they are without the flag)
55
+ - `Link`/`Form` navigations will be wrapped in `React.startTransition`
56
+ - A subset of router state info will be surfaced to the UI _during_ navigations via `React.useOptimistic` (i.e., `useNavigation()`, `useFetchers()`, etc.)
57
+ - ⚠️ This is a React 19 API so you must also be React 19 to opt into this flag for Framework/Data Mode
58
+ - When set to `false`
59
+ - The router will not leverage `React.startTransition` or `React.useOptimistic` on any navigations or state changes
60
+ - Declarative Mode
61
+ - `<BrowserRouter unstable_useTransitions>`
62
+ - When left unset
63
+ - Router state updates are wrapped in `React.startTransition`
64
+ - When set to `true`
65
+ - Router state updates remain wrapped in `React.startTransition` (as they are without the flag)
66
+ - `Link`/`Form` navigations will be wrapped in `React.startTransition`
67
+ - When set to `false`
68
+ - the router will not leverage `React.startTransition` on any navigations or state changes
69
+
70
+ - 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))
71
+
72
+ - Fix internal type error in useRoute types that surfaces when skipLibCheck is disabled ([#14577](https://github.com/remix-run/react-router/pull/14577))
73
+
74
+ - Preserve `statusText` on the `ErrorResponse` instance when throwing `data()` from a route handler ([#14555](https://github.com/remix-run/react-router/pull/14555))
75
+
76
+ - Optimize href() to avoid backtracking regex on splat ([#14329](https://github.com/remix-run/react-router/pull/14329))
77
+
3
78
  ## 7.9.6
4
79
 
5
80
  ### 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-C-GSKoyE.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-BB0wRuqz.js';
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 './router-J2UInuv0.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-CwNp5l9u.mjs';
3
3
 
4
4
  type RSCRouteConfigEntryBase = {
5
5
  action?: ActionFunction;