Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 37 additions & 6 deletions packages/plugin-rsc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,44 @@ export function Page() {
}
```

### Canary and Experimental channel releases
### Using React Canary and Experimental versions

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

**Option 1: Use preview releases from pkg.pr.new**

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.

**Option 2: Install `react-server-dom-webpack` directly**

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:

- Stay up-to-date with the latest React Server Components runtime without waiting for plugin updates
- Use specific React versions (stable, canary, or experimental)

Simply install the version you need:

```json
{
"dependencies": {
"react": "canary",
"react-dom": "canary",
"react-server-dom-webpack": "canary"
}
}
```

Or for experimental:

```json
{
"dependencies": {
"react": "experimental",
"react-dom": "experimental",
"react-server-dom-webpack": "experimental"
}
}
```

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

Expand Down Expand Up @@ -561,10 +596,6 @@ Note that while there are official npm packages [`server-only`](https://www.npmj

This build-time validation is enabled by default and can be disabled by setting `validateImports: false` in the plugin options.

### `react-server-dom-webpack`

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.

## Credits

This project builds on fundamental techniques and insights from pioneering Vite RSC implementations.
Expand Down
Loading