svelte
5.58.0 · 18 Nov 2026MIT10.4M / weekRepositoryHomepagenpmAtom feed
4.2.20 is the newest release of 4.x.
In short
21 breaking10 new14 fixed1 internal
- Breaking
Minimum supported Node version is now Node 16
- Breaking
Minimum supported webpack version is now webpack 5
- Breaking
Bundlers must specify the
browsercondition when building a frontend bundle for the browser - Breaking
Minimum supported vite-plugin-svelte version is now 2.4.1. SvelteKit users can upgrade to 1.20.0 or newer to ensure a compatible version
- Breaking
Minimum supported
rollup-plugin-svelteversion is now 7.1.5 - Breaking
Minimum supported
svelte-loaderis now 3.1.8 - Breaking
Minimum supported TypeScript version is now TypeScript 5 (it will likely work with lower versions, but we make no guarantees about that)
- Breaking
Remove
svelte/registerhook, CJS runtime version and CJS compiler output
Security
7 advisories affect 4.0.0; 5.55.7 fixes them
- ModerateSvelte Vulnerable to XSS via DOM Clobbering of Internal Framework StateGHSA-rcqx-6q8c-2c42 · 14 May 2026Fixed in 5.55.7
- ModerateSvelte SSR vulnerable to cross-site scripting via spread attributesGHSA-pr6f-5x2q-rwfp · 14 May 2026Fixed in 5.55.7
- ModerateSvelte vulnerable to XSS during SSR with contenteditable `bind:innerText` and `bind:textContent`GHSA-phwv-c562-gvmh · 26 Feb 2026Fixed in 5.53.5
- ModerateSvelte SSR attribute spreading includes inherited properties from prototype chainGHSA-crpf-4hrx-3jrp · 19 Feb 2026Fixed in 5.51.5
- ModerateSvelte SSR does not validate dynamic element tag names in `<svelte:element>`GHSA-m56q-vw4c-c2cp · 19 Feb 2026Fixed in 5.51.5
2 more
- ModerateSvelte affected by cross-site scripting via spread attributes in Svelte SSRGHSA-f7gr-6p89-r883 · 19 Feb 2026Fixed in 5.51.5
- ModerateSvelte has a potential mXSS vulnerability due to improper HTML escapingGHSA-8266-84wp-wv5c · 30 Aug 2024Fixed in 4.2.19
Release note
Major Changes
- Breaking
Minimum supported Node version is now Node 16
- Breaking
Minimum supported webpack version is now webpack 5
- Breaking
Bundlers must specify the
browsercondition when building a frontend bundle for the browser - Breaking
Minimum supported vite-plugin-svelte version is now 2.4.1. SvelteKit users can upgrade to 1.20.0 or newer to ensure a compatible version
- Breaking
Minimum supported
rollup-plugin-svelteversion is now 7.1.5 - Breaking
Minimum supported
svelte-loaderis now 3.1.8 - Breaking
Minimum supported TypeScript version is now TypeScript 5 (it will likely work with lower versions, but we make no guarantees about that)
- Breaking
Remove
svelte/registerhook, CJS runtime version and CJS compiler output - Breaking
Stricter types for
createEventDispatcher(see PR for migration instructions) - Breaking
Stricter types for
ActionandActionReturn(see PR for migration instructions) - Breaking
Stricter types for
onMount- now throws a type error when returning a function asynchronously to catch potential mistakes around callback functions
(see PR for migration instructions) - Breaking
Overhaul and drastically improve creating custom elements with Svelte (see PR for list of changes and migration instructions) ([#8457](github.
com/sveltejs/svelte/pull/8457)) - Breaking
Deprecate
SvelteComponentTypedin favor ofSvelteComponent - Breaking
Make transitions local by default to prevent confusion around page navigations
- Breaking
Error on falsy values instead of stores passed to
derived - Breaking
Custom store implementers now need to pass an
updatefunction additionally to thesetfunction ([#6750](github.com/sveltejs/svelte/pull/
6750)) - Breaking
Do not expose default slot bindings to named slots and vice versa
- Breaking
Change order in which preprocessors are applied
- Breaking
The runtime now makes use of
classList.toggle(name, boolean)which does not work in very old browsers ([#8629](github.com/sveltejs/svelte/
pull/8629)) - Breaking
Apply
inertto outroing elements - Breaking
Use
CustomEventconstructor instead of deprecatedcreateEventmethod
Minor Changes
Add a way to modify attributes for script/style preprocessors
Improve hydration speed by adding
data-svelte-hattribute to detect unchanged HTML elementsAdd
a11y no-noninteractive-element-interactionsruleAdd
a11y-no-static-element-interactionsruleAllow
#eachto iterate over iterables likeSet,MapetcImprove duplicate key error for keyed
eachblocksWarn about
:in attributes and props to prevent ambiguity with Svelte directivesAdd version info to
window. You can opt out by settingdiscloseVersiontofalsein the compiler optionsSmaller minified output for destructor chunks
Patch Changes
Bind
nulloption and input values consistentlyAllow
$storeto be used with changing values including nullish valuesInitialize stylesheet with
/* empty */to enable setting CSP directive that also works in SafariTreat slots as if they don't exist when using CSS adjacent and general sibling combinators
Fix transitions so that they don't require a
style-src 'unsafe-inline'Content Security Policy (CSP) (#6662).Explicitly disallow
vardeclarations extending the reactive statement scopeImprove error message when trying to use
animate:directives on inline componentsExport ComponentType from
svelteentrypointNever use html optimization for mustache tags in hydration mode
Derived store types
Generate type declarations with dts-buddy
Ensure types are loaded with all TS settings
Account for preprocessor source maps when calculating meta info
Warn on boolean compilerOptions.css
Export correct SvelteComponent type
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.