Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/plugin-rsc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,10 @@ export default defineConfig({
})
```

## Higher level API
## High level API

> [!NOTE]
> High level API is deprecated. Please write on your own `@vitejs/plugin-rsc/{rsc,ssr,browser}` integration.

This is a wrapper of `react-server-dom` API and helper API to setup a minimal RSC app without writing own framework code like [`./examples/starter/src/framework`](./examples/starter/src/framework/). See [`./examples/basic`](./examples/basic/) for how this API is used.

Expand Down
6 changes: 6 additions & 0 deletions packages/plugin-rsc/src/extra/browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import {
} from '../browser'
import type { RscPayload } from './rsc'

/**
* @deprecated Use `@vitejs/plugin-rsc/browser` API instead.
*/
export async function hydrate(): Promise<void> {
const callServer: CallServerCallback = async (id, args) => {
const url = new URL(window.location.href)
Expand Down Expand Up @@ -71,6 +74,9 @@ export async function hydrate(): Promise<void> {
}
}

/**
* @deprecated Use `@vitejs/plugin-rsc/browser` API instead.
*/
export async function fetchRSC(
request: string | URL | Request,
): Promise<RscPayload['root']> {
Expand Down
3 changes: 3 additions & 0 deletions packages/plugin-rsc/src/extra/rsc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export type RscPayload = {
returnValue?: unknown
}

/**
* @deprecated Use `@vitejs/plugin-rsc/rsc` API instead.
*/
export async function renderRequest(
request: Request,
root: React.ReactNode,
Expand Down
3 changes: 3 additions & 0 deletions packages/plugin-rsc/src/extra/ssr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { injectRSCPayload } from 'rsc-html-stream/server'
import { createFromReadableStream } from '../ssr'
import type { RscPayload } from './rsc'

/**
* @deprecated Use `@vitejs/plugin-rsc/ssr` API instead.
*/
export async function renderHtml(
rscStream: ReadableStream<Uint8Array>,
options?: {
Expand Down
Loading