Home / File/ svelte-component.js — svelte Source File

svelte-component.js — svelte Source File

Architecture documentation for svelte-component.js, a javascript file in the svelte codebase. 7 imports, 0 dependents.

File javascript ClientRuntime LegacyBridge 7 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  beb52c0c_aac9_0902_72a9_1450944244cf["svelte-component.js"]
  1ae6fa4e_16ee_acdf_5e28_17eb0819fddb["effects.js"]
  beb52c0c_aac9_0902_72a9_1450944244cf --> 1ae6fa4e_16ee_acdf_5e28_17eb0819fddb
  1bd7dd6f_4c22_6f44_9747_fc5ea0deaa7b["block"]
  beb52c0c_aac9_0902_72a9_1450944244cf --> 1bd7dd6f_4c22_6f44_9747_fc5ea0deaa7b
  f3948b0d_b92a_0767_ba6c_832767f4e2bb["hydration.js"]
  beb52c0c_aac9_0902_72a9_1450944244cf --> f3948b0d_b92a_0767_ba6c_832767f4e2bb
  b31601aa_35ce_7827_5394_99fb97fa27d2["hydrate_next"]
  beb52c0c_aac9_0902_72a9_1450944244cf --> b31601aa_35ce_7827_5394_99fb97fa27d2
  ee9aaeee_d18b_8f23_1c50_ace68f975516["branches.js"]
  beb52c0c_aac9_0902_72a9_1450944244cf --> ee9aaeee_d18b_8f23_1c50_ace68f975516
  60ab4ae8_779f_562b_010b_c2c26a4235d8["BranchManager"]
  beb52c0c_aac9_0902_72a9_1450944244cf --> 60ab4ae8_779f_562b_010b_c2c26a4235d8
  54c2bfce_50b6_b8cc_4371_e1e14f283fb3["constants"]
  beb52c0c_aac9_0902_72a9_1450944244cf --> 54c2bfce_50b6_b8cc_4371_e1e14f283fb3
  style beb52c0c_aac9_0902_72a9_1450944244cf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/** @import { TemplateNode, Dom } from '#client' */
import { EFFECT_TRANSPARENT } from '#client/constants';
import { block } from '../../reactivity/effects.js';
import { hydrate_next, hydrating } from '../hydration.js';
import { BranchManager } from './branches.js';

/**
 * @template P
 * @template {(props: P) => void} C
 * @param {TemplateNode} node
 * @param {() => C} get_component
 * @param {(anchor: TemplateNode, component: C) => Dom | void} render_fn
 * @returns {void}
 */
export function component(node, get_component, render_fn) {
	if (hydrating) {
		hydrate_next();
	}

	var branches = new BranchManager(node);

	block(() => {
		var component = get_component() ?? null;
		branches.ensure(component, component && ((target) => render_fn(target, component)));
	}, EFFECT_TRANSPARENT);
}

Domain

Subdomains

Functions

Frequently Asked Questions

What does svelte-component.js do?
svelte-component.js is a source file in the svelte codebase, written in javascript. It belongs to the ClientRuntime domain, LegacyBridge subdomain.
What functions are defined in svelte-component.js?
svelte-component.js defines 1 function(s): component.
What does svelte-component.js depend on?
svelte-component.js imports 7 module(s): BranchManager, block, branches.js, constants, effects.js, hydrate_next, hydration.js.
Where is svelte-component.js in the architecture?
svelte-component.js is located at packages/svelte/src/internal/client/dom/blocks/svelte-component.js (domain: ClientRuntime, subdomain: LegacyBridge, directory: packages/svelte/src/internal/client/dom/blocks).

Analyze Your Own Codebase

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

Try Supermodel Free