Home / Function/ render() — astro Function Reference

render() — astro Function Reference

Architecture documentation for the render() function in server-islands.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  274139e4_ac9d_689e_6946_beb93471fb84["render()"]
  4d35505e_dd90_7891_e19a_4730ce8738e2["ServerIslandComponent"]
  274139e4_ac9d_689e_6946_beb93471fb84 -->|defined in| 4d35505e_dd90_7891_e19a_4730ce8738e2
  67cf42ad_a2b9_a680_47b7_c763313dc5b0["getHostId()"]
  274139e4_ac9d_689e_6946_beb93471fb84 -->|calls| 67cf42ad_a2b9_a680_47b7_c763313dc5b0
  bcfee27a_2e68_b340_ffdb_f47378299d82["getIslandContent()"]
  274139e4_ac9d_689e_6946_beb93471fb84 -->|calls| bcfee27a_2e68_b340_ffdb_f47378299d82
  style 274139e4_ac9d_689e_6946_beb93471fb84 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/render/server-islands.ts lines 90–104

	async render(destination: RenderDestination) {
		const hostId = await this.getHostId();
		const islandContent = await this.getIslandContent();
		destination.write(createRenderInstruction({ type: 'server-island-runtime' }));
		destination.write('<!--[if astro]>server-island-start<![endif]-->');
		// Render the slots
		for (const name in this.slots) {
			if (name === 'fallback') {
				await renderChild(destination, this.slots.fallback(this.result));
			}
		}
		destination.write(
			`<script type="module" data-astro-rerun data-island-id="${hostId}">${islandContent}</script>`,
		);
	}

Domain

Subdomains

Frequently Asked Questions

What does render() do?
render() is a function in the astro codebase, defined in packages/astro/src/runtime/server/render/server-islands.ts.
Where is render() defined?
render() is defined in packages/astro/src/runtime/server/render/server-islands.ts at line 90.
What does render() call?
render() calls 2 function(s): getHostId, getIslandContent.

Analyze Your Own Codebase

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

Try Supermodel Free