Discuss your project

Svelte 4: Upgraded and Optimized for Developers

/* by Tirth Bodawala - June 26, 2023 */

The Svelte team has officially released Svelte 4, four years after the launch of Svelte 3. This release incorporates updates from Node.js and browser APIs, reflecting the team’s commitment to keeping the language relevant and efficient{:target=”_blank”}.

Enhanced Performance

Performance is a key focus of Svelte 4. With a package size reduction of 75%, the update will benefit users of the Svelte REPL, the interactive learning experience on learn.svelte.dev, and those operating in low connectivity environments. Additionally, the number of dependencies has been cut from 61 to 16, leading to quicker downloads and a lower risk of supply chain attacks.

Streamlined Developer Experience

Svelte 4 introduces an improved process for authoring custom elements, making it more consistent and intuitive. An updated IDE authoring experience now allows a cmd+click to directly navigate to the actual implementation, and svelte/internal file imports are hidden to avoid cluttering autocomplete suggestions. Other enhancements include a new default for transitions, simplified preprocessors, and an easier to use CSP.

Revamped Svelte Website

The Svelte website has been redesigned to provide better resources for developers. Improvements include a new multi-page structure, enhanced mobile navigation, improved TypeScript documentation, dark mode, and an upgraded REPL. The SvelteKit site will also see updates reflecting these changes.

Preview of Svelte 5

Svelte 5 is already in the works and it will be a complete overhaul of the compiler and runtime. Svelte 4 lays the groundwork for this future release, which is set to bring further performance improvements and major new features.

In summary, Svelte 4 marks a significant step forward for the language, offering a host of improvements designed to optimize both performance and the developer experience. Stay tuned for more updates on Svelte 5 and beyond.