The maintainers of the web development language Svelte have announced the stable release of Svelte 4.
It has been over four years since Svelte 3 came out, and since then there have been a number of updates to Node.js and browser APIs, and Svelte 4 includes updates to take advantage of those capabilities.
First off, it offers performance improvements, such as a package size reduction of 75%. The team says the people who will notice this the most include those loading the interactive learning experience on learn.svelte.dev, users of the Svelte REPL, and users with limited connectivity.
They have also reduced the number of dependencies in the language from 61 to 16, leading to both faster downloads and reduced risk of supply chain attacks.
Another major focus on this release is developer experience. The process of authoring custom elements has been overhauled and is now more intuitive and consistent. The IDE authoring experience was also updated, with cmd+click now takes you to the actual implementation and file imports from svelte/internal are hidden so as not to clutter autocomplete suggestions.
Other developer updates include a new default for transitions that prevents animations from blocking page transitions, preprocessors are easier to write, and CSP is now easier to set up and use.
And finally, the Svelte website was overhauled and now contains multiple pages as well as improved mobile nav, better TypeScript docs, dark mode, and better REPL. The SvelteKit site is also being updated to match these chants. All tutorial links have also been updated to point to the new learn.svelte.dev site.
The team also shared some details about Svelte 5, which will be a full rewrite of the compiler and runtime. According to the maintainers, Svelte 4 lays much of the groundwork for Svelte 5, which will include major new features and performance improvements.