Home / Function/ renderToStaticMarkup() — astro Function Reference

renderToStaticMarkup() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  68c96e24_9958_a511_74d1_245400efb7d8["renderToStaticMarkup()"]
  d0de5327_5e5a_8e1a_12da_157bf4a85e96["server.ts"]
  68c96e24_9958_a511_74d1_245400efb7d8 -->|defined in| d0de5327_5e5a_8e1a_12da_157bf4a85e96
  style 68c96e24_9958_a511_74d1_245400efb7d8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/vue/src/server.ts lines 13–43

async function renderToStaticMarkup(
	this: RendererContext,
	Component: any,
	inputProps: Record<string, any>,
	slotted: Record<string, any>,
	metadata?: AstroComponentMetadata,
) {
	let prefix;
	if (this && this.result) {
		prefix = incrementId(this.result);
	}
	const attrs: Record<string, any> = { prefix };

	const slots: Record<string, any> = {};
	const props = { ...inputProps };
	delete props.slot;
	for (const [key, value] of Object.entries(slotted)) {
		slots[key] = () =>
			h(StaticHtml, {
				value,
				name: key === 'default' ? undefined : key,
				// Adjust how this is hydrated only when the version of Astro supports `astroStaticSlot`
				hydrate: metadata?.astroStaticSlot ? !!metadata.hydrate : true,
			});
	}
	const app = createSSRApp({ render: () => h(Component, props, slots) });
	app.config.idPrefix = prefix;
	await setup(app);
	const html = await renderToString(app);
	return { html, attrs };
}

Domain

Subdomains

Frequently Asked Questions

What does renderToStaticMarkup() do?
renderToStaticMarkup() is a function in the astro codebase, defined in packages/integrations/vue/src/server.ts.
Where is renderToStaticMarkup() defined?
renderToStaticMarkup() is defined in packages/integrations/vue/src/server.ts at line 13.

Analyze Your Own Codebase

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

Try Supermodel Free