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 021a65c7..ee1cd96f 100644 --- a/packages/plugin-rsc/examples/basic/src/framework/entry.browser.tsx +++ b/packages/plugin-rsc/examples/basic/src/framework/entry.browser.tsx @@ -83,7 +83,7 @@ async function main() { }) } - // 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 8d99f033..decaa8f8 100644 --- a/packages/plugin-rsc/examples/basic/src/framework/entry.rsc.tsx +++ b/packages/plugin-rsc/examples/basic/src/framework/entry.rsc.tsx @@ -110,7 +110,7 @@ export async function handleRequest({ const ssrResult = 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/browser/src/framework/entry.browser.tsx b/packages/plugin-rsc/examples/browser/src/framework/entry.browser.tsx index cfbabaf8..8a714759 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 edce31e7..1bd8134e 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 b3c2485c..e91f2bfc 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 @@ -83,7 +83,7 @@ async function main() { }) } - // 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 206a6e75..a826b40d 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 @@ -91,7 +91,7 @@ async function handler(request: Request): Promise { >('ssr', 'index') const ssrResult = 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 a79ba51a..cd111710 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 b3c2485c..e91f2bfc 100644 --- a/packages/plugin-rsc/examples/starter/src/framework/entry.browser.tsx +++ b/packages/plugin-rsc/examples/starter/src/framework/entry.browser.tsx @@ -83,7 +83,7 @@ async function main() { }) } - // 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 9211777d..8a351e4a 100644 --- a/packages/plugin-rsc/examples/starter/src/framework/entry.rsc.tsx +++ b/packages/plugin-rsc/examples/starter/src/framework/entry.rsc.tsx @@ -109,7 +109,7 @@ export default async function handler(request: Request): Promise { >('ssr', 'index') const ssrResult = await ssrEntryModule.renderHTML(rscStream, { formState, - // allow quick simulation of javscript disabled browser + // allow quick simulation of javascript disabled browser debugNojs: url.searchParams.has('__nojs'), })