Home / Function/ mode() — svelte Function Reference

mode() — svelte Function Reference

Architecture documentation for the mode() function in renderer.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  f91207ab_1d7b_aabd_5ac8_8180188d0639["mode()"]
  ce85d155_9f13_f67c_9824_407161a6c2c7["Renderer"]
  f91207ab_1d7b_aabd_5ac8_8180188d0639 -->|defined in| ce85d155_9f13_f67c_9824_407161a6c2c7
  6f1eae94_35bd_e5bc_d962_31f3ce608951["push()"]
  f91207ab_1d7b_aabd_5ac8_8180188d0639 -->|calls| 6f1eae94_35bd_e5bc_d962_31f3ce608951
  37596f8a_06e9_abf9_49d1_df75cd4a3a2d["component()"]
  f91207ab_1d7b_aabd_5ac8_8180188d0639 -->|calls| 37596f8a_06e9_abf9_49d1_df75cd4a3a2d
  df0cdd9c_f6ec_a739_2719_d244ec719eb0["pop()"]
  f91207ab_1d7b_aabd_5ac8_8180188d0639 -->|calls| df0cdd9c_f6ec_a739_2719_d244ec719eb0
  style f91207ab_1d7b_aabd_5ac8_8180188d0639 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/internal/server/renderer.js lines 622–641

	static #open_render(mode, component, options) {
		const renderer = new Renderer(
			new SSRState(mode, options.idPrefix ? options.idPrefix + '-' : '', options.csp)
		);

		renderer.push(BLOCK_OPEN);

		push();
		if (options.context) /** @type {SSRContext} */ (ssr_context).c = options.context;
		/** @type {SSRContext} */ (ssr_context).r = renderer;

		// @ts-expect-error
		component(renderer, options.props ?? {});

		pop();

		renderer.push(BLOCK_CLOSE);

		return renderer;
	}

Domain

Subdomains

Frequently Asked Questions

What does mode() do?
mode() is a function in the svelte codebase, defined in packages/svelte/src/internal/server/renderer.js.
Where is mode() defined?
mode() is defined in packages/svelte/src/internal/server/renderer.js at line 622.
What does mode() call?
mode() calls 3 function(s): component, pop, push.

Analyze Your Own Codebase

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

Try Supermodel Free