Ionic-cli: New Ionic 5 project is using Angular 8 instead of Angular 9

Created on 13 Feb 2020  路  10Comments  路  Source: ionic-team/ionic-cli

Description:
I have just upgraded Node JS, npm, angular-cli and ionic cli to the latest and stable versions and created a new project with ionic start new-project blank command.. I expected to see Angular 9 dependencies in package.json file but all Angular dependencies are for 8.2.14 version.

I tried to run npm i @ionic/angular@latest --save command on an existing project and it installed 8.2.14 version again.

As I know the IVY renderer came with Angular 9. Angular 9 has other features like "entryComponents" etc.

My questions are:
Does Ionic 5 with Angular 8 dependencies have these features?
Should I continue developing or wait.

My ionic info:

Ionic:

   Ionic CLI                     : 6.1.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.0.0
   @angular-devkit/build-angular : 0.803.25
   @angular-devkit/schematics    : 8.3.25
   @angular/cli                  : 8.3.25
   @ionic/angular-toolkit        : 2.1.2

Capacitor:

   Capacitor CLI   : 1.5.0
   @capacitor/core : 1.5.0

Utility:

   cordova-res                          : not installed
   native-run (update available: 0.3.0) : 0.2.8

System:

   NodeJS : v12.16.0 (/usr/local/bin/node)
   npm    : 6.13.7
   OS     : macOS Catalina

Other Information:

triage

Most helpful comment

Just in case someone needs the steps and for completeness on what @mhartington said above. I done the following to update the a default blank project: ionic start myApp blank --capacitor --type=angular

1) ionic start myApp blank --capacitor --type=angular
2) cd myApp
3) ng update @angular/core @angular/cli
4) Using ncu -i I updated everything except: [core-js, tslint, typescript]
5) I removed core-js from package.json completely
6) npm prune

P.S. I would really like to see how TSLint can also be replaced with ESLint.

All 10 comments

I'm awaiting an outcome on this, I have read elsewhere that Ionic are aware of the issue which is some breaking change to do with the Angular routing causing Ionic to fail. It would be good to have an update on this to see where to take developments at this stage.

Angular versioning vs its ecosystems is what bothers me the most!
When Ionic Team releases a new version of the Framework, it's immediately made obsolete by the Angular's new version.

馃憢 Hey everyone! Ionic v5 apps DO support Angular 9. You can update your apps without issue as seen here

https://www.youtube.com/watch?v=851HkqX3YQ4&

We currently default to Angular 9 at the moment for a few reasons:

  • V9 enables Ivy by default, which could affect other libraries or packages in a project. Instead of providing the latest which the ecosystem is still updating to, we provide at least something we know for a fact will workout issue.

  • V5 of ionic was released a week about ng9, which is a pretty tight window. While we knew v5 worked fine with ng9, there were other things that required attention. Plus, the migration process isn't difficult.

@gilbertoalbino it's important to know that Angular v8 is not obsolete... it is in fact in LTS mode per angular's release schedule.

Just in case someone needs the steps and for completeness on what @mhartington said above. I done the following to update the a default blank project: ionic start myApp blank --capacitor --type=angular

1) ionic start myApp blank --capacitor --type=angular
2) cd myApp
3) ng update @angular/core @angular/cli
4) Using ncu -i I updated everything except: [core-js, tslint, typescript]
5) I removed core-js from package.json completely
6) npm prune

P.S. I would really like to see how TSLint can also be replaced with ESLint.

@mhartington

We currently default to Angular 9 at the moment for a few reasons

Do you mean that you currently default to Angular 8 instead?

@mhartington

We currently default to Angular 9 at the moment for a few reasons

Do you mean that you currently default to Angular 8 instead?

Yes. Ionic is still targeting Angular 8.

@mhartington

We currently default to Angular 9 at the moment for a few reasons

Do you mean that you currently default to Angular 8 instead?

Yes. Ionic is still targeting Angular 8.

I understand that, I was just saying it is a typo above.

@mhartington

We currently default to Angular 9 at the moment for a few reasons

Do you mean that you currently default to Angular 8 instead?

Yes. Ionic is still targeting Angular 8.

Confirm.
my angular version : Angular CLI: 9.1.0 Node: 12.14.1 OS: win32 x64
ionic cli version : CLI 6.3.0
with a new starting blank template, project has target angular8.
"@angular/common": "~8.2.14", "@angular/core": "~8.2.14", "@ionic-native/core": "^5.0.0",

We currently default to Angular 9 at the moment for a few reasons:
it is in fact in LTS mode per angular's release schedule.

Hi. So Ionic 5 defaults to Angular 8, not 9, right?
If so, I think it would be best to edit that message (the one I'm quoting here) to avoid confusion :).

You can update your apps without issue as seen here
https://www.youtube.com/watch?v=851HkqX3YQ4&

Also, link to the specific time in the video, for those who might want to go directly to the part about upgrading to Angular 9:
https://youtu.be/851HkqX3YQ4?t=243

Was this page helpful?
0 / 5 - 0 ratings