Open-source project
sveltejs/svelte avatar
sveltejs/svelte

Svelte 5: A compiler that removes the virtual DOM from the runtime equation

Svelte compiles components into focused JavaScript so browsers update the page without shipping a virtual DOM runtime.

88,129 stars5,279 forksJavaScriptMIT

At a glance

What is it?
Svelte compiles declarative components into focused JavaScript that updates the DOM directly, skipping the virtual DOM runtime entirely. This review covers how it works, how to get started, and where the trade-offs lie.
Who is it for?
Adopt Svelte if your team values small bundle sizes, direct DOM updates, and a compiler that catches mistakes at build time, and if you are comfortable with its relatively young ecosystem compared to React or Vue. Do not adopt it if you need a mature virtual DOM ecosystem, if your tooling depends on runtime reactivity patterns, or if you cannot commit to learning the compiler's specific model.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What Svelte actually does differently

Most UI frameworks ship a runtime that interprets your component code at page load. React and Vue include a virtual DOM layer that diffs changes and applies updates. Svelte takes a different path. It is a compiler that reads your declarative components and outputs plain JavaScript. That output is designed to update the DOM directly, with no virtual DOM in between. The README puts it as 'surgically updates the DOM.' The practical effect is that the browser does less work per update, and the shipped code is smaller because there is no framework runtime to download. Svelte is not a library you import; it is a build step that transforms your source before the browser sees it.

Who this is for and what problem it solves

Svelte targets developers building web applications who are concerned about bundle size and runtime performance. The problem it solves is the overhead of a virtual DOM runtime. When you use React or Vue, every component carries a chunk of runtime code that must be parsed and executed. Svelte moves that work to compile time. The output is focused JavaScript, meaning each component compiles to code that directly manipulates the DOM elements it owns. This suits teams shipping to low-end devices, slow connections, or anyone who wants faster initial load times. It also appeals to developers who prefer writing declarative components but want the resulting code to be as close to hand-written as possible.

How the compiler turns components into DOM updates

The core mechanism is compile-time analysis. Svelte reads your component file, which mixes HTML, CSS, and JavaScript in a single file. It identifies which parts of the state are reactive, meaning they can change over time. Then it generates JavaScript that, when the state changes, updates only the specific DOM nodes that depend on that state. The documentation describes this as 'efficient JavaScript that surgically updates the DOM.' No diffing algorithm runs at runtime because the compiler has already figured out the dependencies. This is a fundamental shift from runtime frameworks, where the framework must compare the previous and next states. With Svelte, the compiler does that analysis once, at build time, and the runtime code is minimal.

Getting Svelte running in a project

The README points to the Svelte website for learning and to the Discord chatroom for community help, but it does not include installation commands. Based on the repository layout, the main package lives in packages/svelte. The standard way to start a Svelte project is to use the official scaffolding tool, which is documented on svelte.dev. Typically you would run a command like npm create svelte@latest to create a new project, then npm install to fetch dependencies, and npm run dev to start a development server. The exact commands are not in the README, so you should check the website for the current instructions. The package is published on npm as svelte, and the latest release is version 5.57.0 as of late August 2026.

Where Svelte falls short or is the wrong tool

Svelte's compile-time approach has real limitations. First, it is a build-time dependency. You cannot drop Svelte into an existing page via a script tag and expect it to work the same way as a runtime framework. Your build pipeline must include the Svelte compiler. Second, the reactivity model is different. Developers coming from React or Vue must learn Svelte's syntax and semantics, which can be a hurdle. Third, the ecosystem is smaller. Many libraries and components are written for React or Vue, and while Svelte has its own ecosystem, it is not as extensive. If your team relies on a specific React library that has no Svelte equivalent, you will have to write it yourself or find an alternative. Finally, because the compiler generates code specific to your components, any change to the compiler's output can affect your bundle, which means upgrades to Svelte itself require re-testing your application.

Alternatives and how they differ in approach

The most direct alternative is React, which uses a virtual DOM at runtime. React components are functions that return a description of the UI, and React reconciles that description with the actual DOM on every state change. This happens in the browser, at runtime. Vue sits between the two: it uses a virtual DOM but also has a compiler that optimizes some static content. Angular takes a different route with change detection and zone.js. The key difference is where the work happens. Svelte does the dependency analysis at compile time, generating imperative code. React does it at runtime, with a generic diffing algorithm. That means React's runtime is larger but more flexible, while Svelte's output is smaller but tied to the specific components you wrote. If you need to render dynamic content that changes in ways the compiler cannot predict, a runtime framework might be more forgiving.

Maintenance, license, and upgrade considerations

Svelte is MIT-licensed, which means you can use it freely in commercial projects without paying fees. The project is maintained by volunteers, as the README states, with funding through Open Collective. This is a double-edged sword. Volunteer-driven projects can move slowly or stall, but Svelte has a steady release history, with version 5.57.0 pushed on August 28, 2026, and several patch releases before that. Upgrading Svelte is not a simple version bump because the compiler's output changes between versions. You must recompile your components and test for regressions. The roadmap is available on the website, so you can check what is planned. Before adopting, review the roadmap to see if upcoming changes will affect your code. Also, check the changelog for each release to understand what changed in the compiler's output.

Editorial conclusion

Adopt Svelte if your team values small bundle sizes, direct DOM updates, and a compiler that catches mistakes at build time, and if you are comfortable with its relatively young ecosystem compared to React or Vue. Do not adopt it if you need a mature virtual DOM ecosystem, if your tooling depends on runtime reactivity patterns, or if you cannot commit to learning the compiler's specific model. Before adopting, verify that your existing libraries and build chain work with Svelte 5's component format and that your team can handle the shift from runtime to compile-time thinking.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Community notes

Community notes