Home / Function/ init() — astro Function Reference

init() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  23261a74_abb4_3261_95d8_53855faaa9a7["init()"]
  4d35505e_dd90_7891_e19a_4730ce8738e2["ServerIslandComponent"]
  23261a74_abb4_3261_95d8_53855faaa9a7 -->|defined in| 4d35505e_dd90_7891_e19a_4730ce8738e2
  bcfee27a_2e68_b340_ffdb_f47378299d82["getIslandContent()"]
  23261a74_abb4_3261_95d8_53855faaa9a7 -->|calls| bcfee27a_2e68_b340_ffdb_f47378299d82
  style 23261a74_abb4_3261_95d8_53855faaa9a7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/render/server-islands.ts lines 77–89

	async init(): Promise<ThinHead> {
		const content = await this.getIslandContent();

		if (this.result.cspDestination) {
			this.result._metadata.extraScriptHashes.push(
				await generateCspDigest(SERVER_ISLAND_REPLACER, this.result.cspAlgorithm),
			);
			const contentDigest = await generateCspDigest(content, this.result.cspAlgorithm);
			this.result._metadata.extraScriptHashes.push(contentDigest);
		}

		return createThinHead();
	}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free