Skip to content

refactor(svelte5): incremental runes migration — per-folder tracking #1208

Description

@escapedcat

Part of #1201 (Stage 4 — ongoing, no deadline: Svelte 5 legacy mode supports the old syntax indefinitely; runes/legacy components mix freely).

After Stage 1, the table cluster (11 files) is runes-mode and the other ~157 components still use Svelte-4 syntax. This issue tracks converting them folder by folder. npx sv migrate svelte-5 supports per-folder runs and automates export let→$props, $:→$derived/$effect (wrapping timing-unsafe cases in run() from svelte/legacy), on:→event attributes, slots→snippets, new Component→mount.

Inventory (2026-08-04): export let in 130 files (406 uses), $: in 93 files (378), <slot> in 11 files, <svelte:component> in 4, $$props/$$restProps in 5, createEventDispatcher in 3.

Approach

  • One PR per folder below; run the migrator, then hand-review every run() wrapper and @migration-task comment it leaves.
  • Manual work the tool skips: the 3 createEventDispatcher components (AddressSearch, SaveAuthPrompt, ActivityTypeFilter) → callback props, plus their ~6 consumers.
  • Hand-convert, don't auto-migrate, the reactivity hotspots: CommunityCard.svelte (25 $:), MerchantListPanel.svelte (23), merchant/[id]/+page.svelte (20), Socials.svelte (19 $: + 23 props), area/MerchantCard.svelte (16). routes/map/+page.svelte is 2,189 lines but only 10 $: — size, not reactivity, is its risk; do it last and consider splitting first.

Folder checklist

  • src/components/ (shared, excl. leaderboard — already runes from Stage 1)
  • src/components/area/
  • src/routes/ — simple/static routes first
  • src/routes/merchant/
  • src/routes/communities/ + src/routes/countries/
  • src/routes/map/ (last; 2,189-line page)
  • sweep: remaining <svelte:component>, slots→snippets, $$restProps wrappers (Icon, IconButton, CollapseButton, PrimaryButton, TextLink)
  • finale: enable compilerOptions.runes: true in svelte.config.js so legacy syntax can't creep back

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions