
Svelte
svelte.dev- Category
- Developer Tools
- Rank
- No. 258Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- sveltejs
- GitHub
- 88.1k stars
- Latest release
- svelte@5.57.0
- Date
About
Compile-time UI framework. Compiles components to vanilla JavaScript at build time. Small bundles, fine-grained reactivity. Pairs with SvelteKit for full-stack apps.
What it does
Svelte is a build-time framework. You write components that mix markup, script and scoped styles in one file; the compiler parses them into a syntax tree, analyses scopes and reactivity, then emits plain JavaScript that updates the DOM directly. There is no runtime diffing layer. Two output targets exist, one for the browser and one for server rendering, selected by a compile option. Reactivity is declared with a small set of keyword-like primitives the compiler recognises during analysis, so state, derived values and effects are resolved statically rather than tracked at runtime by convention.
Why it's ranked here
Worth ten minutes if you want to see how a compiler-first framework is actually assembled. The pipeline is three genuinely separable stages, and the analysis stage dispatches to 61 node visitors, which is the real cost of turning template syntax into static reactivity. The counterweight is surface area: the published package declares 23 export entry points, several of them marked internal or legacy. This is not a dependency you skim. Governance is written down rather than implied: MIT license, monthly maintainer meetings, a public request-for-comments process, and a stated policy of one major effort at a time.
What's good
The compile path is legible. Parsing, analysis and code generation are separate stages with separate exported functions, so you can parse a component without generating output, or ask for a syntax tree alone. Server and browser output come from one shared analysis. Conditional exports pick the browser build in browsers and the server build elsewhere, so bundlers resolve correctly without configuration. The runtime dependency list is short and specific: a JavaScript parser, a source map codec, a tree walker, a class name helper. Contribution rules cover snapshot updating, naming conventions and a required test plan per pull request.
Tradeoffs
Two costs stand out. First, the published surface carries an explicit legacy lane beside the modern one, plus internal entry points consumers are told not to import but can, and a parser option whose default is scheduled to flip in the next major and be removed in the one after. Second, this is a monorepo wired to a single package manager: the workspace file, the scripts and the contributing guide all assume it, and running the browser tests needs a separately installed Chromium. There is no drop-in script tag here. A build step is the whole premise.
How to use it well
Two audiences. Application teams who want compiled output instead of a shipped runtime library, and tool authors who need to parse or transform component files programmatically, since the compiler is a public entry point with a separate build for older module consumers. The project points application developers at its companion framework for routing, data loading and deployment, none of which this package provides. It also gives you no component library, no state store beyond its own reactivity primitives, and no styling system past per-component scoping.
Technical notes+
packages/svelte/src/compiler/index.js is the whole pipeline in one file: strip a byte order mark, validate options, merge options declared inside the component, then call parse, analyze and transform in order. packages/svelte/src/compiler/phases/1-parse/index.js is a hand-written state-machine parser class with an index cursor, whitespace fast paths and a regex sniff for a TypeScript lang attribute; packages/svelte/src/compiler/phases/2-analyze/index.js walks that tree with 61 typed visitors plus a catch-all that manages ignore comments and scopes; packages/svelte/src/compiler/phases/3-transform/index.js branches to server or client generators and prints via esrap with source maps. packages/svelte/src/internal/client/index.js is a flat re-export barrel of the client runtime, and packages/svelte/src/server/index.js re-exports one render function. packages/svelte/package.json declares 23 export conditions and Node 18 as the floor. pnpm-workspace.yaml sets minimumReleaseAge to 2880 minutes with an allowlist and blocks exotic subdependencies. CONTRIBUTING.md documents snake_case internals versus camelCase public names, and AGENTS.md tells coding agents to fill the pull request template and run the full suite.
Observed
- License
- MIT, declared in both the monorepo root and the published package
- Language
- JavaScript with JSDoc type annotations; type declarations generated and checked in
- Compiler pipeline
- Three numbered phases: parse, analyze, transform
- Analysis breadth
- 61 node-type visitors registered in packages/svelte/src/compiler/phases/2-analyze/index.js
- Package surface
- 23 export entry points in packages/svelte/package.json, including internal, legacy and flag paths
- Interfaces
- Library plus a programmatic compiler API; browser and server builds selected by export conditions
- Platform support
- Node 18 or newer declared as the engine floor
- Repo shape
- pnpm workspace monorepo over packages and playgrounds, per pnpm-workspace.yaml
- Supply chain policy
- pnpm-workspace.yaml enforces a 2880-minute minimum release age and blocks exotic subdependencies
- Testing surface
- Vitest suites plus Playwright Chromium, with snapshot regeneration documented in CONTRIBUTING.md
- Agent guidance
- AGENTS.md ships in the repo and requires the pull request template and a full test run
Read from README.md, package.json, packages/svelte/package.json, packages/svelte/README.md, CONTRIBUTING.md, AGENTS.md, documentation/docs/01-introduction/index.md, documentation/docs/02-runes/index.md, packages/svelte/src/compiler/index.js, packages/svelte/src/compiler/phases/1-parse/index.js, packages/svelte/src/compiler/phases/2-analyze/index.js, packages/svelte/src/compiler/phases/3-transform/index.js, packages/svelte/src/internal/client/index.js, packages/svelte/src/server/index.js, pnpm-workspace.yaml.
Tags
Tech Stack
Media

Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.