Home / File/ index-client.js — svelte Source File

index-client.js — svelte Source File

Architecture documentation for index-client.js, a javascript file in the svelte codebase. 8 imports, 32 dependents.

File javascript SharedInternal BitFlags 8 imports 32 dependents 9 functions

Entity Profile

Dependency Diagram

graph LR
  717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2["index-client.js"]
  bde4209f_8ffc_1594_4024_b1835a44bcf6["runtime.js"]
  717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2 --> bde4209f_8ffc_1594_4024_b1835a44bcf6
  a814b193_e12a_4037_c3c8_dfd45f3bd0bb["untrack"]
  717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2 --> a814b193_e12a_4037_c3c8_dfd45f3bd0bb
  cb946435_ce66_d1e8_6bee_287bdb07e7c5["utils.js"]
  717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2 --> cb946435_ce66_d1e8_6bee_287bdb07e7c5
  a90e5ee7_62bf_5257_b6d7_6579a13ff90b["index.js"]
  717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2 --> a90e5ee7_62bf_5257_b6d7_6579a13ff90b
  ff387d97_d6d2_81e0_e731_656552709d27["errors.js"]
  717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2 --> ff387d97_d6d2_81e0_e731_656552709d27
  3c211218_0172_f6af_dd4f_da8028a531fc["index.js"]
  717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2 --> 3c211218_0172_f6af_dd4f_da8028a531fc
  48cf26f8_bf34_fd7a_3d52_cc963051e167["context.js"]
  717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2 --> 48cf26f8_bf34_fd7a_3d52_cc963051e167
  c9866d91_a204_fa55_a9e3_6bcc6aaaec1e["esm-env"]
  717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2 --> c9866d91_a204_fa55_a9e3_6bcc6aaaec1e
  046e8489_7de3_c124_9983_4b051435f74f["index.js"]
  046e8489_7de3_c124_9983_4b051435f74f --> 717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2
  3654304d_e89d_c28d_2667_5d1a3440f6d3["date.test.ts"]
  3654304d_e89d_c28d_2667_5d1a3440f6d3 --> 717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2
  df1c895a_6a70_d120_e792_7fee0a5c8582["map.test.ts"]
  df1c895a_6a70_d120_e792_7fee0a5c8582 --> 717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2
  b4a6f564_9aa8_4c6b_ce31_932a89e33306["set.test.ts"]
  b4a6f564_9aa8_4c6b_ce31_932a89e33306 --> 717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2
  b13a3c81_1fb3_08ab_9e18_61efe88dbaac["url-search-params.test.ts"]
  b13a3c81_1fb3_08ab_9e18_61efe88dbaac --> 717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2
  4706453c_293a_0c92_672f_d49761b1dae7["url.test.ts"]
  4706453c_293a_0c92_672f_d49761b1dae7 --> 717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2
  style 717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/** @import { ComponentContext, ComponentContextLegacy } from '#client' */
/** @import { EventDispatcher } from './index.js' */
/** @import { NotFunction } from './internal/types.js' */
import { active_reaction, untrack } from './internal/client/runtime.js';
import { is_array } from './internal/shared/utils.js';
import { user_effect } from './internal/client/index.js';
import * as e from './internal/client/errors.js';
import { legacy_mode_flag } from './internal/flags/index.js';
import { component_context } from './internal/client/context.js';
import { DEV } from 'esm-env';

if (DEV) {
	/**
	 * @param {string} rune
	 */
	function throw_rune_error(rune) {
		if (!(rune in globalThis)) {
			// TODO if people start adjusting the "this can contain runes" config through v-p-s more, adjust this message
			/** @type {any} */
			let value; // let's hope noone modifies this global, but belts and braces
			Object.defineProperty(globalThis, rune, {
				configurable: true,
				// eslint-disable-next-line getter-return
				get: () => {
					if (value !== undefined) {
						return value;
					}

					e.rune_outside_svelte(rune);
				},
				set: (v) => {
					value = v;
				}
			});
		}
	}

	throw_rune_error('$state');
	throw_rune_error('$effect');
	throw_rune_error('$derived');
	throw_rune_error('$inspect');
	throw_rune_error('$props');
	throw_rune_error('$bindable');
}

/**
 * Returns an [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that aborts when the current [derived](https://svelte.dev/docs/svelte/$derived) or [effect](https://svelte.dev/docs/svelte/$effect) re-runs or is destroyed.
 *
 * Must be called while a derived or effect is running.
 *
 * ```svelte
 * <script>
 * 	import { getAbortSignal } from 'svelte';
 *
 * 	let { id } = $props();
 *
 * 	async function getData(id) {
 * 		const response = await fetch(`/items/${id}`, {
 * 			signal: getAbortSignal()
 * 		});
// ... (196 more lines)

Subdomains

Imported By

Frequently Asked Questions

What does index-client.js do?
index-client.js is a source file in the svelte codebase, written in javascript. It belongs to the SharedInternal domain, BitFlags subdomain.
What functions are defined in index-client.js?
index-client.js defines 9 function(s): afterUpdate, beforeUpdate, createEventDispatcher, create_custom_event, getAbortSignal, init_update_callbacks, onDestroy, onMount, throw_rune_error.
What does index-client.js depend on?
index-client.js imports 8 module(s): context.js, errors.js, esm-env, index.js, index.js, runtime.js, untrack, utils.js.
What files import index-client.js?
index-client.js is imported by 32 file(s): _config.js, _config.js, _config.js, _config.js, _config.js, _config.js, _config.js, _config.js, and 24 more.
Where is index-client.js in the architecture?
index-client.js is located at packages/svelte/src/index-client.js (domain: SharedInternal, subdomain: BitFlags, directory: packages/svelte/src).

Analyze Your Own Codebase

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

Try Supermodel Free