Never miss a release that matters
AI-powered summaries of every GitHub release.
AI Summaries
Changelogs condensed into clear, actionable insights.
Always Free
Track up to 5 packages at no cost, forever.
Weekly Digest
A curated summary of every release, delivered weekly.
TL;DR
This update primarily improves the stability and correctness of reactivity, specifically regarding derived states and SSR (Server-Side Rendering) output.
Fixes Worth Knowing
- Resolved several issues with derived states, including incorrect reconnection behavior and AbortSignal handling.
- Fixed SSR transformation errors for
$state.eager()and declaration tags. - Corrected computed key transformations within keyed
{#each}blocks. - Fixed a memory leak in Tween (animation utility) when tweens were interrupted.
- Improved sourcemap chaining for preprocessors (code transformation tools).
TL;DR
Svelte now correctly removes event listeners when components are destroyed, preventing potential memory leaks and unexpected behavior.
Fixes Worth Knowing
Resolved an issue where event listeners weren’t always removed when a component unmounted, which could lead to memory leaks or incorrect functionality in dynamic applications.
Before You Upgrade
No specific action is needed; this is a bug fix release.
TL;DR
Svelte 5 introduces significant CSS scoping changes, restricting the use of :not() and :has() selectors to prevent unintended style leakage, and disallows direct state mutation within template logic.
Breaking
- State Mutation in Templates: Directly modifying state variables inside Svelte template expressions is no longer permitted. (Requires updating code to use explicit assignment.)
- CSS Selectors:
:not()and:has()selectors are now scoped, potentially requiring adjustments to complex CSS rules. (May impact component styling.) - Enumerated Types: Stronger type enforcement has been added. (May require code updates to align with stricter types.)
New
- Migration Tasks: New tooling assists with upgrading to Svelte 5, identifying and flagging potentially problematic code patterns. (Helps streamline the upgrade process.)
- Hidden Transitions: Added
until-foundandbeforematchoptions for transitions. (Provides more control over transition behavior.)
Fixes Worth Knowing
- Transitions: Transitions now work correctly within dynamic components.
- Autofocus: Autofocus now applies correctly to static elements.
- Blur Dispatch: Resolved a Chromium-specific issue
TL;DR
Svelte now uses the standard CustomEvent constructor, and developers can optionally expose the Svelte version in the browser (for debugging/reporting).
Breaking
createEventis deprecated; useCustomEventinstead (standard web API for events).
New
- Expose Svelte version in
window(can be disabled). - Smaller bundle sizes for component destructuring.
Fixes Worth Knowing
- Source maps now work correctly with Svelte preprocessors (tools that transform code).
Before You Upgrade
- Update any code using
createEventto use theCustomEventconstructor.