Home / Function/ renderToPipeableStreamAsync() — astro Function Reference

renderToPipeableStreamAsync() — astro Function Reference

Architecture documentation for the renderToPipeableStreamAsync() function in server.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  6c90a0ed_3f34_1253_b029_1e3fe08eeb94["renderToPipeableStreamAsync()"]
  88d29d84_fc17_43e9_f02f_9b64acf73dd5["server.ts"]
  6c90a0ed_3f34_1253_b029_1e3fe08eeb94 -->|defined in| 88d29d84_fc17_43e9_f02f_9b64acf73dd5
  1a376583_017c_cfcf_84e2_0bfbbc11de09["renderToStaticMarkup()"]
  1a376583_017c_cfcf_84e2_0bfbbc11de09 -->|calls| 6c90a0ed_3f34_1253_b029_1e3fe08eeb94
  727d4340_0823_1ee3_ca14_30a69e67dadc["getNodeWritable()"]
  6c90a0ed_3f34_1253_b029_1e3fe08eeb94 -->|calls| 727d4340_0823_1ee3_ca14_30a69e67dadc
  style 6c90a0ed_3f34_1253_b029_1e3fe08eeb94 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/react/src/server.ts lines 156–182

async function renderToPipeableStreamAsync(vnode: any, options: Record<string, any>) {
	const Writable = await getNodeWritable();
	let html = '';
	return new Promise<string>((resolve, reject) => {
		let error = undefined;
		let stream = ReactDOM.renderToPipeableStream(vnode, {
			...options,
			onError(err) {
				error = err;
				reject(error);
			},
			onAllReady() {
				stream.pipe(
					new Writable({
						write(chunk, _encoding, callback) {
							html += chunk.toString('utf-8');
							callback();
						},
						destroy() {
							resolve(html);
						},
					}),
				);
			},
		});
	});
}

Domain

Subdomains

Frequently Asked Questions

What does renderToPipeableStreamAsync() do?
renderToPipeableStreamAsync() is a function in the astro codebase, defined in packages/integrations/react/src/server.ts.
Where is renderToPipeableStreamAsync() defined?
renderToPipeableStreamAsync() is defined in packages/integrations/react/src/server.ts at line 156.
What does renderToPipeableStreamAsync() call?
renderToPipeableStreamAsync() calls 1 function(s): getNodeWritable.
What calls renderToPipeableStreamAsync()?
renderToPipeableStreamAsync() is called by 1 function(s): renderToStaticMarkup.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free