Skip to content

Commit 14b5858

Browse files
committed
fix(rsc): rename "server" APIs to use "RSC"
1 parent dc5ea58 commit 14b5858

File tree

21 files changed

+133
-133
lines changed

21 files changed

+133
-133
lines changed

docs/api/rsc/RSCHydratedRouter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: RSCHydratedRouter
88

99
## Summary
1010

11-
Hydrates a server rendered `ServerPayload` in the browser.
11+
Hydrates a server rendered `RSCPayload` in the browser.
1212

1313
## Props
1414

@@ -18,7 +18,7 @@ Your `react-server-dom-xyz/client`'s `createFromReadableStream` function, used t
1818

1919
### payload
2020

21-
The decoded ServerPayload to hydrate.
21+
The decoded `RSCPayload` to hydrate.
2222

2323
### routeDiscovery
2424

docs/api/rsc/RSCStaticRouter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ title: RSCStaticRouter
88

99
## Summary
1010

11-
Pre-renders a `ServerPayload` to HTML. Usually used in `routeRSCServerRequest`'s `renderHTML` callback.
11+
Pre-renders an `RSCPayload` to HTML. Usually used in `routeRSCServerRequest`'s `renderHTML` callback.
1212

1313
## Props
1414

1515
### getPayload
1616

17-
A function that starts decoding of the ServerPayload. Usually passed through from `routeRSCServerRequest`'s `renderHTML`.
17+
A function that starts decoding of the `RSCPayload`. Usually passed through from `routeRSCServerRequest`'s `renderHTML`.

docs/api/rsc/getServerStream.md renamed to docs/api/rsc/getRSCStream.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: getServerStream
2+
title: getRSCStream
33
---
44

5-
# getServerStream
5+
# getRSCStream
66

77
[MODES: data]
88

docs/api/rsc/matchRSCServerRequest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ title: matchRSCServerRequest
88

99
## Summary
1010

11-
Matches the given routes to a Request and returns a RSC Response encoding a `ServerPayload` for consumption by a RSC enabled client router.
11+
Matches the given routes to a Request and returns a RSC Response encoding an `RSCPayload` for consumption by a RSC enabled client router.
1212

1313
## Options
1414

@@ -26,7 +26,7 @@ A function responsible for decoding form state for progressively enhanceable for
2626

2727
### generateResponse
2828

29-
A function responsible for using your `renderToReadableStream` to generate a Response encoding the `ServerPayload`.
29+
A function responsible for using your `renderToReadableStream` to generate a Response encoding the `RSCPayload`.
3030

3131
### loadServerAction
3232

docs/api/rsc/routeRSCServerRequest.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Your `react-server-dom-xyz/client`'s `createFromReadableStream` function, used t
1818

1919
### fetchServer
2020

21-
A function that forwards a `Request` to the RSC handler and returns a `Promise<Response>` containing a serialized `ServerPayload`.
21+
A function that forwards a `Request` to the RSC handler and returns a `Promise<Response>` containing a serialized `RSCPayload`.
2222

2323
### renderHTML
2424

25-
A function that renders the `ServerPayload` to HTML, usually using a `<RSCStaticRouter>`.
25+
A function that renders the `RSCPayload` to HTML, usually using a `<RSCStaticRouter>`.
2626

2727
### request
2828

docs/start/rsc/installation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ Create a `src/browser.tsx` file that will act as the entrypoint for hydration.
184184
import { startTransition, StrictMode } from "react";
185185
import { hydrateRoot } from "react-dom/client";
186186
import {
187-
type unstable_ServerPayload as ServerPayload,
187+
type unstable_RSCPayload as RSCPayload,
188188
unstable_createCallServer as createCallServer,
189-
unstable_getServerStream as getServerStream,
189+
unstable_getRSCStream as getRSCStream,
190190
unstable_RSCHydratedRouter as RSCHydratedRouter,
191191
} from "react-router";
192192
import {
@@ -205,8 +205,8 @@ setServerCallback(
205205
);
206206

207207
// Get and decode the initial server payload
208-
createFromReadableStream(getServerStream()).then(
209-
(payload: ServerPayload) => {
208+
createFromReadableStream(getRSCStream()).then(
209+
(payload: RSCPayload) => {
210210
startTransition(async () => {
211211
hydrateRoot(
212212
document,
@@ -231,7 +231,7 @@ Create a `src/routes/routes.ts` file that will define our routes with dynamic im
231231
```ts nonumber
232232
"use server-entry";
233233

234-
import type { unstable_ServerRouteObject as ServerRouteObject } from "react-router";
234+
import type { unstable_RSCRouteConfig as RSCRouteConfig } from "react-router";
235235

236236
import "../browser";
237237

@@ -254,7 +254,7 @@ export function routes() {
254254
},
255255
],
256256
},
257-
] satisfies ServerRouteObject[];
257+
] satisfies RSCRouteConfig;
258258
}
259259
```
260260

integration/helpers/rsc-parcel/src/browser.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import { startTransition, StrictMode } from "react";
44
import { hydrateRoot } from "react-dom/client";
5-
import type { unstable_ServerPayload as ServerPayload } from "react-router";
5+
import type { unstable_RSCPayload as RSCPayload } from "react-router";
66
import {
77
unstable_createCallServer as createCallServer,
8-
unstable_getServerStream as getServerStream,
8+
unstable_getRSCStream as getRSCStream,
99
unstable_RSCHydratedRouter as RSCHydratedRouter,
1010
} from "react-router";
1111
import {
@@ -24,7 +24,7 @@ setServerCallback(
2424
);
2525

2626
// Get and decode the initial server payload
27-
createFromReadableStream(getServerStream()).then((payload: ServerPayload) => {
27+
createFromReadableStream(getRSCStream()).then((payload: RSCPayload) => {
2828
// @ts-expect-error - on 18 types, requires 19.
2929
startTransition(async () => {
3030
const formState =

integration/helpers/rsc-parcel/src/routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { unstable_ServerRouteObject as ServerRouteObject } from "react-router";
1+
import type { unstable_RSCRouteConfig as RSCRouteConfig } from "react-router";
22

33
export const routes = [
44
{
@@ -13,4 +13,4 @@ export const routes = [
1313
},
1414
],
1515
},
16-
] satisfies ServerRouteObject[];
16+
] satisfies RSCRouteConfig;

integration/helpers/rsc-vite/src/entry.browser.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import {
77
} from "@hiogawa/vite-rsc/browser";
88
import {
99
unstable_createCallServer as createCallServer,
10-
unstable_getServerStream as getServerStream,
10+
unstable_getRSCStream as getRSCStream,
1111
unstable_RSCHydratedRouter as RSCHydratedRouter,
1212
} from "react-router";
13-
import type { unstable_ServerPayload as ServerPayload } from "react-router";
13+
import type { unstable_RSCPayload as RSCPayload } from "react-router";
1414

1515
setServerCallback(
1616
createCallServer({
@@ -19,7 +19,7 @@ setServerCallback(
1919
})
2020
);
2121

22-
createFromReadableStream<ServerPayload>(getServerStream()).then((payload) => {
22+
createFromReadableStream<RSCPayload>(getRSCStream()).then((payload) => {
2323
startTransition(() => {
2424
hydrateRoot(
2525
document,

integration/helpers/rsc-vite/src/routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { unstable_ServerRouteObject as ServerRouteObject } from "react-router";
1+
import type { unstable_RSCRouteConfig as RSCRouteConfig } from "react-router";
22

33
export const routes = [
44
{
@@ -13,4 +13,4 @@ export const routes = [
1313
},
1414
],
1515
},
16-
] satisfies ServerRouteObject[];
16+
] satisfies RSCRouteConfig;

0 commit comments

Comments
 (0)