Skip to content

feat(many): support for Ionic Framework v9 - #532

Merged
ShaneK merged 3 commits into
mainfrom
major-9.0
Aug 19, 2026
Merged

feat(many): support for Ionic Framework v9#532
ShaneK merged 3 commits into
mainfrom
major-9.0

Conversation

@ShaneK

@ShaneK ShaneK commented Aug 14, 2026

Copy link
Copy Markdown
Member

Updating templates to support Ionic Framework v9.

What is the current behavior?

Currently, the schematics generate code for Ionic 8's export layout, importing IonicModule from @ionic/angular and standalone components from @ionic/angular/standalone. Neither is correct in Ionic 9. Beyond the import paths, three template bugs meant the generated output did not compile or run on a current Angular app:

  • The component spec used waitForAsync, which needs zone.js, so every generated component spec failed on a zoneless Angular 22 app.
  • Running --create-module emitted export class FooComponent Module {}, which is a syntax error.
  • The page schematic silently skipped route registration when the target routes array was empty, which is the shape ng new produces.

What is the new behavior?

Generated code now targets the Ionic 9 export layout, with IonicModule coming from @ionic/angular/lazy and standalone components from the @ionic/angular root. The peerDependencies move to Angular 21 and 22, and the page and component schematics default to standalone.

The three bugs above are fixed. Route insertion now handles an empty routes array, and it leaves a routes that is not an array literal alone rather than writing into it, because anchoring off the array's tokens corrupted files where routes came from a helper call.

Does this introduce a breaking change?

  • Yes
  • No

Generated code requires Ionic 9 and Angular 21 or 22. On Ionic 8 the lazy subpath does not exist and the root does not export standalone components, so generated pages and components will not compile.

Other information

Verified against the released @ionic/angular@9.0.0 and Angular 22.1.4 by generating every schematic variant into real apps. Builds pass, the generated specs pass, and both ionic-cordova-build and ionic-cordova-serve still work on a webpack app. Both packages also typecheck against Angular 21.2.21 and TypeScript 5.9 to cover the low end of the peerDependencies range.

Note on merging: lerna 4's conventional-changelog-angular@5 preset does not understand the feat!: bang shorthand, since its headerPattern has no ! and it has no breakingHeaderPattern. The major bump comes from the BREAKING CHANGE: footer on 02709d2 instead. If this is squash merged, keep that footer in the commit body or the release will publish as a minor.

ShaneK added 3 commits July 9, 2026 09:19
* fix(ci): fixing eslint and prettier

* feat!: support Angular 21 and 22 via peerDependencies

* fix: regenerating lock files

* fix(schematics): default page and component schematics to standalone

* chore(npm): updating package-lock.json
BREAKING CHANGE: Generated code now targets Ionic 9 and Angular 21 or 22. Pages
and components import `IonicModule` from `@ionic/angular/lazy` and standalone
components from the `@ionic/angular` root, which is the Ionic 9 export layout,
so generated code no longer compiles against Ionic 8. The `page` and `component`
schematics now default to standalone, and peerDependencies drop Angular 20 and
below.
@ShaneK
ShaneK merged commit a739018 into main Aug 19, 2026
2 checks passed
@ShaneK
ShaneK deleted the major-9.0 branch August 19, 2026 19:58
ShaneK added a commit that referenced this pull request Aug 19, 2026
* docs: correct typo in monorepo description (#522)

* chore(npm): Update release npm action to stop using tokens (#526)

* Update release yaml to use trusted publishers approach

* Update cd.yml

* Finetuned workflows triggers and improved linting issues (#527)

* feat(many): support for Ionic Framework v9 (#532)

* feat!: support Angular 21 and 22 via peerDependencies (#531)

* fix(ci): fixing eslint and prettier

* feat!: support Angular 21 and 22 via peerDependencies

* fix: regenerating lock files

* fix(schematics): default page and component schematics to standalone

* chore(npm): updating package-lock.json

* fix(schematics): update templates to Ionic 9 component import paths

* fix(schematics): repair generated component code and route registration

BREAKING CHANGE: Generated code now targets Ionic 9 and Angular 21 or 22. Pages
and components import `IonicModule` from `@ionic/angular/lazy` and standalone
components from the `@ionic/angular` root, which is the Ionic 9 export layout,
so generated code no longer compiles against Ionic 8. The `page` and `component`
schematics now default to standalone, and peerDependencies drop Angular 20 and
below.

---------

Co-authored-by: mohammad altamash <78483966+Shaikhaltamash861@users.noreply.github.com>
Co-authored-by: Gonçalo M. <goncalo.martins@outsystems.com>
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.

1 participant