We are upgrading large scale angular app from 6 to 17. Like everybody else I have also been following Angular Upgrade Guide: but that always talks about upgrading one version at a time.
Our app has nearly 50 third party libraries. So upgrading libraries is the major work compared to upgrading the angular version itself.
As an architect I do not see any point in travelling from v6 to v17, step by step.
In 2023 why any one would write the code of intermediate versions (of angular and used 3rd party libraries) just to discard them?
IMHO there has to be a better guidance on how to upgrade badly outdated Angular projects, but cound't find authoritative answer on the topic.
Is there any logic on why one should not move to V17 directly? Why it is officially recommended to go step by step?
Any guidance is greatly appreciated, thank you.
If the angular app is badly outdated, then it is very difficult to upgrade it.
This is not a problem with Angular. 'Inability to upgrade easily' is a wellknown problem with almost all of the opensource software utilities. Opensource never comes with the guarantee of extremely long term backward compatibility or upgrading by skipping major versions.
Angular 6 was released in 2018.
Many things have changed since then. Many projects on NPM have got closed down. New projects sprang up. Typescript language had changed considerably in the past 5 years. Nodejs platform went through major updates.
Angular 17 is released in Novemebr 2023.
Jumping from 6 to 17 is a very long jump. Doing it successfully requires the understanding of changes that have happended in the past 5 years not only to Angular, but also to its ecosystem (Typescript, Nodejs, RXJS, Webpack, NPM packages).
If some of the dependencies have become deprecated, then the effort of finding and testing the replacements for the dependencies will also be required.
These are my findings based on my experience of upgrading several Angular projects in the past 8 years:
1. Upgrade from Angular 12 to 17 is easy.
Typescript language, Nodejs and the general NPM dependencies for Angular did not have many breaking updates since late 2021. Angular evolved from version 12 to 17 during this period. Upgrade from Angular 12 to 17 is fairly easy, as the ecosystem had been generally stable in this period. Most of the Angular 12 projects can be directly upgraded to 17 without code changes.
2. Upgrade from Angular 2 to 11 is difficult
Between 2016 and 2021, there was a tremendous change in the ecosystem. COVID19 pandemic also caused problems to many opensource projects. Angular evolved from version 2 to 11 during this period. Upgrading Angular from version 2 to any other version till 11 was very difficult due to the nature of changes in the ecosystem at that time.
3. Very difficult to upgrade from before 12 to 13 or above
Nodejs and Typescript have had numerous updates coinciding with the timeframe of Angular changing from 11 to 12. Upgrading Angular from any version below 12 to a version above 12 is very difficult due to this.
Recommended upgrade approach for Angular 6 to 17 Though the best practice is to do a step-by-step upgrade, one major version at a time, it can be safely avoided in many cases.
Based on my experience and consideration of the timelines of breaking changes, this 4 stage upgrade will be the easiest: