Skip to content

Commit bdf282c

Browse files
committed
chore: generate markdown docs from jsdocs
1 parent b95cf3f commit bdf282c

File tree

6 files changed

+288
-49
lines changed

6 files changed

+288
-49
lines changed

docs/api/rsc/RSCHydratedRouter.md

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,34 @@ unstable: true
55

66
# unstable_RSCHydratedRouter
77

8+
<!--
9+
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
10+
11+
Thank you for helping improve our documentation!
12+
13+
This file is auto-generated from the JSDoc comments in the source
14+
code, so please edit the JSDoc comments in the file below and this
15+
file will be re-generated once those changes are merged.
16+
17+
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/rsc/browser.tsx
18+
-->
19+
820
[MODES: data]
921

1022
<br />
1123
<br />
1224

13-
<docs-warning>This API is experimental and subject to breaking changes in
14-
minor/patch releases. Please use with caution and pay **very** close attention
25+
<docs-warning>This API is experimental and subject to breaking changes in
26+
minor/patch releases. Please use with caution and pay **very** close attention
1527
to release notes for relevant changes.</docs-warning>
1628

1729
## Summary
1830

31+
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.unstable_RSCHydratedRouter.html)
32+
1933
Hydrates a server rendered `RSCPayload` in the browser.
2034

21-
```tsx filename=entry.browser.tsx
35+
```tsx
2236
import { startTransition, StrictMode } from "react";
2337
import { hydrateRoot } from "react-dom/client";
2438
import {
@@ -49,20 +63,41 @@ createFromReadableStream(getRSCStream()).then(
4963
);
5064
```
5165

66+
## Signature
67+
68+
```tsx
69+
function RSCHydratedRouter({
70+
createFromReadableStream,
71+
fetch: fetchImplementation = fetch,
72+
payload,
73+
routeDiscovery = "eager",
74+
unstable_getContext,
75+
}: RSCHydratedRouterProps)
76+
```
77+
5278
## Props
5379

5480
### createFromReadableStream
5581

56-
Your `react-server-dom-xyz/client`'s `createFromReadableStream` function, used to decode payloads from the server.
82+
Your `react-server-dom-xyz/client`'s `createFromReadableStream` function,
83+
used to decode payloads from the server.
84+
85+
### fetch
86+
87+
Optional fetch implementation. Defaults to global `fetch`.
5788

5889
### payload
5990

6091
The decoded `RSCPayload` to hydrate.
6192

6293
### routeDiscovery
6394

64-
`eager` or `lazy` - Determines if links are eagerly discovered, or delayed until clicked.
95+
`eager` or `lazy` - Determines if links are eagerly discovered, or delayed
96+
until clicked.
6597

6698
### unstable_getContext
6799

68-
A function that returns an `unstable_InitialContext` object (`Map<RouterContext, unknown>`), for use in client loaders, actions and middleware.
100+
A function that returns an `unstable_InitialContext` object
101+
(`Map<RouterContext, unknown>`), for use in client loaders, actions and
102+
middleware.
103+

docs/api/rsc/RSCStaticRouter.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,36 @@ unstable: true
55

66
# unstable_RSCStaticRouter
77

8+
<!--
9+
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
10+
11+
Thank you for helping improve our documentation!
12+
13+
This file is auto-generated from the JSDoc comments in the source
14+
code, so please edit the JSDoc comments in the file below and this
15+
file will be re-generated once those changes are merged.
16+
17+
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/rsc/server.ssr.tsx
18+
-->
19+
820
[MODES: data]
921

1022
<br />
1123
<br />
1224

13-
<docs-warning>This API is experimental and subject to breaking changes in
14-
minor/patch releases. Please use with caution and pay **very** close attention
25+
<docs-warning>This API is experimental and subject to breaking changes in
26+
minor/patch releases. Please use with caution and pay **very** close attention
1527
to release notes for relevant changes.</docs-warning>
1628

1729
## Summary
1830

19-
Pre-renders an `RSCPayload` to HTML. Usually used in `routeRSCServerRequest`'s `renderHTML` callback.
31+
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.unstable_RSCStaticRouter.html)
32+
33+
Pre-renders an `RSCPayload` to HTML. Usually used in `routeRSCServerRequest`'s
34+
`renderHTML` callback.
2035

21-
```tsx filename=entry.ssr.tsx
36+
```tsx
2237
import { createFromReadableStream } from "@vitejs/plugin-rsc/ssr";
23-
// @ts-expect-error
2438
import * as ReactDomServer from "react-dom/server.edge";
2539
import {
2640
unstable_RSCStaticRouter as RSCStaticRouter,
@@ -45,8 +59,16 @@ routeRSCServerRequest({
4559
});
4660
```
4761

62+
## Signature
63+
64+
```tsx
65+
function RSCStaticRouter({ getPayload }: RSCStaticRouterProps)
66+
```
67+
4868
## Props
4969

5070
### getPayload
5171

52-
A function that starts decoding of the `RSCPayload`. Usually passed through from `routeRSCServerRequest`'s `renderHTML`.
72+
A function that starts decoding of the `RSCPayload`. Usually passed through
73+
from `routeRSCServerRequest`'s `renderHTML`.
74+

docs/api/rsc/createCallServer.md

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,34 @@ unstable: true
55

66
# unstable_createCallServer
77

8+
<!--
9+
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
10+
11+
Thank you for helping improve our documentation!
12+
13+
This file is auto-generated from the JSDoc comments in the source
14+
code, so please edit the JSDoc comments in the file below and this
15+
file will be re-generated once those changes are merged.
16+
17+
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/rsc/browser.tsx
18+
-->
19+
820
[MODES: data]
921

1022
<br />
1123
<br />
1224

13-
<docs-warning>This API is experimental and subject to breaking changes in
14-
minor/patch releases. Please use with caution and pay **very** close attention
25+
<docs-warning>This API is experimental and subject to breaking changes in
26+
minor/patch releases. Please use with caution and pay **very** close attention
1527
to release notes for relevant changes.</docs-warning>
1628

1729
## Summary
1830

31+
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.unstable_createCallServer.html)
32+
1933
Create a React `callServer` implementation for React Router.
2034

21-
```tsx filename=entry.browser.tsx
35+
```tsx
2236
import {
2337
createFromReadableStream,
2438
createTemporaryReferenceSet,
@@ -36,12 +50,41 @@ setServerCallback(
3650
);
3751
```
3852

39-
## Options
53+
## Signature
54+
55+
```tsx
56+
function createCallServer({
57+
createFromReadableStream,
58+
createTemporaryReferenceSet,
59+
encodeReply,
60+
fetch: fetchImplementation = fetch,
61+
}: {
62+
createFromReadableStream: BrowserCreateFromReadableStreamFunction;
63+
createTemporaryReferenceSet: () => unknown;
64+
encodeReply: EncodeReplyFunction;
65+
fetch?: (request: Request) => Promise<Response>;
66+
})
67+
```
68+
69+
## Params
4070

41-
### createFromReadableStream
71+
### opts.createFromReadableStream
4272

4373
Your `react-server-dom-xyz/client`'s `createFromReadableStream`. Used to decode payloads from the server.
4474

45-
### encodeReply
75+
### opts.createTemporaryReferenceSet
76+
77+
A function that creates a temporary reference set for the RSC payload.
78+
79+
### opts.encodeReply
4680

4781
Your `react-server-dom-xyz/client`'s `encodeReply`. Used when sending payloads to the server.
82+
83+
### opts.fetch
84+
85+
Optional fetch implementation. Defaults to global `fetch`.
86+
87+
## Returns
88+
89+
A function that can be used to call server actions.
90+

docs/api/rsc/getRSCStream.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,35 @@ unstable: true
55

66
# unstable_getRSCStream
77

8+
<!--
9+
⚠️ ⚠️ IMPORTANT ⚠️ ⚠️
10+
11+
Thank you for helping improve our documentation!
12+
13+
This file is auto-generated from the JSDoc comments in the source
14+
code, so please edit the JSDoc comments in the file below and this
15+
file will be re-generated once those changes are merged.
16+
17+
https://github.com/remix-run/react-router/blob/main/packages/react-router/lib/rsc/html-stream/browser.ts
18+
-->
19+
820
[MODES: data]
921

1022
<br />
1123
<br />
1224

13-
<docs-warning>This API is experimental and subject to breaking changes in
14-
minor/patch releases. Please use with caution and pay **very** close attention
25+
<docs-warning>This API is experimental and subject to breaking changes in
26+
minor/patch releases. Please use with caution and pay **very** close attention
1527
to release notes for relevant changes.</docs-warning>
1628

1729
## Summary
1830

19-
Get the prerendered RSC stream for hydration. Usually passed directly to your `react-server-dom-xyz/client`'s `createFromReadableStream`.
31+
[Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.unstable_getRSCStream.html)
32+
33+
Get the prerendered RSC stream for hydration. Usually passed directly to your
34+
`react-server-dom-xyz/client`'s `createFromReadableStream`.
2035

21-
```tsx filename=entry.browser.ts
36+
```tsx
2237
import { startTransition, StrictMode } from "react";
2338
import { hydrateRoot } from "react-dom/client";
2439
import {
@@ -33,13 +48,24 @@ createFromReadableStream(getRSCStream()).then(
3348
hydrateRoot(
3449
document,
3550
<StrictMode>
36-
<RSCHydratedRouter /* props */ />
51+
<RSCHydratedRouter ...props />
3752
</StrictMode>,
3853
{
39-
/* ... */
54+
// Options
4055
}
4156
);
4257
});
4358
}
4459
);
4560
```
61+
62+
## Signature
63+
64+
```tsx
65+
function getRSCStream(): ReadableStream<any>
66+
```
67+
68+
## Returns
69+
70+
A `ReadableStream` that contains the RSC data for hydration.
71+

0 commit comments

Comments
 (0)