Skip to content

Commit

Permalink
Merge branch 'release-next' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Feb 1, 2024
2 parents f5f7511 + 3a66719 commit 7c0bfde
Show file tree
Hide file tree
Showing 18 changed files with 430 additions and 356 deletions.
6 changes: 0 additions & 6 deletions .changeset/cwv-report-id.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/static-context-error-status-code.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/throw-abort-reason.md

This file was deleted.

223 changes: 129 additions & 94 deletions CHANGELOG.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/guides/ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ app.get("*", async (req, res) => {
});
```

<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>

Once we've sent the HTML back to the browser, we'll need to "hydrate" the application on the client using `createBrowserRouter()` and `<RouterProvider>`:

```jsx filename=entry-client.jsx lines=[10-15]
Expand Down Expand Up @@ -280,6 +282,8 @@ app.get("*", (req, res) => {
app.listen(3000);
```
<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>
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`.
```js filename=client.entry.js
Expand Down Expand Up @@ -320,3 +324,6 @@ Again, we recommend you give [Remix](https://remix.run) a look. It's the best wa
[hydration]: https://react.dev/reference/react-dom/client/hydrateRoot
[hydrate-false]: ../routers/static-router-provider#hydrate
[partialhydration]: ../routers/create-browser-router#partial-hydration-data
[rendertostring]: https://react.dev/reference/react-dom/server/renderToString
[rendertopipeablestream]: https://react.dev/reference/react-dom/server/renderToPipeableStream
[defer]: https://reactrouter.com/en/main/utils/defer
5 changes: 5 additions & 0 deletions docs/upgrading/v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -947,8 +947,13 @@ const match = matchPath(

`<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.

<docs-info>We have since added implementations for [`useBlocker`][useblocker] and [`unstable_usePrompt`][useprompt] that you can use instead of `<Prompt>`</docs-info>

## What did we miss?

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.

Good luck 🤘

[useblocker]: ../hooks/use-blocker
[useprompt]: ../hooks/use-prompt

0 comments on commit 7c0bfde

Please sign in to comment.