Svelte is a framework for building user interfaces on the web, created by Rich Harris and first introduced in 2016. Its distinguishing idea is that it is a compiler rather than a runtime library: as the documentation states, it “uses a compiler to turn declarative components written in HTML, CSS and JavaScript into lean, tightly optimized JavaScript.” The framework’s work happens when you build your application, not while it runs in the user’s browser.
This compile-time approach is a deliberate departure from the dominant pattern of the era. Frameworks like React and Vue ship a runtime that maintains a virtual DOM, a representation of the interface kept in memory and diffed on every change to decide what to update. Svelte instead generates code that surgically updates the real DOM directly, so there is no virtual DOM and no large framework runtime shipped to the browser. The result is typically smaller bundles and less work performed at runtime.
Because so much is resolved during compilation, Svelte components can be written in a notably concise style, with reactivity expressed through ordinary assignments and declarations rather than special hooks or wrapper functions. The compiler analyzes the component to determine which pieces of state affect which parts of the output, and emits precise update instructions for each.
Svelte is paired with SvelteKit, described in the documentation as “Svelte’s companion application framework,” which adds routing, server-side rendering, data loading, and build configuration so developers can “build anything on the web, from standalone components to ambitious full stack apps.” Developed in the open at github.com/sveltejs/svelte, Svelte demonstrated that moving framework work from runtime to build time was a viable and compelling alternative architecture for front-end development.