sveltejs/svelte
Glossary
Active contributors: Rich Harris, Simon H, Dominic Gannaway
Domain vocabulary used across the Svelte codebase. When a term has a published API surface (e.g., $state), the user-facing docs at https://svelte.dev/docs/svelte are the canonical source — this glossary focuses on internal terms.
| Term | Definition |
|---|---|
| Rune | A compiler-recognised global like $state, $derived, $effect, $props, $bindable, $inspect. Detected in packages/svelte/src/compiler/phases/2-analyze/index.js. |
| Runes mode | A component or module is in runes mode when any rune is used (or <svelte:options runes> is set). Disables Svelte 4 reactivity ($: labels, auto-subscribe stores). |
| Legacy mode | Svelte 4 compatibility mode — reactive labels ($:), export let, auto-subscribed stores. Lives in packages/svelte/src/internal/client/dom/legacy/ and packages/svelte/src/legacy/. |
| Source | A leaf reactive value (the result of $state(x)). Type defined in packages/svelte/src/internal/client/reactivity/types.d.ts. Implementation in reactivity/sources.js. |
| Derived | A reactive computation (the result of $derived(...) or $derived.by(...)). Memoised; recomputed when any source it read becomes dirty. See reactivity/deriveds.js. |
| Effect | A side-effectful reaction. Blocks (each, if, await), bindings, transitions and $effect(...) all create effects. See reactivity/effects.js. |
| Reaction | Umbrella term: a Derived or Effect. Both extend a common shape with deps, version, and a status bitmask in internal/client/constants.js. |
| Batch | A unit of work that flushes effects together on a microtask. See reactivity/batch.js. Exposed via flushSync and (Svelte 5.x) fork. |
| Boundary | An async error boundary block. Implementation in packages/svelte/src/internal/client/dom/blocks/boundary.js. |
| Block | A compiled DOM segment such as each, if, await, key, html, snippet, svelte-component, svelte-element, svelte-head. One file per block in internal/client/dom/blocks/. |
| Snippet | A reusable markup chunk declared with {#snippet name(args)}...{/snippet} and rendered with {@render name(args)}. Runtime: internal/client/dom/blocks/snippet.js. |
| Hydratable | A flag on the root that marks rendered output as hydratable. See internal/client/hydratable.js and the matching server flag in internal/server/hydratable.js. |
| Hydration | Re-attaching event listeners and reactivity to server-rendered DOM. Entry: internal/client/render.js#hydrate. Helpers in internal/client/dom/hydration.js. |
| Proxy | The deep-reactive Proxy wrapper for $state(object). Uses STATE_SYMBOL to detect already-proxied values. See internal/client/proxy.js. |
| Component context | Per-instance state (props, lifecycle callbacks, parent/child links). See internal/client/context.js. |
| Renderer | Server-side string-tree builder that collects HTML, comments, and head content. See internal/server/renderer.js. |
| Phase | One of three compiler phases: 1-parse, 2-analyze, 3-transform. Each is a directory under packages/svelte/src/compiler/phases/. |
| Visitor | A per-AST-node function used by analyze and transform. Files live in phases/2-analyze/visitors/ and phases/3-transform/{client,server}/visitors/. |
| Scope | A lexical scope tracked by the compiler. The full graph builder is packages/svelte/src/compiler/phases/scope.js (1.4k+ lines, the largest single file in the compiler). |
| HMR | Hot module replacement marker class injected by the compiler when hmr: true. Helper in internal/client/dev/hmr.js. |
| Async mode | An opt-in flag (SVELTE_NO_ASYNC to disable) that enables async-aware effects. The flag flag is in internal/flags/async.js. CI exercises both modes. |
| Tracing | Opt-in dev-time tracking of which effects depend on which sources. See internal/client/dev/tracing.js and the public $inspect.trace rune. |
| Action (legacy) | A use:foo directive on an element. Now supplanted by attachments, but still supported. Runtime: internal/client/dom/elements/actions.js. |
| Attachment | A modern alternative to actions — a function attached via {@attach foo} or attachment() key. See packages/svelte/src/attachments/index.js. |
| CSP nonce | Server-side renderer collects nonces for inline <style> and <script>. Tracked through RenderOutput.csp (server public.d.ts). |
svelte/internal |
Internal modules consumed only by compiled component code, not by user code. Exposed via subpath exports in packages/svelte/package.json. |
| Migrate | The Svelte 4 → Svelte 5 codemod, exposed via svelte/compiler#migrate. Lives in packages/svelte/src/compiler/migrate/index.js (~2k lines). |
For published API names — mount, hydrate, tick, untrack, flushSync, getContext, etc. — see packages/svelte/src/index-client.js and packages/svelte/src/server/index.js.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.