Home / File/ debug.js — svelte Source File

debug.js — svelte Source File

Architecture documentation for debug.js, a javascript file in the svelte codebase. 5 imports, 0 dependents.

File javascript ClientRuntime Hydration 5 imports 6 functions

Entity Profile

Dependency Diagram

graph LR
  fc525dc9_b57a_8bf5_77df_6fcfa5373180["debug.js"]
  258b696c_d923_7010_457a_b58908a057b0["clone.js"]
  fc525dc9_b57a_8bf5_77df_6fcfa5373180 --> 258b696c_d923_7010_457a_b58908a057b0
  532a740d_d410_0fd6_983a_933cb13808e7["snapshot"]
  fc525dc9_b57a_8bf5_77df_6fcfa5373180 --> 532a740d_d410_0fd6_983a_933cb13808e7
  bde4209f_8ffc_1594_4024_b1835a44bcf6["runtime.js"]
  fc525dc9_b57a_8bf5_77df_6fcfa5373180 --> bde4209f_8ffc_1594_4024_b1835a44bcf6
  a814b193_e12a_4037_c3c8_dfd45f3bd0bb["untrack"]
  fc525dc9_b57a_8bf5_77df_6fcfa5373180 --> a814b193_e12a_4037_c3c8_dfd45f3bd0bb
  54c2bfce_50b6_b8cc_4371_e1e14f283fb3["constants"]
  fc525dc9_b57a_8bf5_77df_6fcfa5373180 --> 54c2bfce_50b6_b8cc_4371_e1e14f283fb3
  style fc525dc9_b57a_8bf5_77df_6fcfa5373180 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/** @import { Derived, Effect, Value } from '#client' */

import {
	BLOCK_EFFECT,
	BOUNDARY_EFFECT,
	BRANCH_EFFECT,
	CLEAN,
	CONNECTED,
	DERIVED,
	DIRTY,
	EFFECT,
	ASYNC,
	DESTROYED,
	INERT,
	MAYBE_DIRTY,
	RENDER_EFFECT,
	ROOT_EFFECT,
	WAS_MARKED,
	MANAGED_EFFECT
} from '#client/constants';
import { snapshot } from '../../shared/clone.js';
import { untrack } from '../runtime.js';

/**
 *
 * @param {Effect} effect
 */
export function root(effect) {
	while (effect.parent !== null) {
		effect = effect.parent;
	}

	return effect;
}

/**
 *
 * @param {Effect} effect
 * @param {boolean} append_effect
 * @returns {string}
 */
function effect_label(effect, append_effect = false) {
	const flags = effect.f;

	let label = `(unknown ${append_effect ? 'effect' : ''})`;

	if ((flags & ROOT_EFFECT) !== 0) {
		label = 'root';
	} else if ((flags & BOUNDARY_EFFECT) !== 0) {
		label = 'boundary';
	} else if ((flags & BLOCK_EFFECT) !== 0) {
		label = 'block';
	} else if ((flags & MANAGED_EFFECT) !== 0) {
		label = 'managed';
	} else if ((flags & ASYNC) !== 0) {
		label = 'async';
	} else if ((flags & BRANCH_EFFECT) !== 0) {
		label = 'branch';
	} else if ((flags & RENDER_EFFECT) !== 0) {
		label = 'render effect';
// ... (441 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does debug.js do?
debug.js is a source file in the svelte codebase, written in javascript. It belongs to the ClientRuntime domain, Hydration subdomain.
What functions are defined in debug.js?
debug.js defines 6 function(s): effect_label, log_dep, log_effect_tree, log_inconsistent_branches, log_reactions, root.
What does debug.js depend on?
debug.js imports 5 module(s): clone.js, constants, runtime.js, snapshot, untrack.
Where is debug.js in the architecture?
debug.js is located at packages/svelte/src/internal/client/dev/debug.js (domain: ClientRuntime, subdomain: Hydration, directory: packages/svelte/src/internal/client/dev).

Analyze Your Own Codebase

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

Try Supermodel Free