react-router 7.14.2 → 7.15.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 (72) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/dist/development/{browser-I6n6wVSO.d.mts → browser-3AnU12UI.d.mts} +2 -2
  3. package/dist/{production/browser-I6n6wVSO.d.mts → development/browser-BOdXz9dK.d.ts} +2 -2
  4. package/dist/development/{chunk-EVOBXE3Y.mjs → chunk-4N6VE7H7.mjs} +567 -317
  5. package/dist/{production/chunk-PQL4HLVQ.js → development/chunk-4YRVXM2U.js} +7 -7
  6. package/dist/{production/chunk-UJQ4OJF4.js → development/chunk-66UKHEGQ.js} +153 -143
  7. package/dist/development/{chunk-ZZNWZ5Q3.js → chunk-D6LUOGOQ.js} +550 -310
  8. package/dist/development/{chunk-YQSHRJWW.mjs → chunk-RJYABSBD.mjs} +100 -80
  9. package/dist/{production/context-DGGUoDIu.d.mts → development/context-ByvtofY2.d.mts} +100 -42
  10. package/dist/development/{routeModules-7rtk67cd.d.ts → data-BVUf681J.d.mts} +64 -46
  11. package/dist/development/{routeModules-BW4a8k3I.d.mts → data-BqZ2x964.d.ts} +64 -46
  12. package/dist/development/dom-export.d.mts +8 -8
  13. package/dist/development/dom-export.d.ts +8 -8
  14. package/dist/development/dom-export.js +57 -62
  15. package/dist/development/dom-export.mjs +32 -37
  16. package/dist/{production/index-react-server-client-BBd0A0TL.d.ts → development/index-react-server-client-BS5F89FR.d.ts} +132 -122
  17. package/dist/{production/index-react-server-client-BjhKIe3u.d.mts → development/index-react-server-client-DY04-103.d.mts} +111 -101
  18. package/dist/development/index-react-server-client.d.mts +3 -3
  19. package/dist/development/index-react-server-client.d.ts +3 -3
  20. package/dist/development/index-react-server-client.js +4 -4
  21. package/dist/development/index-react-server-client.mjs +2 -2
  22. package/dist/development/index-react-server.d.mts +113 -36
  23. package/dist/development/index-react-server.d.ts +113 -36
  24. package/dist/development/index-react-server.js +63 -36
  25. package/dist/development/index-react-server.mjs +63 -36
  26. package/dist/development/index.d.mts +94 -12
  27. package/dist/development/index.d.ts +94 -12
  28. package/dist/development/index.js +193 -171
  29. package/dist/development/index.mjs +5 -3
  30. package/dist/{production/instrumentation-g0dG8UL0.d.ts → development/instrumentation-cRWWLfsU.d.ts} +79 -21
  31. package/dist/development/lib/types/internal.d.mts +2 -2
  32. package/dist/development/lib/types/internal.d.ts +2 -2
  33. package/dist/development/lib/types/internal.js +1 -1
  34. package/dist/development/lib/types/internal.mjs +1 -1
  35. package/dist/development/{register-DcBltf5q.d.ts → register-Bsscfj79.d.ts} +1 -1
  36. package/dist/{production/register-DcBltf5q.d.ts → development/register-Df8okEea.d.mts} +1 -1
  37. package/dist/production/{browser-C-UvoYvi.d.ts → browser-3AnU12UI.d.mts} +2 -2
  38. package/dist/{development/browser-C-UvoYvi.d.ts → production/browser-BOdXz9dK.d.ts} +2 -2
  39. package/dist/production/{chunk-2WLZNCK5.mjs → chunk-6S4627ZB.mjs} +100 -80
  40. package/dist/production/{chunk-X5SKXJ4A.js → chunk-HUBUW7R3.js} +550 -310
  41. package/dist/production/{chunk-LK6U7ULH.mjs → chunk-JAKZPQZC.mjs} +567 -317
  42. package/dist/{development/chunk-YZKCRDTN.js → production/chunk-PNZCCTKT.js} +153 -143
  43. package/dist/{development/chunk-PZFPF4X7.js → production/chunk-Y6IFXO7V.js} +7 -7
  44. package/dist/{development/context-DGGUoDIu.d.mts → production/context-ByvtofY2.d.mts} +100 -42
  45. package/dist/production/{routeModules-7rtk67cd.d.ts → data-BVUf681J.d.mts} +64 -46
  46. package/dist/production/{routeModules-BW4a8k3I.d.mts → data-BqZ2x964.d.ts} +64 -46
  47. package/dist/production/dom-export.d.mts +8 -8
  48. package/dist/production/dom-export.d.ts +8 -8
  49. package/dist/production/dom-export.js +57 -62
  50. package/dist/production/dom-export.mjs +32 -37
  51. package/dist/{development/index-react-server-client-BBd0A0TL.d.ts → production/index-react-server-client-BS5F89FR.d.ts} +132 -122
  52. package/dist/{development/index-react-server-client-BjhKIe3u.d.mts → production/index-react-server-client-DY04-103.d.mts} +111 -101
  53. package/dist/production/index-react-server-client.d.mts +3 -3
  54. package/dist/production/index-react-server-client.d.ts +3 -3
  55. package/dist/production/index-react-server-client.js +4 -4
  56. package/dist/production/index-react-server-client.mjs +2 -2
  57. package/dist/production/index-react-server.d.mts +113 -36
  58. package/dist/production/index-react-server.d.ts +113 -36
  59. package/dist/production/index-react-server.js +63 -36
  60. package/dist/production/index-react-server.mjs +63 -36
  61. package/dist/production/index.d.mts +94 -12
  62. package/dist/production/index.d.ts +94 -12
  63. package/dist/production/index.js +193 -171
  64. package/dist/production/index.mjs +5 -3
  65. package/dist/{development/instrumentation-g0dG8UL0.d.ts → production/instrumentation-cRWWLfsU.d.ts} +79 -21
  66. package/dist/production/lib/types/internal.d.mts +2 -2
  67. package/dist/production/lib/types/internal.d.ts +2 -2
  68. package/dist/production/lib/types/internal.js +1 -1
  69. package/dist/production/lib/types/internal.mjs +1 -1
  70. package/dist/{development/register-D9d2sMQ7.d.mts → production/register-Bsscfj79.d.ts} +1 -1
  71. package/dist/production/{register-D9d2sMQ7.d.mts → register-Df8okEea.d.mts} +1 -1
  72. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,104 @@
1
1
  # `react-router`
2
2
 
3
+ ## v7.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Update router to operate on fetcher Maps in an immutable manner to avoid delayed React renders from potentially reading an updated but not yet committed Map. This could result in brief flickers in some fetcher-driven optimistic UI scenarios. ([#15028](https://github.com/remix-run/react-router/pull/15028))
8
+ - Fix `serverLoader()` returning stale SSR data when a client navigation aborts pending hydration before the hydration `clientLoader` resolves ([#15022](https://github.com/remix-run/react-router/pull/15022))
9
+ - Fix `RouterProvider` `onError` callback not being called for synchronous initial loader errors in SPA mode ([#15039](https://github.com/remix-run/react-router/pull/15039)) ([#14942](https://github.com/remix-run/react-router/pull/14942))
10
+ - Memoize `useFetchers` to return a stable identity and only change if fetchers changed ([#15028](https://github.com/remix-run/react-router/pull/15028))
11
+ - Internal refactor to consolidate mutation request detection through shared utility ([#15033](https://github.com/remix-run/react-router/pull/15033))
12
+
13
+ ### Unstable Changes
14
+
15
+ ⚠️ _[Unstable features](https://reactrouter.com/community/api-development-strategy#unstable-flags) are not recommended for production use_
16
+
17
+ - Add a new `unstable_useRouterState()` hook that consolidates access to active and pending router states (RFC: #12358) ([#15017](https://github.com/remix-run/react-router/pull/15017))
18
+
19
+ - Data/Framework/RSC only — throws when used without a data router
20
+ - This should allow you to consolidate usages of the following hooks which will likely be deprecated and removed in a future major version
21
+ - `useLocation`
22
+ - `useSearchParams`
23
+ - `useParams`
24
+ - `useMatches`
25
+ - `useNavigationType`
26
+ - `useNavigation`
27
+
28
+ ```ts
29
+ let { active, pending } = unstable_useRouterState();
30
+
31
+ // Active is always populated with the current location
32
+ active.location; // replaces `useLocation()`
33
+ active.searchParams; // replaces `useSearchParams()[0]`
34
+ active.params; // replaces `useParams()`
35
+ active.matches; // replaces `useMatches()`
36
+ active.type; // replaces `useNavigationType()`
37
+
38
+ // Pending is only populated during a navigation
39
+ pending.location; // replaces `useNavigation().location`
40
+ pending.searchParams; // equivalent to `new URLSearchParams(useNavigation().search)`
41
+ pending.params; // Not directly accessible today
42
+ pending.matches; // Not directly accessible today
43
+ pending.type; // Not directly accessible today
44
+ pending.state; // replaces `useNavigation().state`
45
+ pending.formMethod; // replaces useNavigation().formMethod
46
+ pending.formAction; // replaces useNavigation().formAction
47
+ pending.formEncType; // replaces useNavigation().formEncType
48
+ pending.formData; // replaces useNavigation().formData
49
+ pending.json; // replaces useNavigation().json
50
+ pending.text; // replaces useNavigation().text
51
+ ```
52
+
53
+ ## v7.15.0
54
+
55
+ ### Minor Changes
56
+
57
+ - Stabilize `unstable_defaultShouldRevalidate` as `defaultShouldRevalidate` on `<Link>`, `<Form>`, `useLinkClickHandler`, `useSubmit`, `fetcher.submit`, and `setSearchParams` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
58
+ - ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
59
+
60
+ - Stabilize the instrumentation APIs. `unstable_instrumentations` is now `instrumentations` and `unstable_pattern` is now `pattern` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
61
+ - The `unstable_ServerInstrumentation`, `unstable_ClientInstrumentation`, `unstable_InstrumentRequestHandlerFunction`, `unstable_InstrumentRouterFunction`, `unstable_InstrumentRouteFunction`, and `unstable_InstrumentationHandlerResult` types have had their `unstable_` prefixes removed
62
+ - ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
63
+
64
+ - Stabilize `unstable_mask` as `mask` on `<Link>`, `useLinkClickHandler`, and `useNavigate`, and rename the corresponding `Location.unstable_mask` field to `Location.mask` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
65
+ - ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
66
+
67
+ - Stabilize the `unstable_normalizePath` option on `staticHandler.query` and `staticHandler.queryRoute` as `normalizePath` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
68
+ - ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
69
+
70
+ - Stabilize `future.unstable_passThroughRequests` as `future.v8_passThroughRequests` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
71
+ - ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
72
+
73
+ - Remove `unstable_subResourceIntegrity` from the runtime `FutureConfig` type; the flag is now controlled by the top-level `subResourceIntegrity` option in `react-router.config.ts` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
74
+ - ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
75
+
76
+ - Stabilize `unstable_url` as `url` on `loader`, `action`, and `middleware` function args ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
77
+ - ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
78
+
79
+ - Stabilize `unstable_useTransitions` as `useTransitions` on `<BrowserRouter>`, `<HashRouter>`, `<HistoryRouter>`, `<MemoryRouter>`, `<Router>`, `<RouterProvider>`, `<HydratedRouter>`, and `useLinkClickHandler` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
80
+ - ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
81
+
82
+ ### Patch Changes
83
+
84
+ - Add `nonce` to `<Scripts>` `<link rel="modulepreload">` elements (if provided) ([af5d49b](https://github.com/remix-run/react-router/commit/af5d49b))
85
+
86
+ - Fix a bug with `unstable_defaultShouldRevalidate={false}` where parent routes that did not export a `shouldRevalidate` function could be incorrectly included in the single fetch call for new child route data ([#15012](https://github.com/remix-run/react-router/pull/15012))
87
+
88
+ - Improve server-side route matching performance by pre-computing flattened/cached route branches ([#14967](https://github.com/remix-run/react-router/pull/14967)) ([af5d49b](https://github.com/remix-run/react-router/commit/af5d49b))
89
+ - Performance benchmarks showed roughly a 10-15% improvement in server-side request handling performance
90
+
91
+ - Mark `mask` as an optional field in `Location` for easier mocking in unit tests ([#14999](https://github.com/remix-run/react-router/pull/14999))
92
+
93
+ - Cache flattened/ranked route branches to optimize server-side route matching ([#14967](https://github.com/remix-run/react-router/pull/14967))
94
+
95
+ - Improve route matching performance in Framework/Data Mode ([#14971](https://github.com/remix-run/react-router/pull/14971)) ([af5d49b](https://github.com/remix-run/react-router/commit/af5d49b))
96
+ - Avoiding unnecessary calls to `matchRoutes` in data router scenarios
97
+ - This includes adding back the optimization that was removed in `7.6.0` ([#13562](https://github.com/remix-run/react-router/pull/13562))
98
+ - The issues that prompted the revert have been addressed by using the available router `matches` but always updating `match.route` to the latest route in the `manifest`
99
+ - Leverage pre-computed pre-computing flattened/cached route branches during client side route matching
100
+ - Performance benchmarks showed roughly a 15-30% improvement in server-side request handling performance
101
+
3
102
  ## v7.14.2
4
103
 
5
104
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { R as RouterInit } from './context-DGGUoDIu.mjs';
3
- 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 } from './routeModules-BW4a8k3I.mjs';
2
+ import { R as RouterInit } from './context-ByvtofY2.mjs';
3
+ 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 } from './data-BVUf681J.mjs';
4
4
 
5
5
  declare function getRequest(): Request;
6
6
  type RSCRouteConfigEntryBase = {
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { R as RouterInit } from './context-DGGUoDIu.mjs';
3
- 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 } from './routeModules-BW4a8k3I.mjs';
2
+ import { R as RouterInit } from './instrumentation-cRWWLfsU.js';
3
+ 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 } from './data-BqZ2x964.js';
4
4
 
5
5
  declare function getRequest(): Request;
6
6
  type RSCRouteConfigEntryBase = {