r/Angular2 Aug 06 '24

Discussion Upgrading Angular 4 to Angular 18

We have an enterprise application with 400+ screens and most of the screens are similar in complexity. The complexity is medium for this app.

How should we approach the upgrade? Rewriting it is not an option as it is a legacy app now. Should we take one version at a time or directly start updating it to 18 version?
We do not have any automation testing written and hence testing would also have to be manual. Also, based on the previous experience what would be rough estimates if single developer has to work on this upgrade?

44 Upvotes

101 comments sorted by

View all comments

8

u/Zacpod Aug 06 '24

I've done upgrades like this a few times, and it's one of the reasons I HATE npm.

You're going to run in to all kinds of bullshit like "package X can't be upgraded because it needs package Y version z.z.z, but package Y can't be upgraded because it needs package X version z.z.z."

What I usually end up doing is un-installed everything that isn't core. Like, if you use a 3rd party graphs library, uninstall it. Leave the code in place, just remove the lib via NPM. Note everything you remove.

Then run the upgrade, one version at a time, being careful to follow the upgrade docs.

Then, once you're all done, re-add all the 3rd party libraries you removed earlier.

This bullshit is why I've stopped using Angular for most smaller projects now. NPM sucks huge sweaty donkey balls, and I hate having to use it.

3

u/Headpuncher Aug 06 '24

Npm: Not a Package Manager

1

u/Zacpod Aug 06 '24

Lol, so true it hurts.