Search the site
Find pages, services and blog posts
Skip to content

Svelte 5 migration

Upgrade your Svelte 4 app to Svelte 5. I'll handle the runes migration, set up testing and get your team comfortable with the new patterns.

What changes

Svelte 4Svelte 5
$: reactive statements$derived
export let props$props()
<slot>{#snippet}
createEventDispatchercallback props
beforeUpdate / afterUpdate$effect

The official migration script (npx sv migrate svelte-5) does a lot of the mechanical work. The rest needs someone who knows where it tends to go wrong.

How I approach it

  1. Audit the existing Svelte 4 codebase
  2. Plan an incremental migration
  3. Convert reactive statements to $state and $derived
  4. Update component props to $props()
  5. Replace slots with snippets
  6. Move stores to runes where it makes sense
  7. Update event handlers to the new syntax
  8. Set up Vitest browser mode testing

Planning a migration?

Tell me about your Svelte 4 codebase and I'll give you an idea of what's involved.

Get in touch