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: src/routes/reference/rendering/hydrate.mdx
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,15 +74,16 @@ Dispose function for the hydrated root.
74
74
75
75
## Behavior
76
76
77
-
-`hydrate` is a client-only API and throws in the server bundle.
78
-
-`hydrate` reuses server-rendered DOM instead of creating a new subtree, locating nodes through Solid's hydration markers and optionally scoping that lookup with `renderId`.
77
+
-`hydrate` is a client-only API.
78
+
-`hydrate` reuses DOM produced by Solid's server renderer instead of creating a new subtree, locating nodes through Solid's hydration markers and optionally scoping that lookup with `renderId`.
79
+
- The hydrated DOM and the JSX returned by `fn` must match the server output for hydration to succeed.
79
80
- The returned function disposes the hydrated root.
@@ -74,21 +73,16 @@ Callback invoked when the shell is ready to flush.
74
73
75
74
Callback invoked after all server suspense boundaries have settled.
76
75
77
-
#### `onError`
78
-
79
-
-**Type:**`(err: any) => void`
80
-
81
-
Callback invoked when a rendering error is encountered.
82
-
83
76
## Return value
84
77
85
78
-**Type:**`{ pipe: ..., pipeTo: ... }`
86
79
87
-
Streaming controller with `pipe` and `pipeTo` methods. The runtime implementation is also thenable and can resolve to the complete HTML string.
80
+
Streaming controller with `pipe` and `pipeTo` methods.
88
81
89
82
## Behavior
90
83
91
-
-`renderToStream` is a server rendering API and is unsupported in browser bundles. It buffers the shell HTML, including suspense fallback content, and can flush it before later async fragments and serialized data stream as resources resolve.
84
+
-`renderToStream` is a server rendering API and is unsupported in browser bundles.
85
+
- It renders the shell first, including suspense fallback content, and can flush that output before later async fragments and serialized data stream as resources resolve.
92
86
-`onCompleteShell` and `onCompleteAll` receive a `write()` helper for injecting additional output into the stream.
93
87
-`pipe` writes to Node-style writable targets.
94
88
-`pipeTo` writes to a `WritableStream`.
@@ -97,19 +91,19 @@ Streaming controller with `pipe` and `pipeTo` methods. The runtime implementatio
Copy file name to clipboardExpand all lines: src/routes/reference/rendering/render-to-string-async.mdx
+5-18Lines changed: 5 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,8 +30,6 @@ function renderToStringAsync<T>(
30
30
timeoutMs?:number;
31
31
nonce?:string;
32
32
renderId?:string;
33
-
noScripts?:boolean;
34
-
onError?: (err:any) =>void;
35
33
}
36
34
):Promise<string>;
37
35
```
@@ -64,18 +62,6 @@ Nonce applied to inline scripts emitted during rendering.
64
62
65
63
Identifier used to namespace the render output.
66
64
67
-
#### `noScripts`
68
-
69
-
-**Type:**`boolean`
70
-
71
-
Disables script emission, including serialized data used for hydration continuation.
72
-
73
-
#### `onError`
74
-
75
-
-**Type:**`(err: any) => void`
76
-
77
-
Callback invoked when a rendering error is encountered.
78
-
79
65
## Return value
80
66
81
67
-**Type:**`Promise<string>`
@@ -84,16 +70,17 @@ Promise that resolves to the rendered HTML string.
84
70
85
71
## Behavior
86
72
87
-
-`renderToStringAsync` is a server rendering API and is unsupported in browser bundles. It builds on [`renderToStream`](/reference/rendering/render-to-stream) and waits for the full stream result before resolving.
88
-
- If the timeout elapses, the returned promise rejects instead of resolving partial HTML.
89
-
- Resource data is serialized for client hydration unless scripts are disabled.
73
+
-`renderToStringAsync` is a server rendering API and is unsupported in browser bundles.
74
+
- It waits for server suspense boundaries to settle before resolving the final HTML string.
75
+
-`timeoutMs` limits how long the render waits for async suspense work to finish.
76
+
- Resource data is serialized for client hydration.
90
77
-`renderId` namespaces the render output when multiple top-level roots are present.
0 commit comments