Skip to content

Commit 5907c63

Browse files
Copilothi-ogawa
andauthored
docs(rsc): combine canary/experimental and react-server-dom-webpack sections (#942)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com> Co-authored-by: Hiroshi Ogawa <hi.ogawa.zz@gmail.com>
1 parent 99d0fc4 commit 5907c63

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

packages/plugin-rsc/README.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,44 @@ export function Page() {
445445
}
446446
```
447447

448-
### Canary and Experimental channel releases
448+
### Using React Canary and Experimental versions
449449

450-
See https://github.com/vitejs/vite-plugin-react/pull/524 for how to install the package for React [canary](https://react.dev/community/versioning-policy#canary-channel) and [experimental](https://react.dev/community/versioning-policy#all-release-channels) usages.
450+
To use React's [canary](https://react.dev/community/versioning-policy#canary-channel) or [experimental](https://react.dev/community/versioning-policy#all-release-channels) versions with `@vitejs/plugin-rsc`, you have two options:
451+
452+
**Option 1: Use preview releases from pkg.pr.new**
453+
454+
You can use preview releases that bundle specific React versions. See [PR #524](https://github.com/vitejs/vite-plugin-react/pull/524) for instructions on installing these preview packages.
455+
456+
**Option 2: Install `react-server-dom-webpack` directly**
457+
458+
By default, `@vitejs/plugin-rsc` includes a vendored version of `react-server-dom-webpack`. However, when `react-server-dom-webpack` is installed in your project's dependencies, the plugin will automatically use it instead. This allows you to:
459+
460+
- Stay up-to-date with the latest React Server Components runtime without waiting for plugin updates
461+
- Use specific React versions (stable, canary, or experimental)
462+
463+
Simply install the version you need:
464+
465+
```json
466+
{
467+
"dependencies": {
468+
"react": "canary",
469+
"react-dom": "canary",
470+
"react-server-dom-webpack": "canary"
471+
}
472+
}
473+
```
474+
475+
Or for experimental:
476+
477+
```json
478+
{
479+
"dependencies": {
480+
"react": "experimental",
481+
"react-dom": "experimental",
482+
"react-server-dom-webpack": "experimental"
483+
}
484+
}
485+
```
451486

452487
### Using `@vitejs/plugin-rsc` as a framework package's `dependencies`
453488

@@ -561,10 +596,6 @@ Note that while there are official npm packages [`server-only`](https://www.npmj
561596
562597
This build-time validation is enabled by default and can be disabled by setting `validateImports: false` in the plugin options.
563598
564-
### `react-server-dom-webpack`
565-
566-
Currently `@vitejs/plugin-rsc` includes a vendored version of `react-server-dom-webpack`. However, when `react-server-dom-webpack` is installed in user project's dependencies, the plugin will automatically use it instead. This allows you to stay up-to-date with the latest React Server Components runtime without waiting for plugin updates.
567-
568599
## Credits
569600
570601
This project builds on fundamental techniques and insights from pioneering Vite RSC implementations.

0 commit comments

Comments
 (0)