Conversation
… manual migration
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: internal
What is the current behavior?
There's no tooling to help apps move across a major version of Ionic. Every breaking change in the v9 upgrade guide has to be found and applied by hand, across Angular, React, and Vue, with no way to tell which ones a given app is even affected by.
What is the new behavior?
Adds a new
@ionic/migratepackage: a standalone tool that scans an app, applies the breaking changes it can make safely, and prints a checklist of the ones that need manual rework, each with a file, line, and docs link. It detects the installed framework and major frompackage.jsonand selects only the migrations whose version range applies, so a project already on the target major does nothing.Auto-fixes cover the Angular import and package bumps, CSS
~prefix removal, standalone zoneless bootstrap, React Router v6 route rewrites and dep bumps, Vue Router 5 / Vue 3.5 bumps, andautocorrect="off". Report-only findings cover the rest (NgModule zoneless, legacy picker,ion-img,ion-navrouter removal, RR6 semantic cases, Vue guardnext()). TypeScript and TSX edits go throughts-morph; HTML and Vue templates use a quote-aware scanner so string literals and comments are left alone. Changed files are run through the project's own Prettier so the AST edits land as clean diffs.The runner is single-shot by design (a project migrator isn't inherently idempotent - some cannot be due to the nature of their change, like the Angular import changes) and guards re-runs two ways: the version gate skips work once the
@ionic/*bump has landed, andsave()buffers text writes so the gate-closingpackage.jsonbump only hits disk if every migration and the ts-morph save succeed. It won't write to a dirty working tree or directory without git unless--forceis passed, so git can be used to undo changes in case of emergency.Does this introduce a breaking change?
Other information
Migrations are registered in
src/migrations/index.ts; adding one is a new file undersrc/migrations/v<major>/plus a fixture-backed test. The engine handles selection, ordering, git safety, formatting, and reporting.Several new tests were added for migrations and a CI workflow was added that runs migration tests only when migration-related files were changed. When this is merged fully to main we can also make that check required to prevent breaking migration changes.