Migrate Angular 1.2.16 to 1.6.9 - angularjs

I know many of you are asking how to migrate from Angular 1 to Angular 5. Or from 2 to 5. But my question is a little different. I have my personal application written in Angular 1.2.16 and I would like to know:
1. Is it worth to migrate at all?
2. How complicated that will be?
I know there is a change log in Angular's gitlab which is good thing but it is huge in between two versions. Most of the changes are bugfixes. But is there a lot of incompatibilites between those two versions?

I think that you cannot migrate directly from angularJS 1.2 to 1.6.9, it will be more difficult this way.
You have to make it step by step by looking to this migration guide:
https://docs.angularjs.org/guide/migration
They exposed detailed way to do it from:
1- Migrating from 1.2 to 1.3
2- Migrating from 1.3 to 1.4
3- Migrating from 1.4 to 1.5
Last step:
4- Migrating from 1.5 to 1.6
So you can look at each step and see the changes that you can modify and test if it works as expected.
it can be more time consuming this way but the level of success can be more important.

Related

Is angular 1.x still relatable

Have a few projects in angular 1.x and wondering if its really necessary/efficient to move them to angular 4 / later.
Smaller dashboards would not be necessary as it is used internally by minimum number of people. But the bigger customer facing application (3 year old product ) is under the question, as new requirements are being developed.
According to surveys, Angular 1.x is still being used in many companies and the community is still active on making new libraries.
So is it worth shifting?
In my opinion you should leave those projects in Angular 1 and start using Angular 7 for newer Projects. Here is a good article comparing the two: https://www.uruit.com/blog/angular-1-vs-2-migrate/
If you have projects on angular1 developed, then those can be migrated to angular 7 module by module.
Means Using Current angular version, you can run your project in hybrid mode, where you can run angular 7 and angular 1 code together.
For clear understanding, please read these below links
1) https://angular.io/guide/upgrade
2) https://medium.com/contentsquare-engineering-blog/angularjs-to-angular5-upgrading-a-large-application-7e6fbf70bafa

How to upgrade from angular 1.4 to angular 5?

To upgrade from angular 1.4 to Angular 5 is it possible to use ngupgrade and follow incremental approach or it is strictly applicable to use ngupgrade from version 1.5. According to the image the prerequisites mentioned 1.5 is used for ngUpgrade.
There is official upgrade guide:
https://angular.io/guide/upgrade or https://angular.io/guide/upgrade-performance
But as a person who have written a big AngularJS application and now is working on a big Angular project, I recommend to start a new fresh project and step-by-step write a complete new application in the newest Angular. By my experience, switching between both frameworks is really hard and time-consuming.
In Angular things work totally different (better) and the framework itself offers much more than AngularJS.
If you still want to go the upgrade way, do it in 2 steps:
Upgrade to 1.5 (because there must be a reason why it is required)
Upgrade to Angular
Take a look at this article: https://angular.io/guide/upgrade
And you can upgrade or downgrade services and components between two frameworks.
You should know that there are two ways to bootstrap a Hybrid App:
Using UpgradeModule - Bootstraps both the AngularJS (v1) and Angular (v6) frameworks in the Angular zone
Using DowngradeModule - Bootstraps AngularJS outside of the Angular zone and keeps the two change detection systems separate.
I have tried both ways. And I recommend using DowngradeModule - it's better for performance and memory leaks.
If you google angular hybrid you will find a lot of articles and examples on github
Certainly look at https://angular.io/guide/upgrade to start. It's been a while since I've looked at it and it appears to have significant updates, which is nice. The "Preparation" section still reminds me of the joke: "How to be a millionaire and not pay taxes? Step 1: Get a million dollars." One section of preparation is "Using a Module Loader" which tells you why, but you're still on your own to figure out how to go from, say, grunt to webpack. It's beyond the scope of that page, sure, but that feels like big amorphous step to sort out.
I did find a developer, Sam Julien, that put together a guided video "course" which takes an app and walks through converting it. It is at https://www.upgradingangularjs.com and is certainly more comprehensive than any blog post I've seen. I'm not affiliated but it has gotten me started on laying out some of what we need to change.
It's not a trivial undertaking but being able to see the stages laid out ahead of time has made it seem incrementally possible. (Luckily, we are pretty close to the angularjs style guide already, which is another preparation step.) Good luck!

Guidance on Angular 1.2 and Angular 2 coexistence and incremental upgrade

The existing code base in Angular 1.2 is huge with many custom directives, so I thought I will ask some experts before attempting.
I have studied the angular doc and am happy to see provision for an incremental upgrade using UpgradeAdapter. However, I am not clear the minimum version of Angular 1.x for the coexistence to work.
Specifically, can Angular 1.2 code co exist with Angular 2 in the same application such that I can incrementally upgrade it to Angular 2?
Do I have to upgrade Angular 1.2 to 1.4 first (for ng-router) and then try the co existence and incremental upgrade strategy?
I tried searching for a definitive answer on this and could not locate one.
Not a definite answer, but the source throws an error when not finding angular 1.x : https://github.com/angular/angular/blob/master/modules/%40angular/upgrade/src/angular_js.ts#L128
One of their first recommandation in the upgrade guide is the use of components, available in angular 1.5 though.

What are the differences between i18n and l10n in AngularJS 1.3, 1.4 and 2?

I have an AngularJS application written using AngularJS 1.4. We need to adapt this to work with different languages and of course sometime in the future we need to move to AngularJS 2.0.
Has anyone out there used the i18n and l10n features of both AngularJS 1.4 and 2? From what I understand 1.4 adds new features over 1.3 but I cannot find any information on what has changed :-(
What I would like to know is if there are some big differences. Big enough that we should wait until AngularJS 2.0 before starting internationalization.
Please do not close this question. Yes I know it may not fit exactly as a perfect question but I am pretty sure there are developers out there who are asking the same question as me.
Since AngularJS 2.0 will be a whole rewrite I don't think it is a good idea to rely on being able to migrate from previous versions. Moreover, it is not going to be released soon and even version 1.4 is not stable yet.
You should be always using the latest stable version. However, there is an official thread about migrating.
If you want to learn about specific changes e.g. l10n and i18n have a look at the changelog.

is it safe to write a new application in angularjs 1.2?

We want to convert our web app to angularjs, the problem is we need to support IE8 so only option is to stick with angularjs version 1.2. The question is it safe to go with this version? As 1.3 is already out and soon version 2.0 will be there too, so in near future (like 8-12 months) if we dropped IE8 support and then want to migrate to 1.3 or even 2 how much effort it will be?
Migration from Angular 1.2 to 1.3 is far more easier as compared to moving to Angular 2.0
There is even a migration guide to migrate from 1.2 to 1.3. So migrating would be possible to 1.3 or 1.4 or 1.x.
There is a bit of paradigm shift when it comes to Angular 2.0. The migration path is still not clear and we even don't know whether one is possible.
Update: This video from ngconf 2015, gives some useful insight into how build today with 1.3, that makes transition easy.

Resources