Skip to content

feat: reborn app-state migration#1148

Merged
manuel3108 merged 5 commits into
feat/sv-migratefrom
feat/app-state-migration
Jun 27, 2026
Merged

feat: reborn app-state migration#1148
manuel3108 merged 5 commits into
feat/sv-migratefrom
feat/app-state-migration

Conversation

@jycouet

@jycouet jycouet commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Rebuilds the $app/stores -> $app/state migration as a proper AST task (was a regex legacy shell-out).

  • Runnable standalone: sv migrate app-state
  • Also required inside the sveltekit-3 migration

Bug fixes over the legacy version:

  • truthy $navigating (e.g. {#if $navigating}) -> navigating.to
  • bail cases ($:, derived(store), getStores()) now leave a @migration-task instead of silently skipping
  • drop spurious TODO when .to is already accessed

Stacked on #1147 (uses its shared addMigrationTask); merge that first.

jycouet added 2 commits June 24, 2026 12:59
- @migration-task comments now work in .svelte files (insert real Comment
  nodes into the fragment, since the Svelte printer ignores the JS Comments
  registry); fixes the env task silently dropping them.
- single addMigrationTask(message, target): { comments, node } for JS/TS,
  { fragment, anchor? } for .svelte.
- split migrate/index.ts into index.ts (framework) + migration-task.ts.
@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 264d6a8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svelte-docs-bot

Copy link
Copy Markdown

Rebuild `$app/stores` -> `$app/state` as a proper AST task instead of the
regex legacy shell-out. Runnable standalone (`sv migrate app-state`) and
required inside the sveltekit-3 migration.

Bug fixes over the legacy version:
- truthy `$navigating` (e.g. {#if $navigating}) -> `navigating.to`
- bail cases (`$:`, `derived(store)`, `getStores()`) now leave a @migration-task instead of silently skipping
- drop spurious TODO when `.to` is already accessed
@jycouet jycouet force-pushed the feat/app-state-migration branch from f31ac69 to 55fc80c Compare June 24, 2026 11:35
@jycouet jycouet changed the base branch from feat/sv-migrate to feat/svelte-migration-comments June 24, 2026 11:43
Base automatically changed from feat/svelte-migration-comments to feat/sv-migrate June 26, 2026 03:24

@manuel3108 manuel3108 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, even found some more places to migrate in immich, the previous migration did not find / bailed.

@manuel3108 manuel3108 merged commit 6c7cd11 into feat/sv-migrate Jun 27, 2026
6 checks passed
@manuel3108 manuel3108 deleted the feat/app-state-migration branch June 27, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants