Home / Function/ AttachTag() — svelte Function Reference

AttachTag() — svelte Function Reference

Architecture documentation for the AttachTag() function in AttachTag.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  424243c8_8885_4e93_123b_842ee250cdd1["AttachTag()"]
  3bf183de_51b2_6888_893b_2c53de029374["AttachTag.js"]
  424243c8_8885_4e93_123b_842ee250cdd1 -->|defined in| 3bf183de_51b2_6888_893b_2c53de029374
  66243dec_e2be_a66d_3992_3ea42cf964b5["build_expression()"]
  424243c8_8885_4e93_123b_842ee250cdd1 -->|calls| 66243dec_e2be_a66d_3992_3ea42cf964b5
  17bf7dd4_180b_749a_b3a5_3d860418258a["stmt()"]
  424243c8_8885_4e93_123b_842ee250cdd1 -->|calls| 17bf7dd4_180b_749a_b3a5_3d860418258a
  9355e0e3_4307_8bdc_56bd_b051565ab1a9["call()"]
  424243c8_8885_4e93_123b_842ee250cdd1 -->|calls| 9355e0e3_4307_8bdc_56bd_b051565ab1a9
  ee6da0da_a970_1fca_7676_8193019eb85e["thunk()"]
  424243c8_8885_4e93_123b_842ee250cdd1 -->|calls| ee6da0da_a970_1fca_7676_8193019eb85e
  c8d80c9d_ab6c_13c0_c85e_a9b120f82f45["blockers()"]
  424243c8_8885_4e93_123b_842ee250cdd1 -->|calls| c8d80c9d_ab6c_13c0_c85e_a9b120f82f45
  cde3493f_2d4d_f9ab_bb84_5342216c9cf3["block()"]
  424243c8_8885_4e93_123b_842ee250cdd1 -->|calls| cde3493f_2d4d_f9ab_bb84_5342216c9cf3
  style 424243c8_8885_4e93_123b_842ee250cdd1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/3-transform/client/visitors/AttachTag.js lines 10–26

export function AttachTag(node, context) {
	const expression = build_expression(context, node.expression, node.metadata.expression);
	let statement = b.stmt(b.call('$.attach', context.state.node, b.thunk(expression)));

	if (node.metadata.expression.is_async()) {
		statement = b.stmt(
			b.call(
				'$.run_after_blockers',
				node.metadata.expression.blockers(),
				b.thunk(b.block([statement]))
			)
		);
	}

	context.state.init.push(statement);
	context.next();
}

Domain

Subdomains

Frequently Asked Questions

What does AttachTag() do?
AttachTag() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/3-transform/client/visitors/AttachTag.js.
Where is AttachTag() defined?
AttachTag() is defined in packages/svelte/src/compiler/phases/3-transform/client/visitors/AttachTag.js at line 10.
What does AttachTag() call?
AttachTag() calls 6 function(s): block, blockers, build_expression, call, stmt, thunk.

Analyze Your Own Codebase

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

Try Supermodel Free