You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/plugin-rsc/README.md
+36-33Lines changed: 36 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This package provides [React Server Components](https://react.dev/reference/rsc/
4
4
5
5
## Features
6
6
7
-
-**Framework-less RSC experience**: The plugin implements [RSC conventions](https://react.dev/reference/rsc/server-components) and provides low level `react-server-dom` runtime API without framework-specific abstractions.
7
+
-**Framework-agnostic RSC experience**: The plugin implements [RSC conventions](https://react.dev/reference/rsc/server-components) and provides low level `react-server-dom` runtime API without framework-specific abstractions.
8
8
-**CSS support**: CSS is automatically code-split both at client and server components and they are injected upon rendering.
9
9
-**HMR support**: Enables editing both client and server components without full page reloads.
10
10
-**Runtime agnostic**: Built on [Vite environment API](https://vite.dev/guide/api-environment.html) and works with other runtimes (e.g., [`@cloudflare/vite-plugin`](https://github.com/cloudflare/workers-sdk/tree/main/packages/vite-plugin-cloudflare)).
- This 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.
26
-
-[`./examples/basic`](./examples/basic)
22
+
**Start here:**[`./examples/starter`](./examples/starter) - Recommended for understanding the plugin
23
+
24
+
- Provides an in-depth overview of API with inline comments to explain how they function within RSC-powered React application.
- 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.
30
+
-[`./examples/ssg`](./examples/ssg) - Static site generation with MDX and client components for interactivity.
31
+
-[`./examples/basic`](./examples/basic) - Advanced RSC features and testing
27
32
- This is mainly used for e2e testing and include various advanced RSC usages (e.g. `"use cache"` example).
28
-
-[`./examples/ssg`](./examples/ssg)
29
-
- Static site generation (SSG) example with MDX and client components for interactivity.
30
33
31
34
## Basic Concepts
32
35
@@ -208,31 +211,6 @@ async function main() {
208
211
main();
209
212
```
210
213
211
-
## `react-server-dom` API
212
-
213
-
### `@vitejs/plugin-rsc/rsc`
214
-
215
-
This module re-exports RSC runtime API provided by `react-server-dom/server.edge` and `react-server-dom/client.edge` such as:
- `createFromReadableStream`: RSC deserialization (RSC stream -> React VDOM). This is also available on rsc environment itself. For example, it allows saving serailized RSC and deserializing it for later use.
- `createFromReadableStream`: RSC deserialization (RSC stream -> React VDOM). This is also available on rsc environment itself. For example, it allows saving serialized RSC and deserializing it for later use.
0 commit comments