Skip to content

Commit 5567158

Browse files
committed
Merge branch 'release-next'
2 parents c47464c + 69ba50e commit 5567158

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3058
-410
lines changed

CHANGELOG.md

Lines changed: 95 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -13,122 +13,128 @@ We manage release notes in this file instead of the paginated Github Releases Pa
1313
<summary>Table of Contents</summary>
1414

1515
- [React Router Releases](#react-router-releases)
16-
- [v6.20.1](#v6201)
17-
- [Patch Changes](#patch-changes)
18-
- [v6.20.0](#v6200)
16+
- [v6.21.0](#v6210)
17+
- [What's Changed](#whats-changed)
18+
- [`future.v7_relativeSplatPath`](#futurev7_relativesplatpath)
19+
- [Partial Hydration](#partial-hydration)
1920
- [Minor Changes](#minor-changes)
21+
- [Patch Changes](#patch-changes)
22+
- [v6.20.1](#v6201)
2023
- [Patch Changes](#patch-changes-1)
21-
- [v6.19.0](#v6190)
22-
- [What's Changed](#whats-changed)
23-
- [`unstable_flushSync` API](#unstable_flushsync-api)
24+
- [v6.20.0](#v6200)
2425
- [Minor Changes](#minor-changes-1)
2526
- [Patch Changes](#patch-changes-2)
26-
- [v6.18.0](#v6180)
27+
- [v6.19.0](#v6190)
2728
- [What's Changed](#whats-changed-1)
28-
- [New Fetcher APIs](#new-fetcher-apis)
29-
- [Persistence Future Flag (`future.v7_fetcherPersist`)](#persistence-future-flag-futurev7_fetcherpersist)
29+
- [`unstable_flushSync` API](#unstable_flushsync-api)
3030
- [Minor Changes](#minor-changes-2)
3131
- [Patch Changes](#patch-changes-3)
32-
- [v6.17.0](#v6170)
32+
- [v6.18.0](#v6180)
3333
- [What's Changed](#whats-changed-2)
34-
- [View Transitions 🚀](#view-transitions-)
34+
- [New Fetcher APIs](#new-fetcher-apis)
35+
- [Persistence Future Flag (`future.v7_fetcherPersist`)](#persistence-future-flag-futurev7_fetcherpersist)
3536
- [Minor Changes](#minor-changes-3)
3637
- [Patch Changes](#patch-changes-4)
37-
- [v6.16.0](#v6160)
38+
- [v6.17.0](#v6170)
39+
- [What's Changed](#whats-changed-3)
40+
- [View Transitions 🚀](#view-transitions-)
3841
- [Minor Changes](#minor-changes-4)
3942
- [Patch Changes](#patch-changes-5)
40-
- [v6.15.0](#v6150)
43+
- [v6.16.0](#v6160)
4144
- [Minor Changes](#minor-changes-5)
4245
- [Patch Changes](#patch-changes-6)
43-
- [v6.14.2](#v6142)
46+
- [v6.15.0](#v6150)
47+
- [Minor Changes](#minor-changes-6)
4448
- [Patch Changes](#patch-changes-7)
45-
- [v6.14.1](#v6141)
49+
- [v6.14.2](#v6142)
4650
- [Patch Changes](#patch-changes-8)
47-
- [v6.14.0](#v6140)
48-
- [What's Changed](#whats-changed-3)
49-
- [JSON/Text Submissions](#jsontext-submissions)
50-
- [Minor Changes](#minor-changes-6)
51+
- [v6.14.1](#v6141)
5152
- [Patch Changes](#patch-changes-9)
52-
- [v6.13.0](#v6130)
53+
- [v6.14.0](#v6140)
5354
- [What's Changed](#whats-changed-4)
55+
- [JSON/Text Submissions](#jsontext-submissions)
5456
- [Minor Changes](#minor-changes-7)
5557
- [Patch Changes](#patch-changes-10)
56-
- [v6.12.1](#v6121)
57-
- [Patch Changes](#patch-changes-11)
58-
- [v6.12.0](#v6120)
58+
- [v6.13.0](#v6130)
5959
- [What's Changed](#whats-changed-5)
60-
- [`React.startTransition` support](#reactstarttransition-support)
6160
- [Minor Changes](#minor-changes-8)
61+
- [Patch Changes](#patch-changes-11)
62+
- [v6.12.1](#v6121)
6263
- [Patch Changes](#patch-changes-12)
63-
- [v6.11.2](#v6112)
64+
- [v6.12.0](#v6120)
65+
- [What's Changed](#whats-changed-6)
66+
- [`React.startTransition` support](#reactstarttransition-support)
67+
- [Minor Changes](#minor-changes-9)
6468
- [Patch Changes](#patch-changes-13)
65-
- [v6.11.1](#v6111)
69+
- [v6.11.2](#v6112)
6670
- [Patch Changes](#patch-changes-14)
67-
- [v6.11.0](#v6110)
68-
- [Minor Changes](#minor-changes-9)
71+
- [v6.11.1](#v6111)
6972
- [Patch Changes](#patch-changes-15)
70-
- [v6.10.0](#v6100)
71-
- [What's Changed](#whats-changed-6)
73+
- [v6.11.0](#v6110)
7274
- [Minor Changes](#minor-changes-10)
7375
- [Patch Changes](#patch-changes-16)
74-
- [v6.9.0](#v690)
76+
- [v6.10.0](#v6100)
7577
- [What's Changed](#whats-changed-7)
76-
- [`Component`/`ErrorBoundary` route properties](#componenterrorboundary-route-properties)
77-
- [Introducing Lazy Route Modules](#introducing-lazy-route-modules)
7878
- [Minor Changes](#minor-changes-11)
7979
- [Patch Changes](#patch-changes-17)
80-
- [v6.8.2](#v682)
80+
- [v6.9.0](#v690)
81+
- [What's Changed](#whats-changed-8)
82+
- [`Component`/`ErrorBoundary` route properties](#componenterrorboundary-route-properties)
83+
- [Introducing Lazy Route Modules](#introducing-lazy-route-modules)
84+
- [Minor Changes](#minor-changes-12)
8185
- [Patch Changes](#patch-changes-18)
82-
- [v6.8.1](#v681)
86+
- [v6.8.2](#v682)
8387
- [Patch Changes](#patch-changes-19)
84-
- [v6.8.0](#v680)
85-
- [Minor Changes](#minor-changes-12)
88+
- [v6.8.1](#v681)
8689
- [Patch Changes](#patch-changes-20)
87-
- [v6.7.0](#v670)
90+
- [v6.8.0](#v680)
8891
- [Minor Changes](#minor-changes-13)
8992
- [Patch Changes](#patch-changes-21)
90-
- [v6.6.2](#v662)
93+
- [v6.7.0](#v670)
94+
- [Minor Changes](#minor-changes-14)
9195
- [Patch Changes](#patch-changes-22)
92-
- [v6.6.1](#v661)
96+
- [v6.6.2](#v662)
9397
- [Patch Changes](#patch-changes-23)
94-
- [v6.6.0](#v660)
95-
- [What's Changed](#whats-changed-8)
96-
- [Minor Changes](#minor-changes-14)
98+
- [v6.6.1](#v661)
9799
- [Patch Changes](#patch-changes-24)
98-
- [v6.5.0](#v650)
100+
- [v6.6.0](#v660)
99101
- [What's Changed](#whats-changed-9)
100102
- [Minor Changes](#minor-changes-15)
101103
- [Patch Changes](#patch-changes-25)
102-
- [v6.4.5](#v645)
104+
- [v6.5.0](#v650)
105+
- [What's Changed](#whats-changed-10)
106+
- [Minor Changes](#minor-changes-16)
103107
- [Patch Changes](#patch-changes-26)
104-
- [v6.4.4](#v644)
108+
- [v6.4.5](#v645)
105109
- [Patch Changes](#patch-changes-27)
106-
- [v6.4.3](#v643)
110+
- [v6.4.4](#v644)
107111
- [Patch Changes](#patch-changes-28)
108-
- [v6.4.2](#v642)
112+
- [v6.4.3](#v643)
109113
- [Patch Changes](#patch-changes-29)
110-
- [v6.4.1](#v641)
114+
- [v6.4.2](#v642)
111115
- [Patch Changes](#patch-changes-30)
116+
- [v6.4.1](#v641)
117+
- [Patch Changes](#patch-changes-31)
112118
- [v6.4.0](#v640)
113-
- [What's Changed](#whats-changed-10)
119+
- [What's Changed](#whats-changed-11)
114120
- [Remix Data APIs](#remix-data-apis)
115-
- [Patch Changes](#patch-changes-31)
121+
- [Patch Changes](#patch-changes-32)
116122
- [v6.3.0](#v630)
117-
- [Minor Changes](#minor-changes-16)
123+
- [Minor Changes](#minor-changes-17)
118124
- [v6.2.2](#v622)
119-
- [Patch Changes](#patch-changes-32)
120-
- [v6.2.1](#v621)
121125
- [Patch Changes](#patch-changes-33)
122-
- [v6.2.0](#v620)
123-
- [Minor Changes](#minor-changes-17)
126+
- [v6.2.1](#v621)
124127
- [Patch Changes](#patch-changes-34)
125-
- [v6.1.1](#v611)
126-
- [Patch Changes](#patch-changes-35)
127-
- [v6.1.0](#v610)
128+
- [v6.2.0](#v620)
128129
- [Minor Changes](#minor-changes-18)
130+
- [Patch Changes](#patch-changes-35)
131+
- [v6.1.1](#v611)
129132
- [Patch Changes](#patch-changes-36)
130-
- [v6.0.1](#v601)
133+
- [v6.1.0](#v610)
134+
- [Minor Changes](#minor-changes-19)
131135
- [Patch Changes](#patch-changes-37)
136+
- [v6.0.1](#v601)
137+
- [Patch Changes](#patch-changes-38)
132138
- [v6.0.0](#v600)
133139

134140
</details>
@@ -152,6 +158,35 @@ To add a new release, copy from this template:
152158
153159
-->
154160

161+
## v6.21.0
162+
163+
### What's Changed
164+
165+
#### `future.v7_relativeSplatPath`
166+
167+
We fixed a splat route path-resolution bug in `6.19.0`, but later determined a large number of applications were relying on the buggy behavior, so we reverted the fix in `6.20.1` (see [#10983](https://github.com/remix-run/react-router/issues/10983), [#11052](https://github.com/remix-run/react-router/issues/11052), [#11078](https://github.com/remix-run/react-router/issues/11078)).
168+
169+
The buggy behavior is that the default behavior when resolving relative paths inside a splat route would _ignore_ any splat (`*`) portion of the current route path. When the future flag is enabled, splat portions are included in relative path logic within splat routes.
170+
171+
For more information, please refer to the [`useResolvedPath` docs](https://reactrouter.com/hooks/use-resolved-path#splat-paths) and/or the [detailed changelog entry](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md#6210).
172+
173+
#### Partial Hydration
174+
175+
We added a new `future.v7_partialHydration` future flag for the `@remix-run/router` that enables partial hydration of a data router when Server-Side Rendering. This allows you to provide `hydrationData.loaderData` that has values for _some_ initially matched route loaders, but not all. When this flag is enabled, the router will call `loader` functions for routes that do not have hydration loader data during `router.initialize()`, and it will render down to the deepest provided `HydrateFallback` (up to the first route without hydration data) while it executes the unhydrated routes. ([#11033](https://github.com/remix-run/react-router/pull/11033))
176+
177+
### Minor Changes
178+
179+
- Add a new `future.v7_relativeSplatPath` flag to implement a breaking bug fix to relative routing when inside a splat route. ([#11087](https://github.com/remix-run/react-router/pull/11087))
180+
- Add a new `future.v7_partialHydration` future flag that enables partial hydration of a data router when Server-Side Rendering ([#11033](https://github.com/remix-run/react-router/pull/11033))
181+
182+
### Patch Changes
183+
184+
- Properly handle falsy error values in `ErrorBoundary`'s ([#11071](https://github.com/remix-run/react-router/pull/11071))
185+
- Catch and bubble errors thrown when trying to unwrap responses from `loader`/`action` functions ([#11061](https://github.com/remix-run/react-router/pull/11061))
186+
- Fix `relative="path"` issue when rendering `Link`/`NavLink` outside of matched routes ([#11062](https://github.com/remix-run/react-router/pull/11062))
187+
188+
**Full Changelog**: [`v6.20.1...v6.21.0`](https://github.com/remix-run/react-router/compare/[email protected]@6.21.0)
189+
155190
## v6.20.1
156191

157192
### Patch Changes

docs/components/form.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ If you need to post to a different route, then add an action prop:
109109

110110
- [Index Search Param][indexsearchparam] (index vs parent route disambiguation)
111111

112+
<docs-info>Please see the [Splat Paths][relativesplatpath] section on the `useResolvedPath` docs for a note on the behavior of the `future.v7_relativeSplatPath` future flag for relative `useNavigate()` behavior within splat routes</docs-info>
113+
112114
## `method`
113115

114116
This determines the [HTTP verb](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods) to be used. The same as plain HTML [form method][htmlform-method], except it also supports "put", "patch", and "delete" in addition to "get" and "post". The default is "get".
@@ -394,3 +396,4 @@ You can access those values from the `request.url`
394396
[history-state]: https://developer.mozilla.org/en-US/docs/Web/API/History/state
395397
[use-view-transition-state]: ../hooks//use-view-transition-state
396398
[view-transitions]: https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API
399+
[relativesplatpath]: ../hooks/use-resolved-path#splat-paths

docs/components/link.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ A relative `<Link to>` value (that does not begin with `/`) resolves relative to
6363

6464
<docs-info>`<Link to>` with a `..` behaves differently from a normal `<a href>` when the current URL ends with `/`. `<Link to>` ignores the trailing slash, and removes one URL segment for each `..`. But an `<a href>` value handles `..` differently when the current URL ends with `/` vs when it does not.</docs-info>
6565

66+
<docs-info>Please see the [Splat Paths][relativesplatpath] section on the `useResolvedPath` docs for a note on the behavior of the `future.v7_relativeSplatPath` future flag for relative `<Link to>` behavior within splat routes</docs-info>
67+
6668
## `relative`
6769

6870
By default, links are relative to the route hierarchy (`relative="route"`), so `..` will go up one `Route` level from the current contextual route. Occasionally, you may find that you have matching URL patterns that do not make sense to be nested, and you'd prefer to use relative _path_ routing from the current contextual route path. You can opt into this behavior with `relative="path"`:
@@ -202,3 +204,4 @@ function ImageLink(to) {
202204
[view-transitions]: https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API
203205
[picking-a-router]: ../routers/picking-a-router
204206
[navlink]: ./nav-link
207+
[relativesplatpath]: ../hooks/use-resolved-path#splat-paths

docs/guides/api-development-strategy.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ const router = createBrowserRouter(routes, {
6363
});
6464
```
6565

66-
| Flag | Description |
67-
| ------------------------ | --------------------------------------------------------------------- |
68-
| `v7_fetcherPersist` | Delay active fetcher cleanup until they return to an `idle` state |
69-
| `v7_normalizeFormMethod` | Normalize `useNavigation().formMethod` to be an uppercase HTTP Method |
70-
| `v7_prependBasename` | Prepend the router basename to navigate/fetch paths |
66+
| Flag | Description |
67+
| ------------------------------------------- | --------------------------------------------------------------------- |
68+
| `v7_fetcherPersist` | Delay active fetcher cleanup until they return to an `idle` state |
69+
| `v7_normalizeFormMethod` | Normalize `useNavigation().formMethod` to be an uppercase HTTP Method |
70+
| [`v7_partialHydration`][partialhydration] | Support partial hydration for Server-rendered apps |
71+
| `v7_prependBasename` | Prepend the router basename to navigate/fetch paths |
72+
| [`v7_relativeSplatPath`][relativesplatpath] | Fix buggy relative path resolution in splat routes |
7173

7274
### React Router Future Flags
7375

@@ -94,3 +96,5 @@ These flags apply to both Data and non-Data Routers and are passed to the render
9496
[feature-flowchart]: https://remix.run/docs-images/feature-flowchart.png
9597
[picking-a-router]: ../routers/picking-a-router
9698
[starttransition]: https://react.dev/reference/react/startTransition
99+
[partialhydration]: ../routers/create-browser-router#partial-hydration-data
100+
[relativesplatpath]: ../hooks/use-resolved-path#splat-paths

docs/guides/ssr.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ And with that you've got a server-side-rendered and hydrated application! For a
165165

166166
As mentioned above, server-side rendering is tricky at scale and for production-grade applications, and we strongly recommend checking out [Remix][remix] if that's your goal. But if you are going the manual route, here's a few additional concepts you may need to consider:
167167

168+
#### Hydration
169+
170+
A core concept of Server Side Rendering is [hydration][hydration] which involves "attaching" a client-side React application to server-rendered HTML. To do this correctly, we need to create our client-side React Router application in the same state that it was in during the server render. When your server render loaded data via `loader` functions, we need to send this data up so that we can create our client router with the same loader data for the initial render/hydration.
171+
172+
The basic usages of `<StaticRouterProvider>` and `createBrowserRouter` shown in this guide handle this for you internally, but if you need to take control over the hydration process you can disable the automatic hydration process via [`<StaticRouterProvider hydrate={false} />`][hydrate-false].
173+
174+
In some advanced use cases, you may want to partially hydrate a client-side React Router application. You can do this via the [`future.v7_partialHydration`][partialhydration] flag passed to `createBrowserRouter`.
175+
168176
#### Redirects
169177

170178
If any loaders redirect, `handler.query` will return the `Response` directly so you should check that and send a redirect response instead of attempting to render an HTML document:
@@ -309,3 +317,6 @@ Again, we recommend you give [Remix](https://remix.run) a look. It's the best wa
309317
[createstaticrouter]: ../routers/create-static-router
310318
[staticrouterprovider]: ../routers/static-router-provider
311319
[lazy]: ../route/lazy
320+
[hydration]: https://react.dev/reference/react-dom/client/hydrateRoot
321+
[hydrate-false]: ../routers/static-router-provider#hydrate
322+
[partialhydration]: ../routers/create-browser-router#partial-hydration-data

docs/hooks/use-href.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ declare function useHref(
1818

1919
The `useHref` hook returns a URL that may be used to link to the given `to` location, even outside of React Router.
2020

21-
> **Tip:**
22-
>
23-
> You may be interested in taking a look at the source for the `<Link>`
24-
> component in `react-router-dom` to see how it uses `useHref` internally to
25-
> determine its own `href` value.
21+
<docs-info>You may be interested in taking a look at the source for the `<Link>` component in `react-router-dom` to see how it uses `useHref` internally to determine its own `href` value</docs-info>
22+
23+
<docs-info>Please see the [Splat Paths][relativesplatpath] section on the `useResolvedPath` docs for a note on the behavior of the `future.v7_relativeSplatPath` future flag for relative `useHref()` behavior within splat routes</docs-info>
24+
25+
[relativesplatpath]: ../hooks/use-resolved-path#splat-paths

docs/hooks/use-navigate.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ The `navigate` function has two signatures:
5454
- Either pass a `To` value (same type as `<Link to>`) with an optional second `options` argument (similar to the props you can pass to [`<Link>`][link]), or
5555
- Pass the delta you want to go in the history stack. For example, `navigate(-1)` is equivalent to hitting the back button
5656

57+
<docs-info>Please see the [Splat Paths][relativesplatpath] section on the `useResolvedPath` docs for a note on the behavior of the `future.v7_relativeSplatPath` future flag for relative `useNavigate()` behavior within splat routes</docs-info>
58+
5759
## `options.replace`
5860

5961
Specifying `replace: true` will cause the navigation to replace the current entry in the history stack instead of adding a new one.
@@ -119,3 +121,4 @@ The `unstable_viewTransition` option enables a [View Transition][view-transition
119121
[picking-a-router]: ../routers/picking-a-router
120122
[flush-sync]: https://react.dev/reference/react-dom/flushSync
121123
[start-transition]: https://react.dev/reference/react/startTransition
124+
[relativesplatpath]: ../hooks/use-resolved-path#splat-paths

0 commit comments

Comments
 (0)