From b2470dd864b92c36b01104d1f10b993d6e926acc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:39:17 +0000 Subject: [PATCH 1/3] Initial plan From 2c4abbb193019e2eb45fafee0f9c2f165f3db3fb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:43:09 +0000 Subject: [PATCH 2/3] Update plugin-rsc README to combine canary/experimental and react-server-dom-webpack sections Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com> --- packages/plugin-rsc/README.md | 41 +++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/packages/plugin-rsc/README.md b/packages/plugin-rsc/README.md index 93a623978..0896b37c7 100644 --- a/packages/plugin-rsc/README.md +++ b/packages/plugin-rsc/README.md @@ -445,9 +445,39 @@ 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: Install `react-server-dom-webpack` directly (Recommended)** + +The plugin will automatically use a locally installed `react-server-dom-webpack` instead of the vendored version. 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" + } +} +``` + +**Option 2: Use preview releases from pkg.pr.new** + +Alternatively, 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. ### Using `@vitejs/plugin-rsc` as a framework package's `dependencies` @@ -561,9 +591,12 @@ 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` +### Customizing `react-server-dom-webpack` + +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: -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. +- Stay up-to-date with the latest React Server Components runtime without waiting for plugin updates +- Use specific React versions (stable, canary, or experimental) - see [Using React Canary and Experimental versions](#using-react-canary-and-experimental-versions) above ## Credits From 4311fae4da89053faeb3142671a1fbdcda0b7faa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 13:45:08 +0000 Subject: [PATCH 3/3] Address feedback: flip option order and merge Customizing section into Option 2 Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com> --- packages/plugin-rsc/README.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/plugin-rsc/README.md b/packages/plugin-rsc/README.md index 0896b37c7..ab3a9b1b5 100644 --- a/packages/plugin-rsc/README.md +++ b/packages/plugin-rsc/README.md @@ -449,9 +449,18 @@ export function Page() { 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: Install `react-server-dom-webpack` directly (Recommended)** +**Option 1: Use preview releases from pkg.pr.new** -The plugin will automatically use a locally installed `react-server-dom-webpack` instead of the vendored version. Simply install the version you need: +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 { @@ -475,10 +484,6 @@ Or for experimental: } ``` -**Option 2: Use preview releases from pkg.pr.new** - -Alternatively, 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. - ### Using `@vitejs/plugin-rsc` as a framework package's `dependencies` By default, `@vitejs/plugin-rsc` is expected to be used as `peerDependencies` similar to `react` and `react-dom`. When `@vitejs/plugin-rsc` is not available at the project root (e.g., in `node_modules/@vitejs/plugin-rsc`), you will see warnings like: @@ -591,13 +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. -### Customizing `react-server-dom-webpack` - -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) - see [Using React Canary and Experimental versions](#using-react-canary-and-experimental-versions) above - ## Credits This project builds on fundamental techniques and insights from pioneering Vite RSC implementations.