# Feature catalog — sveltejs/svelte

> Canonical page: https://codevetter.com/unpack/svelte/feature-catalog

# Feature catalog — sveltejs/svelte

Scanned commit 636eaaaa6f064b55072e7d192bb76dc9d8c4516e (2026-09-18). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

There are no routes or screens — the user-facing surface is a set of npm subpath exports and a compiler API. Broadly: the compiler API (`compile`, `compileModule`, `parse`, `parseCss`, `preprocess`, `print`, `migrate`), the component runtime lifecycle API (`mount`, `hydrate`, `unmount`, `flushSync`, `fork`, `tick`, `untrack`, `settled`), context and lifecycle helpers, and a set of reactive standard-library classes. Around those sit optional subpackages for transitions, animations, easing, motion springs, stores, attachments, and events. Compiler behaviour is configurable through a validated options table, and two experimental features — async mode and `hydratable` — gate themselves on a runtime flag.
- `compile(source, options)` returns `{ js, css, warnings, metadata: { runes }, ast }`, where `ast` is post-processed by `to_public_ast` into either a modern AST (metadata stripped via a zimmerframe walk) or a Svelte 4-shaped legacy AST via `convert` from `compiler/legacy.js`. — [packages/svelte/src/compiler/index.js#L23-60](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/compiler/index.js#L23-L60) [packages/svelte/src/compiler/index.js#L145-175](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/compiler/index.js#L145-L175) [packages/svelte/src/compiler/legacy.js#L1-20](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/compiler/legacy.js#L1-L20)
- `parseCss(source)` is a standalone CSS-only entry point that uses `Parser.forCss` — a static factory that `Object.create`s a Parser prototype and skips all Svelte component parsing setup — returning a `StyleSheetFile` node with collected `css_comments`. — [packages/svelte/src/compiler/index.js#L126-146](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/compiler/index.js#L126-L146) [packages/svelte/src/compiler/phases/1-parse/index.js#L37-50](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/compiler/phases/1-parse/index.js#L37-L50)
- `migrate(source, { filename, use_ts })` (2,003 lines in `compiler/migrate/index.js`) is a Svelte 4 → 5 source-to-source codemod exposed publicly through `svelte/compiler`. — [packages/svelte/src/compiler/migrate/index.js#L124](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/compiler/migrate/index.js#L124) [packages/svelte/src/compiler/index.js#L202](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/compiler/index.js#L202)
- `preprocess` accepts a `PreprocessorGroup` or array and applies hooks in a fixed order per preprocessor — `markup`, then `script`, then `style` — matching `<script>`/`<style>` blocks with dedicated regexes and stitching sourcemaps back together. — [packages/svelte/src/compiler/preprocess/index.js#L253-268](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/compiler/preprocess/index.js#L253-L268) [packages/svelte/src/compiler/preprocess/index.js#L338-368](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/compiler/preprocess/index.js#L338-L368)
- Compiler options are a declarative validator table in `validate-options.js`: `css` ('injected'|'external'), `cssHash`, `dev`, `discloseVersion`, `hmr`, `modernAst`, `namespace` ('html'|'mathml'|'svg'), `preserveComments`, `preserveWhitespace`, `fragments` ('html'|'tree'), `warningFilter`, and `experimental.async`. — [packages/svelte/src/compiler/validate-options.js#L11-130](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/compiler/validate-options.js#L11-L130)
- `mount(component, options)` and `hydrate(component, options)` are the two client entry points; both funnel into `_mount`, which accepts `target`, `anchor`, `props`, `events`, `context`, `intro`, and `transformError`. — [packages/svelte/src/internal/client/render.js#L56-100](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/internal/client/render.js#L56-L100) [packages/svelte/src/internal/client/render.js#L156-200](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/internal/client/render.js#L156-L200)
- The top-level `svelte` export surfaces `onMount`, `onDestroy`, `beforeUpdate`, `afterUpdate`, `createEventDispatcher`, `getAbortSignal`, plus re-exports of `flushSync`/`fork`, the context family, `hydratable`, `mount`/`hydrate`/`unmount`, `tick`/`untrack`/`settled`, and `createRawSnippet`. — [packages/svelte/src/index-client.js#L230-250](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/index-client.js#L230-L250) [packages/svelte/src/index-client.js#L44-105](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/index-client.js#L44-L105)
- `getAbortSignal()` lazily creates an `AbortController` on the active reaction (`active_reaction.ac ??= new AbortController()`) and throws `get_abort_signal_outside_reaction` if called outside a derived/effect; the abort reason is the shared `STALE_REACTION` singleton error. — [packages/svelte/src/index-client.js#L66-74](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/index-client.js#L66-L74) [packages/svelte/src/internal/client/constants.js#L73-79](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/internal/client/constants.js#L73-L79)
- `svelte/reactivity` ships seven reactive primitives: `SvelteDate`, `SvelteSet`, `SvelteMap`, `SvelteURL`, `SvelteURLSearchParams`, `MediaQuery`, and `createSubscriber`. — [packages/svelte/src/reactivity/index-client.js](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/reactivity/index-client.js)
- `svelte/attachments` provides `createAttachmentKey()` (a `Symbol(ATTACHMENT_KEY)` recognised when spread onto an element) and `fromAction()`, which adapts a legacy `use:` action into the newer `{@attach}` form. — [packages/svelte/src/attachments/index.js#L1-50](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/attachments/index.js#L1-L50)
- `render(component, options)` on the server accepts `props`, `context`, `idPrefix`, `csp`, and `transformError`, and hard-errors with `invalid_csp` if both `csp.hash` and `csp.nonce` are supplied. — [packages/svelte/src/internal/server/index.js#L64-77](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/internal/server/index.js#L64-L77)
- `hydratable(key, fn)` is an experimental server→client data-transfer feature: the server side serialises values with `devalue` into a lookup keyed by string, and the client side reads them back out of `window.__svelte.h`; both sides throw `experimental_async_required` when `async_mode_flag` is false. — [packages/svelte/src/internal/server/hydratable.js#L1-40](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/internal/server/hydratable.js#L1-L40) [packages/svelte/src/internal/client/hydratable.js#L1-33](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/internal/client/hydratable.js#L1-L33)
- Legacy Svelte 4 compatibility is a first-class subpackage: `svelte/legacy` exports `createClassComponent`, `asClassComponent`, `run`, and `createBubbler` for imperative/class-component migration. — [packages/svelte/src/legacy/legacy-client.js#L32-50](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/legacy/legacy-client.js#L32-L50) [packages/svelte/src/legacy/legacy-client.js#L190-250](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/legacy/legacy-client.js#L190-L250)
- Dev-mode-only features live under `internal/client/dev/`: `hmr.js` (block-based component hot swap), `ownership.js` (mutation-of-non-bound-prop validation), `inspect.js`, `tracing.js`, `console-log.js`, and `debug.js`. — [packages/svelte/src/internal/client/dev/hmr.js#L1-60](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/internal/client/dev/hmr.js#L1-L60) [packages/svelte/src/internal/client/dev/ownership.js#L1-30](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/packages/svelte/src/internal/client/dev/ownership.js#L1-L30)
- The sandbox playground offers `pnpm download <url|github-repo|test-name>` and `--create-test`, which drives a headless Chromium via Playwright to pull a reproduction into a local sample directory. — [playgrounds/sandbox/scripts/download.js#L1-55](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/playgrounds/sandbox/scripts/download.js#L1-L55) [playgrounds/sandbox/package.json](https://github.com/sveltejs/svelte/blob/636eaaaa6f064b55072e7d192bb76dc9d8c4516e/playgrounds/sandbox/package.json)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
