Home / Type/ ComponentAnalysis Type — svelte Architecture

ComponentAnalysis Type — svelte Architecture

Architecture documentation for the ComponentAnalysis type/interface in types.d.ts from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  4aac56ae_4962_2bc1_87cf_f1cbc864137e["ComponentAnalysis"]
  b9a4cd04_e52a_90fe_ac6f_7273522c700e["types.d.ts"]
  4aac56ae_4962_2bc1_87cf_f1cbc864137e -->|defined in| b9a4cd04_e52a_90fe_ac6f_7273522c700e
  style 4aac56ae_4962_2bc1_87cf_f1cbc864137e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/types.d.ts lines 71–137

export interface ComponentAnalysis extends Analysis {
	root: ScopeRoot;
	instance: Js;
	template: Template;
	/** Used for CSS pruning and scoping */
	elements: Array<AST.RegularElement | AST.SvelteElement>;
	runes: boolean;
	maybe_runes: boolean;
	tracing: boolean;
	exports: Array<{ name: string; alias: string | null }>;
	/** Whether the component uses `$$props` */
	uses_props: boolean;
	/** The component ID variable name, if any */
	props_id: Identifier | null;
	/** Whether the component uses `$$restProps` */
	uses_rest_props: boolean;
	/** Whether the component uses `$$slots` */
	uses_slots: boolean;
	uses_component_bindings: boolean;
	uses_render_tags: boolean;
	needs_context: boolean;
	needs_mutation_validation: boolean;
	needs_props: boolean;
	/** Set to the first event directive (on:x) found on a DOM element in the code */
	event_directive_node: AST.OnDirective | null;
	/** true if uses event attributes (onclick) on a DOM element */
	uses_event_attributes: boolean;
	/**
	 * Contains the content of `<svelte:options customElement={...} />`,
	 * or if not present a boolean which corresponds to the compiler option value
	 */
	custom_element: boolean | AST.SvelteOptions['customElement'];
	/** If `true`, should append styles through JavaScript */
	inject_styles: boolean;
	reactive_statements: Map<LabeledStatement, ReactiveStatement>;
	/** Identifiers that make up the `bind:group` expression -> internal group binding name */
	binding_groups: Map<[key: string, bindings: Array<Binding | null>], Identifier>;
	slot_names: Map<string, AST.SlotElement>;
	css: {
		ast: AST.CSS.StyleSheet | null;
		hash: string;
		keyframes: string[];
		has_global: boolean;
	};
	/** @deprecated use `source` from `state.js` instead */
	source: string;
	/**
	 * Every render tag/component, and whether it could be definitively resolved or not
	 */
	snippet_renderers: Map<
		AST.RenderTag | AST.Component | AST.SvelteComponent | AST.SvelteSelf,
		boolean
	>;
	/**
	 * Every snippet that is declared locally
	 */
	snippets: Set<AST.SnippetBlock>;
	/**
	 * Pre-transformed `<script>` block
	 */
	instance_body: {
		hoisted: Array<Statement | ModuleDeclaration>;
		sync: Array<Statement | ModuleDeclaration | VariableDeclaration>;
		async: Array<{ node: Statement | VariableDeclarator; has_await: boolean }>;
		declarations: Array<Identifier>;
	};
}

Frequently Asked Questions

What is the ComponentAnalysis type?
ComponentAnalysis is a type/interface in the svelte codebase, defined in packages/svelte/src/compiler/phases/types.d.ts.
Where is ComponentAnalysis defined?
ComponentAnalysis is defined in packages/svelte/src/compiler/phases/types.d.ts at line 71.

Analyze Your Own Codebase

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

Try Supermodel Free