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

legacy-client.js — svelte Source File

Architecture documentation for legacy-client.js, a javascript file in the svelte codebase. 23 imports, 2 dependents.

File javascript SharedInternal DOMUtils 23 imports 2 dependents 5 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  9478150a_17fe_efce_10bd_3938ed8558e2["legacy-client.js"]
  984fb981_b6f6_b4f9_e92f_deca1946ed7f["constants.js"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> 984fb981_b6f6_b4f9_e92f_deca1946ed7f
  1ae6fa4e_16ee_acdf_5e28_17eb0819fddb["effects.js"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> 1ae6fa4e_16ee_acdf_5e28_17eb0819fddb
  b4142a92_fb70_a0da_ca48_719b2f2398ad["user_pre_effect"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> b4142a92_fb70_a0da_ca48_719b2f2398ad
  e5c35d51_28d8_9054_923d_b7f82a3c8dc2["sources.js"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> e5c35d51_28d8_9054_923d_b7f82a3c8dc2
  03788141_01d2_5299_6e22_4211e661afe4["mutable_source"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> 03788141_01d2_5299_6e22_4211e661afe4
  63ee8247_ada4_9f1d_e139_0c1167cd5b1c["set"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> 63ee8247_ada4_9f1d_e139_0c1167cd5b1c
  deb813bb_c5d2_3dfd_2554_606359abaa83["render.js"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> deb813bb_c5d2_3dfd_2554_606359abaa83
  e6912e2f_bd46_b7e4_ae8b_8a5955a81c03["hydrate"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> e6912e2f_bd46_b7e4_ae8b_8a5955a81c03
  855d318b_fb8d_deea_1877_351d93513f13["mount"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> 855d318b_fb8d_deea_1877_351d93513f13
  06f2307f_37db_1e25_c26b_19978071ccc7["unmount"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> 06f2307f_37db_1e25_c26b_19978071ccc7
  bde4209f_8ffc_1594_4024_b1835a44bcf6["runtime.js"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> bde4209f_8ffc_1594_4024_b1835a44bcf6
  a08b6cc5_af73_1be4_d02f_3113cf8a8305["get"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> a08b6cc5_af73_1be4_d02f_3113cf8a8305
  d8e42d9d_2e3c_635c_19d3_b946a4341c0f["batch.js"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> d8e42d9d_2e3c_635c_19d3_b946a4341c0f
  5bc3c950_96f7_e454_6cb7_65ffc2179811["flushSync"]
  9478150a_17fe_efce_10bd_3938ed8558e2 --> 5bc3c950_96f7_e454_6cb7_65ffc2179811
  style 9478150a_17fe_efce_10bd_3938ed8558e2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/** @import { ComponentConstructorOptions, ComponentType, SvelteComponent, Component } from 'svelte' */
import { DIRTY, LEGACY_PROPS, MAYBE_DIRTY } from '../internal/client/constants.js';
import { user_pre_effect } from '../internal/client/reactivity/effects.js';
import { mutable_source, set } from '../internal/client/reactivity/sources.js';
import { hydrate, mount, unmount } from '../internal/client/render.js';
import { active_effect, get } from '../internal/client/runtime.js';
import { flushSync } from '../internal/client/reactivity/batch.js';
import { define_property, is_array } from '../internal/shared/utils.js';
import * as e from '../internal/client/errors.js';
import * as w from '../internal/client/warnings.js';
import { DEV } from 'esm-env';
import { FILENAME } from '../constants.js';
import { component_context, dev_current_component_function } from '../internal/client/context.js';
import { async_mode_flag } from '../internal/flags/index.js';
import { set_signal_status } from '../internal/client/reactivity/status.js';

/**
 * Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.
 *
 * @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5.
 *
 * @template {Record<string, any>} Props
 * @template {Record<string, any>} Exports
 * @template {Record<string, any>} Events
 * @template {Record<string, any>} Slots
 *
 * @param {ComponentConstructorOptions<Props> & {
 * 	component: ComponentType<SvelteComponent<Props, Events, Slots>> | Component<Props>;
 * }} options
 * @returns {SvelteComponent<Props, Events, Slots> & Exports}
 */
export function createClassComponent(options) {
	// @ts-expect-error $$prop_def etc are not actually defined
	return new Svelte4Component(options);
}

/**
 * Takes the component function and returns a Svelte 4 compatible component constructor.
 *
 * @deprecated Use this only as a temporary solution to migrate your imperative component code to Svelte 5.
 *
 * @template {Record<string, any>} Props
 * @template {Record<string, any>} Exports
 * @template {Record<string, any>} Events
 * @template {Record<string, any>} Slots
 *
 * @param {SvelteComponent<Props, Events, Slots> | Component<Props>} component
 * @returns {ComponentType<SvelteComponent<Props, Events, Slots> & Exports>}
 */
export function asClassComponent(component) {
	// @ts-expect-error $$prop_def etc are not actually defined
	return class extends Svelte4Component {
		/** @param {any} options */
		constructor(options) {
			super({
				component,
				...options
			});
		}
	};
// ... (221 more lines)

Subdomains

Frequently Asked Questions

What does legacy-client.js do?
legacy-client.js is a source file in the svelte codebase, written in javascript. It belongs to the SharedInternal domain, DOMUtils subdomain.
What functions are defined in legacy-client.js?
legacy-client.js defines 5 function(s): asClassComponent, createBubbler, createClassComponent, handlers, run.
What does legacy-client.js depend on?
legacy-client.js imports 23 module(s): batch.js, constants.js, constants.js, context.js, effects.js, errors.js, esm-env, flushSync, and 15 more.
What files import legacy-client.js?
legacy-client.js is imported by 2 file(s): custom-element.js, legacy-server.js.
Where is legacy-client.js in the architecture?
legacy-client.js is located at packages/svelte/src/legacy/legacy-client.js (domain: SharedInternal, subdomain: DOMUtils, directory: packages/svelte/src/legacy).

Analyze Your Own Codebase

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

Try Supermodel Free