Skip to content

Commit bd417ef

Browse files
hi-ogawaOpenCode
andauthored
docs(rsc): document /react/* entries and update examples list (#1311)
Co-authored-by: Hiroshi Ogawa <4232207+hi-ogawa@users.noreply.github.com> Co-authored-by: OpenCode <noreply@opencode.ai>
1 parent cd6c50f commit bd417ef

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

packages/plugin-rsc/README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ npm create vite@latest -- --template rsc
2727

2828
- [`./examples/basic`](./examples/basic) - Advanced RSC features and testing
2929
- This is mainly used for e2e testing and includes various advanced RSC usages (e.g. `"use cache"` example).
30-
- [`./examples/performance-track`](./examples/performance-track) - Minimal React Server Components performance track probe.
3130
- [`./examples/ssg`](./examples/ssg) - Static site generation with MDX and client components for interactivity.
31+
- [`./examples/ppr`](./examples/ppr) - Partial prerendering with a reusable static HTML shell and request-time RSC content.
32+
- [`./examples/no-ssr`](./examples/no-ssr) - RSC application without an SSR environment.
33+
- [`./examples/client-first`](./examples/client-first) - Experimental client-owned page that consumes RSC function results.
34+
- [`./examples/browser-mode`](./examples/browser-mode) - Advanced setup that runs both RSC and React client environments in the browser with custom module loading.
35+
- [`./examples/performance-track`](./examples/performance-track) - Minimal React Server Components performance track probe.
3236
- [`./examples/react-router`](./examples/react-router) - React Router RSC integration
3337
- Demonstrates how to integrate [experimental React Router RSC API](https://remix.run/blog/rsc-preview). React Router now provides [official RSC support](https://reactrouter.com/how-to/react-server-components), so it's recommended to follow React Router's official documentation for the latest integration.
3438

@@ -525,6 +529,29 @@ This module provides Vite-integrated RSC runtime APIs based on
525529
- `createTemporaryReferenceSet`: Creates a temporary reference set shared by deserialization and reply serialization
526530
- `setServerCallback`: Configures how server functions are called
527531

532+
### Low-level runtime entry points
533+
534+
The runtime APIs are exposed through two layers:
535+
536+
- `@vitejs/plugin-rsc/rsc`, `@vitejs/plugin-rsc/ssr`, and
537+
`@vitejs/plugin-rsc/browser` are the recommended entry points for application
538+
and framework runtime code. They initialize the plugin's built-in module
539+
loading using the manifests generated by Vite and re-export the corresponding
540+
React runtime APIs described above.
541+
- `@vitejs/plugin-rsc/react/rsc`, `@vitejs/plugin-rsc/react/ssr`, and
542+
`@vitejs/plugin-rsc/react/browser` are low-level runtime adapters. They are
543+
used by code generated for `"use client"` and `"use server"`, and by custom
544+
integrations that provide module loading through `setRequireModule` instead
545+
of using the plugin's generated manifests.
546+
547+
The two layers share the same module loader within an environment, which allows
548+
generated code to use `/react/*` after a top-level entry initializes the
549+
built-in loader. Application code should continue using the top-level entries,
550+
which re-export the same runtime APIs. Direct use of `/react/*` is only needed
551+
by custom integrations that install their own loaders, such as the
552+
[`examples/browser-mode`](./examples/browser-mode) example, which runs the RSC
553+
and React client environments in the browser.
554+
528555
## Tips
529556

530557
### CSS Support

0 commit comments

Comments
 (0)