Skip to content

Commit 787e6ce

Browse files
jacob-ebeybrophdawg11markdalgleishhi-ogawa
authored
feat: RSC Router APIs (#13700)
Co-authored-by: Jacob Ebey <[email protected]> Co-authored-by: Matt Brophy <[email protected]> Co-authored-by: Mark Dalgleish <[email protected]> Co-authored-by: Hiroshi Ogawa <[email protected]>
1 parent f248c51 commit 787e6ce

File tree

160 files changed

+17258
-7130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+17258
-7130
lines changed

.changeset/late-lobsters-check.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"react-router": minor
3+
---
4+
5+
Add unstable RSC support
6+
7+
For more information, see the [RSC documentation](https://reactrouter.com/start/rsc/installation).

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ examples/**/dist/
66
worker-configuration.d.ts
77
/playground/
88
/playground-local/
9+
integration/helpers/**/dist/
10+
integration/helpers/**/build/
11+
playwright-report/
12+
test-results/
13+
build.utils.d.ts
14+
.wrangler/
15+
.tmp/
16+
.react-router/
17+
.react-router-parcel/
918
packages/**/dist/
1019
packages/react-router-dom/server.d.ts
1120
packages/react-router-dom/server.js

.github/workflows/integration-full.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: ./.github/workflows/shared-integration.yml
4141
with:
4242
os: "windows-latest"
43-
node_version: "[20, 22]"
43+
node_version: "[22]"
4444
browser: '["msedge"]'
4545

4646
integration-macos:

.github/workflows/integration-pr-windows-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
os: "windows-latest"
3333
node_version: "[22]"
3434
browser: '["msedge"]'
35-
timeout: 60
35+
timeout: 120
3636

3737
integration-webkit:
3838
name: "👀 Integration Test"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ node_modules/
2727

2828
.wireit
2929
.eslintcache
30+
.parcel-cache
3031
.tmp
3132
tsup.config.bundled_*.mjs
3233
build.utils.d.ts

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
22

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
- hampelm
133133
- harshmangalam
134134
- hernanif1
135+
- hi-ogawa
135136
- HK-SHAO
136137
- holynewbie
137138
- hongji00

docs/api/rsc/RSCHydratedRouter.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: RSCHydratedRouter
3+
---
4+
5+
# RSCHydratedRouter
6+
7+
[MODES: data]
8+
9+
## Summary
10+
11+
Hydrates a server rendered `RSCPayload` in the browser.
12+
13+
## Props
14+
15+
### createFromReadableStream
16+
17+
Your `react-server-dom-xyz/client`'s `createFromReadableStream` function, used to decode payloads from the server.
18+
19+
### payload
20+
21+
The decoded `RSCPayload` to hydrate.
22+
23+
### routeDiscovery
24+
25+
`eager` or `lazy` - Determines if links are eagerly discovered, or delayed until clicked.

docs/api/rsc/RSCStaticRouter.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: RSCStaticRouter
3+
---
4+
5+
# RSCStaticRouter
6+
7+
[MODES: data]
8+
9+
## Summary
10+
11+
Pre-renders an `RSCPayload` to HTML. Usually used in `routeRSCServerRequest`'s `renderHTML` callback.
12+
13+
## Props
14+
15+
### getPayload
16+
17+
A function that starts decoding of the `RSCPayload`. Usually passed through from `routeRSCServerRequest`'s `renderHTML`.

docs/api/rsc/createCallServer.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: createCallServer
3+
---
4+
5+
# createCallServer
6+
7+
[MODES: data]
8+
9+
## Summary
10+
11+
Create a React `callServer` implementation for React Router.
12+
13+
## Options
14+
15+
### createFromReadableStream
16+
17+
Your `react-server-dom-xyz/client`'s `createFromReadableStream`. Used to decode payloads from the server.
18+
19+
### encodeReply
20+
21+
Your `react-server-dom-xyz/client`'s `encodeReply`. Used when sending payloads to the server.

0 commit comments

Comments
 (0)