Home / File/ SvelteHead.js — svelte Source File

SvelteHead.js — svelte Source File

Architecture documentation for SvelteHead.js, a javascript file in the svelte codebase. 4 imports, 1 dependents.

File javascript Compiler Transformer 4 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  96059f46_734f_8649_48af_e9bf0906b175["SvelteHead.js"]
  2aa63f4e_82c9_33e3_ac6c_5f3d46250522["utils.js"]
  96059f46_734f_8649_48af_e9bf0906b175 --> 2aa63f4e_82c9_33e3_ac6c_5f3d46250522
  d203a90b_640a_13eb_ea6d_b1a9df120247["hash"]
  96059f46_734f_8649_48af_e9bf0906b175 --> d203a90b_640a_13eb_ea6d_b1a9df120247
  62f818c8_e890_17ed_5ec1_92f953d4a7a6["state.js"]
  96059f46_734f_8649_48af_e9bf0906b175 --> 62f818c8_e890_17ed_5ec1_92f953d4a7a6
  95c28355_f14c_c3cd_5a03_d5a53ca255bc["builders"]
  96059f46_734f_8649_48af_e9bf0906b175 --> 95c28355_f14c_c3cd_5a03_d5a53ca255bc
  7665e008_f37d_b860_a594_f2539a66af4e["transform-client.js"]
  7665e008_f37d_b860_a594_f2539a66af4e --> 96059f46_734f_8649_48af_e9bf0906b175
  style 96059f46_734f_8649_48af_e9bf0906b175 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/** @import { BlockStatement } from 'estree' */
/** @import { AST } from '#compiler' */
/** @import { ComponentContext } from '../types' */
import * as b from '#compiler/builders';
import { hash } from '../../../../../utils.js';
import { filename } from '../../../../state.js';

/**
 * @param {AST.SvelteHead} node
 * @param {ComponentContext} context
 */
export function SvelteHead(node, context) {
	// TODO attributes?
	context.state.init.push(
		b.stmt(
			b.call(
				b.id('$.head', node.name_loc),
				b.literal(hash(filename)),
				b.arrow([b.id('$$anchor')], /** @type {BlockStatement} */ (context.visit(node.fragment)))
			)
		)
	);
}

Domain

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does SvelteHead.js do?
SvelteHead.js is a source file in the svelte codebase, written in javascript. It belongs to the Compiler domain, Transformer subdomain.
What functions are defined in SvelteHead.js?
SvelteHead.js defines 1 function(s): SvelteHead.
What does SvelteHead.js depend on?
SvelteHead.js imports 4 module(s): builders, hash, state.js, utils.js.
What files import SvelteHead.js?
SvelteHead.js is imported by 1 file(s): transform-client.js.
Where is SvelteHead.js in the architecture?
SvelteHead.js is located at packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteHead.js (domain: Compiler, subdomain: Transformer, directory: packages/svelte/src/compiler/phases/3-transform/client/visitors).

Analyze Your Own Codebase

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

Try Supermodel Free