react-router 7.15.0 → 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.
- package/CHANGELOG.md +50 -10
- package/dist/development/{browser-CRsXgNrY.d.mts → browser-3AnU12UI.d.mts} +1 -1
- package/dist/development/{browser-wDl1FZEL.d.ts → browser-BOdXz9dK.d.ts} +1 -1
- package/dist/development/{chunk-5KNZJZUH.mjs → chunk-4N6VE7H7.mjs} +230 -113
- package/dist/{production/chunk-7YXKJMLN.js → development/chunk-4YRVXM2U.js} +7 -7
- package/dist/development/{chunk-Z5YQYACE.js → chunk-66UKHEGQ.js} +106 -103
- package/dist/development/{chunk-AM3XM4LS.js → chunk-D6LUOGOQ.js} +251 -137
- package/dist/development/{chunk-RMD3H4O3.mjs → chunk-RJYABSBD.mjs} +22 -21
- package/dist/{production/context-BQs41HrG.d.mts → development/context-ByvtofY2.d.mts} +7 -1
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +48 -50
- package/dist/development/dom-export.mjs +23 -25
- package/dist/{production/index-react-server-client-CSv-KZBk.d.ts → development/index-react-server-client-BS5F89FR.d.ts} +10 -2
- package/dist/{production/index-react-server-client-Ck_yZ1qL.d.mts → development/index-react-server-client-DY04-103.d.mts} +10 -2
- package/dist/development/index-react-server-client.d.mts +2 -2
- package/dist/development/index-react-server-client.d.ts +2 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.d.mts +6 -0
- package/dist/development/index-react-server.d.ts +6 -0
- package/dist/development/index-react-server.js +4 -4
- package/dist/development/index-react-server.mjs +4 -4
- package/dist/development/index.d.mts +91 -9
- package/dist/development/index.d.ts +91 -9
- package/dist/development/index.js +103 -100
- package/dist/development/index.mjs +5 -3
- package/dist/{production/instrumentation-DlJ2QV7d.d.ts → development/instrumentation-cRWWLfsU.d.ts} +7 -1
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/production/{browser-CRsXgNrY.d.mts → browser-3AnU12UI.d.mts} +1 -1
- package/dist/production/{browser-wDl1FZEL.d.ts → browser-BOdXz9dK.d.ts} +1 -1
- package/dist/production/{chunk-23ZOHYE5.mjs → chunk-6S4627ZB.mjs} +22 -21
- package/dist/production/{chunk-LCJTIOKZ.js → chunk-HUBUW7R3.js} +251 -137
- package/dist/production/{chunk-GM3PW4GX.mjs → chunk-JAKZPQZC.mjs} +230 -113
- package/dist/production/{chunk-YBQJ3ABE.js → chunk-PNZCCTKT.js} +106 -103
- package/dist/{development/chunk-2D5H3HU3.js → production/chunk-Y6IFXO7V.js} +7 -7
- package/dist/{development/context-BQs41HrG.d.mts → production/context-ByvtofY2.d.mts} +7 -1
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +48 -50
- package/dist/production/dom-export.mjs +23 -25
- package/dist/{development/index-react-server-client-CSv-KZBk.d.ts → production/index-react-server-client-BS5F89FR.d.ts} +10 -2
- package/dist/{development/index-react-server-client-Ck_yZ1qL.d.mts → production/index-react-server-client-DY04-103.d.mts} +10 -2
- package/dist/production/index-react-server-client.d.mts +2 -2
- package/dist/production/index-react-server-client.d.ts +2 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.d.mts +6 -0
- package/dist/production/index-react-server.d.ts +6 -0
- package/dist/production/index-react-server.js +4 -4
- package/dist/production/index-react-server.mjs +4 -4
- package/dist/production/index.d.mts +91 -9
- package/dist/production/index.d.ts +91 -9
- package/dist/production/index.js +103 -100
- package/dist/production/index.mjs +5 -3
- package/dist/{development/instrumentation-DlJ2QV7d.d.ts → production/instrumentation-cRWWLfsU.d.ts} +7 -1
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,40 +1,82 @@
|
|
|
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
|
+
|
|
3
53
|
## v7.15.0
|
|
4
54
|
|
|
5
55
|
### Minor Changes
|
|
6
56
|
|
|
7
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))
|
|
8
|
-
|
|
9
58
|
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
10
59
|
|
|
11
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))
|
|
12
|
-
|
|
13
61
|
- The `unstable_ServerInstrumentation`, `unstable_ClientInstrumentation`, `unstable_InstrumentRequestHandlerFunction`, `unstable_InstrumentRouterFunction`, `unstable_InstrumentRouteFunction`, and `unstable_InstrumentationHandlerResult` types have had their `unstable_` prefixes removed
|
|
14
62
|
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
15
63
|
|
|
16
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))
|
|
17
|
-
|
|
18
65
|
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
19
66
|
|
|
20
67
|
- Stabilize the `unstable_normalizePath` option on `staticHandler.query` and `staticHandler.queryRoute` as `normalizePath` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
|
|
21
|
-
|
|
22
68
|
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
23
69
|
|
|
24
70
|
- Stabilize `future.unstable_passThroughRequests` as `future.v8_passThroughRequests` ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
|
|
25
|
-
|
|
26
71
|
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
27
72
|
|
|
28
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))
|
|
29
|
-
|
|
30
74
|
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
31
75
|
|
|
32
76
|
- Stabilize `unstable_url` as `url` on `loader`, `action`, and `middleware` function args ([a993f09](https://github.com/remix-run/react-router/commit/a993f09))
|
|
33
|
-
|
|
34
77
|
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
35
78
|
|
|
36
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))
|
|
37
|
-
|
|
38
80
|
- ⚠️ This is a breaking change if you have already opted into the unstable version - you will need to update your code accordingly
|
|
39
81
|
|
|
40
82
|
### Patch Changes
|
|
@@ -44,7 +86,6 @@
|
|
|
44
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))
|
|
45
87
|
|
|
46
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))
|
|
47
|
-
|
|
48
89
|
- Performance benchmarks showed roughly a 10-15% improvement in server-side request handling performance
|
|
49
90
|
|
|
50
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))
|
|
@@ -52,7 +93,6 @@
|
|
|
52
93
|
- Cache flattened/ranked route branches to optimize server-side route matching ([#14967](https://github.com/remix-run/react-router/pull/14967))
|
|
53
94
|
|
|
54
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))
|
|
55
|
-
|
|
56
96
|
- Avoiding unnecessary calls to `matchRoutes` in data router scenarios
|
|
57
97
|
- This includes adding back the optimization that was removed in `7.6.0` ([#13562](https://github.com/remix-run/react-router/pull/13562))
|
|
58
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`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterInit } from './context-
|
|
2
|
+
import { R as RouterInit } from './context-ByvtofY2.mjs';
|
|
3
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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { R as RouterInit } from './instrumentation-
|
|
2
|
+
import { R as RouterInit } from './instrumentation-cRWWLfsU.js';
|
|
3
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;
|