ionic-team / ionic-cli

The Ionic command-line interface
MIT License
2k stars 654 forks source link

New Ionic 5 project is using Angular 8 instead of Angular 9 #4318

Closed mustafa-acar closed 2 years ago

mustafa-acar commented 4 years ago

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:

ChelloApps commented 4 years ago

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.

gilbertoalbino commented 4 years ago

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.

mhartington commented 4 years ago

👋 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:

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

andronat commented 4 years ago

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.

jayordway commented 4 years ago

@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?

wrosb commented 4 years ago

@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.

jayordway commented 4 years ago

@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.

timsar2 commented 4 years ago

@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",

karol-depka commented 4 years ago

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 :).

karol-depka commented 4 years ago

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

bradeaton commented 2 years ago

Is it the version of the CLI that decides which version of angular a project will be created with? I'm on CLI 6.18.1 and when I create a blank project, it defaults to Angular 5.

kensodemann commented 2 years ago

@bradeaton - no. It is the starter: https://github.com/ionic-team/starters

ionic start <project-name> <template> --type=angular|react|vue (at least for modern versions of Ionic).

So, if you do ionic start foo-bar blank --type=angular it will use NG 12 as specified in the base package here: https://github.com/ionic-team/starters/blob/main/angular/base/package.json, and then add merge that with the "blank" bits here: https://github.com/ionic-team/starters/tree/main/angular/official/blank

You are (apparently) specifying Ionic v3 (ionic-angular) which will get you an old and unsupported version of Ionic whose last officially supported version of Angular was NG 5. You shouldn't really want that, but if you do we still allow it and it will use the files under here: https://github.com/ionic-team/starters/tree/main/ionic-angular

Heck you could even do Ionic v1 if you wanted: https://github.com/ionic-team/starters/tree/main/ionic1

But it is all from the starters.

It is good to keep your CLI up to date, as then you get the latest features of the CLI, but the starting point of any generated project is determined by the starter that you use.

Hopefully that all made sense.