Skip to content

Commit cecc9ce

Browse files
committed
Merge branch 'main' into release-next
2 parents f5f7511 + fdadc70 commit cecc9ce

File tree

5 files changed

+268
-261
lines changed

5 files changed

+268
-261
lines changed

CHANGELOG.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,17 +1113,17 @@ Date: 2022-11-01
11131113

11141114
### Patch Changes
11151115

1116-
- Generate correct `<a href>` values when using `createHashRouter` (#9409)
1117-
- Better handle encoding/matching with special characters in URLs and route paths (#9477, #9496)
1118-
- Generate correct `formAction` pathnames when an `index` route also has a `path` (#9486)
1116+
- Generate correct `<a href>` values when using `createHashRouter` ([#9409](https://github.com/remix-run/react-router/pull/9409))
1117+
- Better handle encoding/matching with special characters in URLs and route paths ([#9477](https://github.com/remix-run/react-router/pull/9477), [#9496](https://github.com/remix-run/react-router/pull/9496))
1118+
- Generate correct `formAction` pathnames when an `index` route also has a `path` ([#9486](https://github.com/remix-run/react-router/pull/9486))
11191119
- Respect `relative=path` prop on `NavLink` ([#9453](https://github.com/remix-run/react-router/pull/9453))
1120-
- Fix `NavLink` behavior for root urls (#9497)
1121-
- `useRoutes` should be able to return `null` when passing `locationArg` (#9485)
1122-
- Fix `initialEntries` type in `createMemoryRouter` (#9498)
1123-
- Support `basename` and relative routing in `loader`/`action` redirects (#9447)
1124-
- Ignore pathless layout routes when looking for proper submission `action` function (#9455)
1125-
- Add UMD build for `@remix-run/router` (#9446)
1126-
- Fix `createURL` in local file execution in Firefox (#9464)
1120+
- Fix `NavLink` behavior for root urls ([#9497](https://github.com/remix-run/react-router/pull/9497))
1121+
- `useRoutes` should be able to return `null` when passing `locationArg` ([#9485](https://github.com/remix-run/react-router/pull/9485))
1122+
- Fix `initialEntries` type in `createMemoryRouter` ([#9498](https://github.com/remix-run/react-router/pull/9498))
1123+
- Support `basename` and relative routing in `loader`/`action` redirects ([#9447](https://github.com/remix-run/react-router/pull/9447))
1124+
- Ignore pathless layout routes when looking for proper submission `action` function ([#9455](https://github.com/remix-run/react-router/pull/9455))
1125+
- Add UMD build for `@remix-run/router` ([#9446](https://github.com/remix-run/react-router/pull/9446))
1126+
- Fix `createURL` in local file execution in Firefox ([#9464](https://github.com/remix-run/react-router/pull/9464))
11271127

11281128
**Full Changelog**: [`v6.4.2...v6.4.3`](https://github.com/remix-run/react-router/compare/[email protected]@6.4.3)
11291129

@@ -1176,13 +1176,13 @@ Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs ov
11761176
- Perform in-page data loads and mutations with `useFetcher()`
11771177
- Defer non-critical data with `defer` and `Await`
11781178
- Manage scroll position with `<ScrollRestoration>`
1179-
- Perform path-relative navigations with `<Link relative="path">` (#9160)
1179+
- Perform path-relative navigations with `<Link relative="path">` ([#9160](https://github.com/remix-run/react-router/pull/9160))
11801180

11811181
### Patch Changes
11821182

1183-
- Path resolution is now trailing slash agnostic (#8861)
1184-
- `useLocation` returns the scoped location inside a `<Routes location>` component (#9094)
1185-
- Respect the `<Link replace>` prop if it is defined (#8779)
1183+
- Path resolution is now trailing slash agnostic ([#8861](https://github.com/remix-run/react-router/pull/8861))
1184+
- `useLocation` returns the scoped location inside a `<Routes location>` component ([#9094](https://github.com/remix-run/react-router/pull/9094))
1185+
- Respect the `<Link replace>` prop if it is defined ([#8779](https://github.com/remix-run/react-router/pull/8779))
11861186

11871187
**Full Changelog**: [`v6.3.0...v6.4.0`](https://github.com/remix-run/react-router/compare/v6.3.0...react-router%406.4.0)
11881188

@@ -1202,8 +1202,8 @@ Date: 2022-02-28
12021202

12031203
### Patch Changes
12041204

1205-
- Fixed nested splat routes that begin with special URL-safe characters (#8563)
1206-
- Fixed a bug where index routes were missing route context in some cases (#8497)
1205+
- Fixed nested splat routes that begin with special URL-safe characters ([#8563](https://github.com/remix-run/react-router/pull/8563))
1206+
- Fixed a bug where index routes were missing route context in some cases ([#8497](https://github.com/remix-run/react-router/pull/8497))
12071207

12081208
**Full Changelog**: [`v6.2.1...v6.2.2`](https://github.com/remix-run/react-router/compare/v6.2.1...v6.2.2)
12091209

@@ -1227,8 +1227,8 @@ Date: 2021-12-17
12271227

12281228
### Patch Changes
12291229

1230-
- Fixed the `RouteProps` `element` type, which should be a `ReactNode` (#8473)
1231-
- Fixed a bug with `useOutlet` for top-level routes (#8483)
1230+
- Fixed the `RouteProps` `element` type, which should be a `ReactNode` ([#8473](https://github.com/remix-run/react-router/pull/8473))
1231+
- Fixed a bug with `useOutlet` for top-level routes ([#8483](https://github.com/remix-run/react-router/pull/8483))
12321232

12331233
**Full Changelog**: [`v6.1.1...v6.2.0`](https://github.com/remix-run/react-router/compare/v6.1.1...v6.2.0)
12341234

@@ -1238,7 +1238,7 @@ Date: 2021-12-11
12381238

12391239
### Patch Changes
12401240

1241-
- In v6.1.0 we inadvertently shipped a new, undocumented API that will likely introduce bugs (#7586). We have flagged `HistoryRouter` as `unstable_HistoryRouter`, as this API will likely need to change before a new major release.
1241+
- In v6.1.0 we inadvertently shipped a new, undocumented API that will likely introduce bugs ([#7586](https://github.com/remix-run/react-router/pull/7586)). We have flagged `HistoryRouter` as `unstable_HistoryRouter`, as this API will likely need to change before a new major release.
12421242

12431243
**Full Changelog**: [`v6.1.0...v6.1.1`](https://github.com/remix-run/react-router/compare/v6.1.0...v6.1.1)
12441244

@@ -1248,14 +1248,14 @@ Date: 2021-12-10
12481248

12491249
### Minor Changes
12501250

1251-
- `<Outlet>` can now receive a `context` prop. This value is passed to child routes and is accessible via the new `useOutletContext` hook. See [the API docs](https://reactrouter.com/docs/en/v6/api#useoutletcontext) for details. (#8461)
1252-
- `<NavLink>` can now receive a child function for access to its props. (#8164)
1253-
- Improved TypeScript signature for `useMatch` and `matchPath`. For example, when you call `useMatch("foo/:bar/:baz")`, the path is parsed and the return type will be `PathMatch<"bar" | "baz">`. (#8030)
1251+
- `<Outlet>` can now receive a `context` prop. This value is passed to child routes and is accessible via the new `useOutletContext` hook. See [the API docs](https://reactrouter.com/docs/en/v6/api#useoutletcontext) for details. ([#8461](https://github.com/remix-run/react-router/pull/8461))
1252+
- `<NavLink>` can now receive a child function for access to its props. ([#8164](https://github.com/remix-run/react-router/pull/8164))
1253+
- Improved TypeScript signature for `useMatch` and `matchPath`. For example, when you call `useMatch("foo/:bar/:baz")`, the path is parsed and the return type will be `PathMatch<"bar" | "baz">`. ([#8030](https://github.com/remix-run/react-router/pull/8030))
12541254

12551255
### Patch Changes
12561256

1257-
- Fixed a bug that broke support for base64 encoded IDs on nested routes (#8291)
1258-
- A few error message improvements (#8202)
1257+
- Fixed a bug that broke support for base64 encoded IDs on nested routes ([#8291](https://github.com/remix-run/react-router/pull/8291))
1258+
- A few error message improvements ([#8202](https://github.com/remix-run/react-router/pull/8202))
12591259

12601260
**Full Changelog**: [`v6.0.2...v6.1.0`](https://github.com/remix-run/react-router/compare/v6.0.2...v6.1.0)
12611261

@@ -1265,7 +1265,7 @@ Date: 2021-11-09
12651265

12661266
### Patch Changes
12671267

1268-
- Added the `reloadDocument` prop to `<Link>`. This allows `<Link>` to function like a normal anchor tag by reloading the document after navigation while maintaining the relative `to` resolution (#8283)
1268+
- Added the `reloadDocument` prop to `<Link>`. This allows `<Link>` to function like a normal anchor tag by reloading the document after navigation while maintaining the relative `to` resolution ([#8283](https://github.com/remix-run/react-router/pull/8283))
12691269

12701270
**Full Changelog**: [`v6.0.1...v6.0.2`](https://github.com/remix-run/react-router/compare/v6.0.1...v6.0.2)
12711271

@@ -1275,8 +1275,8 @@ Date: 2021-11-05
12751275

12761276
### Patch Changes
12771277

1278-
- Add a default `<StaticRouter location>` value (#8243)
1279-
- Add invariant for using `<Route>` inside `<Routes>` to help people make the change (#8238)
1278+
- Add a default `<StaticRouter location>` value ([#8243](https://github.com/remix-run/react-router/pull/8243))
1279+
- Add invariant for using `<Route>` inside `<Routes>` to help people make the change ([#8238](https://github.com/remix-run/react-router/pull/8238))
12801280

12811281
**Full Changelog**: [`v6.0.0...v6.0.1`](https://github.com/remix-run/react-router/compare/v6.0.0...v6.0.1)
12821282

docs/guides/ssr.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ app.get("*", async (req, res) => {
139139
});
140140
```
141141

142+
<docs-info>We use [`renderToString`][rendertostring] here for simplicity since we've already loaded our data in `handler.query` and we're not using any streaming features in this simple example. If you need to support streaming features, you would need to use [`renderToPipeableStream`][rendertopipeablestream].<br/><br/>If you wish to support [`defer`][defer], you will also need to manage serializing the server-side Promises over the wire to the client (hint, just use [Remix][remix] where this is handled for you via the `Scripts` component 😉).</docs-info>
143+
142144
Once we've sent the HTML back to the browser, we'll need to "hydrate" the application on the client using `createBrowserRouter()` and `<RouterProvider>`:
143145

144146
```jsx filename=entry-client.jsx lines=[10-15]
@@ -280,6 +282,8 @@ app.get("*", (req, res) => {
280282
app.listen(3000);
281283
```
282284
285+
<docs-info>We use [`renderToString`][rendertostring] here for simplicity since we're not using any streaming features in this simple example. If you need to support streaming features, you would need to use [`renderToPipeableStream`][rendertopipeablestream].</docs-info>
286+
283287
And finally, you'll need a similar file to "hydrate" the app with your JavaScript bundle that includes the very same `App` component. Note the use of `BrowserRouter` instead of `StaticRouter`.
284288
285289
```js filename=client.entry.js
@@ -320,3 +324,6 @@ Again, we recommend you give [Remix](https://remix.run) a look. It's the best wa
320324
[hydration]: https://react.dev/reference/react-dom/client/hydrateRoot
321325
[hydrate-false]: ../routers/static-router-provider#hydrate
322326
[partialhydration]: ../routers/create-browser-router#partial-hydration-data
327+
[rendertostring]: https://react.dev/reference/react-dom/server/renderToString
328+
[rendertopipeablestream]: https://react.dev/reference/react-dom/server/renderToPipeableStream
329+
[defer]: https://reactrouter.com/en/main/utils/defer

docs/upgrading/v5.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,13 @@ const match = matchPath(
947947

948948
`<Prompt>` from v5 (along with `usePrompt` and `useBlocker` from the v6 betas) are not included in the current released version of v6. We decided we'd rather ship with what we have than take even more time to nail down a feature that isn't fully baked. We will absolutely be working on adding this back in to v6 at some point in the near future, but not for our first stable release of 6.x.
949949

950+
<docs-info>We have since added implementations for [`useBlocker`][useblocker] and [`unstable_usePrompt`][useprompt] that you can use instead of `<Prompt>`</docs-info>
951+
950952
## What did we miss?
951953

952954
Despite our best attempts at being thorough, it's very likely that we missed something. If you follow this upgrade guide and find that to be the case, please let us know. We are happy to help you figure out what to do with your v5 code to be able to upgrade and take advantage of all of the cool stuff in v6.
953955

954956
Good luck 🤘
957+
958+
[useblocker]: ../hooks/use-blocker
959+
[useprompt]: ../hooks/use-prompt

0 commit comments

Comments
 (0)