From 4ae2f8c29e692638247941eb9096afa70469de98 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 12 Nov 2025 03:35:08 +0000 Subject: [PATCH 1/2] Initial plan From 5140618b3ad4520c010bb64a0d7be0b47d6f7236 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 12 Nov 2025 03:44:53 +0000 Subject: [PATCH 2/2] Fix all typos in packages/plugin-rsc/examples Co-authored-by: hi-ogawa <4232207+hi-ogawa@users.noreply.github.com> --- .../examples/basic/src/framework/entry.browser.tsx | 2 +- .../plugin-rsc/examples/basic/src/framework/entry.rsc.tsx | 2 +- .../examples/basic/src/framework/error-boundary.tsx | 2 +- .../examples/browser/src/framework/entry.browser.tsx | 2 +- .../examples/no-ssr/src/framework/entry.browser.tsx | 2 +- .../starter-cf-single/src/framework/entry.browser.tsx | 2 +- .../examples/starter-cf-single/src/framework/entry.rsc.tsx | 2 +- packages/plugin-rsc/examples/starter/README.md | 6 +++--- .../examples/starter/src/framework/entry.browser.tsx | 2 +- .../plugin-rsc/examples/starter/src/framework/entry.rsc.tsx | 2 +- .../examples/starter/src/framework/error-boundary.tsx | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/plugin-rsc/examples/basic/src/framework/entry.browser.tsx b/packages/plugin-rsc/examples/basic/src/framework/entry.browser.tsx index b382e632c..faa6344d7 100644 --- a/packages/plugin-rsc/examples/basic/src/framework/entry.browser.tsx +++ b/packages/plugin-rsc/examples/basic/src/framework/entry.browser.tsx @@ -79,7 +79,7 @@ async function main() { formState: initialPayload.formState, }) - // implement server HMR by trigering re-fetch/render of RSC upon server code change + // implement server HMR by triggering re-fetch/render of RSC upon server code change if (import.meta.hot) { import.meta.hot.on('rsc:update', (e) => { console.log('[vite-rsc:update]', e.file) diff --git a/packages/plugin-rsc/examples/basic/src/framework/entry.rsc.tsx b/packages/plugin-rsc/examples/basic/src/framework/entry.rsc.tsx index 7b0328a0b..cbaff43e3 100644 --- a/packages/plugin-rsc/examples/basic/src/framework/entry.rsc.tsx +++ b/packages/plugin-rsc/examples/basic/src/framework/entry.rsc.tsx @@ -100,7 +100,7 @@ export async function handleRequest({ const htmlStream = await ssrEntryModule.renderHTML(rscStream, { formState, nonce, - // allow quick simulation of javscript disabled browser + // allow quick simulation of javascript disabled browser debugNojs: url.searchParams.has('__nojs'), }) diff --git a/packages/plugin-rsc/examples/basic/src/framework/error-boundary.tsx b/packages/plugin-rsc/examples/basic/src/framework/error-boundary.tsx index d8593b633..39d916510 100644 --- a/packages/plugin-rsc/examples/basic/src/framework/error-boundary.tsx +++ b/packages/plugin-rsc/examples/basic/src/framework/error-boundary.tsx @@ -2,7 +2,7 @@ import React from 'react' -// Minimal ErrorBoundary example to handel errors globally on browser +// Minimal ErrorBoundary example to handle errors globally on browser export function GlobalErrorBoundary(props: { children?: React.ReactNode }) { return ( diff --git a/packages/plugin-rsc/examples/browser/src/framework/entry.browser.tsx b/packages/plugin-rsc/examples/browser/src/framework/entry.browser.tsx index cfbabaf83..8a7147594 100644 --- a/packages/plugin-rsc/examples/browser/src/framework/entry.browser.tsx +++ b/packages/plugin-rsc/examples/browser/src/framework/entry.browser.tsx @@ -78,7 +78,7 @@ async function main() { ) createRoot(document.body).render(browserRoot) - // implement server HMR by trigering re-fetch/render of RSC upon server code change + // implement server HMR by triggering re-fetch/render of RSC upon server code change if (import.meta.hot) { import.meta.hot.on('rsc:update', () => { fetchRscPayload() diff --git a/packages/plugin-rsc/examples/no-ssr/src/framework/entry.browser.tsx b/packages/plugin-rsc/examples/no-ssr/src/framework/entry.browser.tsx index edce31e75..1bd8134ef 100644 --- a/packages/plugin-rsc/examples/no-ssr/src/framework/entry.browser.tsx +++ b/packages/plugin-rsc/examples/no-ssr/src/framework/entry.browser.tsx @@ -70,7 +70,7 @@ async function main() { ) createRoot(document.body).render(browserRoot) - // implement server HMR by trigering re-fetch/render of RSC upon server code change + // implement server HMR by triggering re-fetch/render of RSC upon server code change if (import.meta.hot) { import.meta.hot.on('rsc:update', () => { fetchRscPayload() diff --git a/packages/plugin-rsc/examples/starter-cf-single/src/framework/entry.browser.tsx b/packages/plugin-rsc/examples/starter-cf-single/src/framework/entry.browser.tsx index a59794c2b..1ad89e1f2 100644 --- a/packages/plugin-rsc/examples/starter-cf-single/src/framework/entry.browser.tsx +++ b/packages/plugin-rsc/examples/starter-cf-single/src/framework/entry.browser.tsx @@ -76,7 +76,7 @@ async function main() { formState: initialPayload.formState, }) - // implement server HMR by trigering re-fetch/render of RSC upon server code change + // implement server HMR by triggering re-fetch/render of RSC upon server code change if (import.meta.hot) { import.meta.hot.on('rsc:update', () => { fetchRscPayload() diff --git a/packages/plugin-rsc/examples/starter-cf-single/src/framework/entry.rsc.tsx b/packages/plugin-rsc/examples/starter-cf-single/src/framework/entry.rsc.tsx index 23782948e..2dd55f3b2 100644 --- a/packages/plugin-rsc/examples/starter-cf-single/src/framework/entry.rsc.tsx +++ b/packages/plugin-rsc/examples/starter-cf-single/src/framework/entry.rsc.tsx @@ -81,7 +81,7 @@ async function handler(request: Request): Promise { >('ssr', 'index') const htmlStream = await renderHTML(rscStream, { formState, - // allow quick simulation of javscript disabled browser + // allow quick simulation of javascript disabled browser debugNojs: url.searchParams.has('__nojs'), }) diff --git a/packages/plugin-rsc/examples/starter/README.md b/packages/plugin-rsc/examples/starter/README.md index a79ba51ad..cd1117106 100644 --- a/packages/plugin-rsc/examples/starter/README.md +++ b/packages/plugin-rsc/examples/starter/README.md @@ -1,6 +1,6 @@ # Vite + RSC -This example shows how to setup a React application with [Server Component](https://react.dev/reference/rsc/server-components) features on Vite using [`@vitejs/plugin-rsc`](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-rsc). +This example shows how to set up a React application with [Server Component](https://react.dev/reference/rsc/server-components) features on Vite using [`@vitejs/plugin-rsc`](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-rsc). [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/vitejs/vite-plugin-react/tree/main/packages/plugin-rsc/examples/starter) @@ -13,12 +13,12 @@ npm run build npm run preview ``` -## API usages +## API usage See [`@vitejs/plugin-rsc`](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-rsc) for the documentation. - [`vite.config.ts`](./vite.config.ts) - - `@higoawa/vite-rsc/plugin` + - `@vitejs/plugin-rsc/plugin` - [`./src/framework/entry.rsc.tsx`](./src/framework/entry.rsc.tsx) - `@vitejs/plugin-rsc/rsc` - `import.meta.viteRsc.loadModule` diff --git a/packages/plugin-rsc/examples/starter/src/framework/entry.browser.tsx b/packages/plugin-rsc/examples/starter/src/framework/entry.browser.tsx index 0980b0148..5437fde9f 100644 --- a/packages/plugin-rsc/examples/starter/src/framework/entry.browser.tsx +++ b/packages/plugin-rsc/examples/starter/src/framework/entry.browser.tsx @@ -79,7 +79,7 @@ async function main() { formState: initialPayload.formState, }) - // implement server HMR by trigering re-fetch/render of RSC upon server code change + // implement server HMR by triggering re-fetch/render of RSC upon server code change if (import.meta.hot) { import.meta.hot.on('rsc:update', () => { fetchRscPayload() diff --git a/packages/plugin-rsc/examples/starter/src/framework/entry.rsc.tsx b/packages/plugin-rsc/examples/starter/src/framework/entry.rsc.tsx index 90808a7d3..fc291701c 100644 --- a/packages/plugin-rsc/examples/starter/src/framework/entry.rsc.tsx +++ b/packages/plugin-rsc/examples/starter/src/framework/entry.rsc.tsx @@ -99,7 +99,7 @@ export default async function handler(request: Request): Promise { >('ssr', 'index') const htmlStream = await ssrEntryModule.renderHTML(rscStream, { formState, - // allow quick simulation of javscript disabled browser + // allow quick simulation of javascript disabled browser debugNojs: url.searchParams.has('__nojs'), }) diff --git a/packages/plugin-rsc/examples/starter/src/framework/error-boundary.tsx b/packages/plugin-rsc/examples/starter/src/framework/error-boundary.tsx index d8593b633..39d916510 100644 --- a/packages/plugin-rsc/examples/starter/src/framework/error-boundary.tsx +++ b/packages/plugin-rsc/examples/starter/src/framework/error-boundary.tsx @@ -2,7 +2,7 @@ import React from 'react' -// Minimal ErrorBoundary example to handel errors globally on browser +// Minimal ErrorBoundary example to handle errors globally on browser export function GlobalErrorBoundary(props: { children?: React.ReactNode }) { return (