Skip to content

Instantly share code, notes, and snippets.

View diramazioni's full-sized avatar

Eli Spizzichino diramazioni

  • Italy (looking for other destination)
View GitHub Profile
@diramazioni
diramazioni / gist:ae3792d37ed0678d1c68de08722ca287
Created May 10, 2025 09:52
svelte 5 & sveltekit 2 migration guide
## docs/svelte/07-misc/07-v5-migration-guide.md
--- title: Svelte 5 migration guide --- Version 5 comes with an overhauled syntax and reactivity system. While it may look different at first, you'll soon notice many similarities. This guide goes over the changes in detail and shows you how to upgrade. Along with it, we also provide information on _why_ we did these changes. You don't have to migrate to the new syntax right away - Svelte 5 still supports the old Svelte 4 syntax, and you can mix and match components using the new syntax with components using the old and vice versa. We expect many people to be able to upgrade with only a few lines of code changed initially. There's also a [migration script](#Migration-script) that helps you with many of these steps automatically. ## Reactivity syntax changes At the heart of Svelte 5 is the new runes API. Runes are basically compiler instructions that inform Svelte about reactivity. Syntactically, runes are functions starting with a dollar-sign. ### let → $state

Svelte 5 Snippets


Svelte 5 Runes Overview


$State


@diramazioni
diramazioni / svelte5_full_context.md
Created May 10, 2025 10:16
svelte5_full_context

Svelte 5 Runes Overview


$State


Svelte 5 Event Handling

Svelte 5 replaces on: directives with direct property bindings for event handlers.