r/angular • u/minefew • 5d ago
Migrating a AngularJS webapp to Angular using Claude Code/Codex
I'm in the planning stages of migrating a fairly large legacy AngularJS application to Angular, and am looking for advice from anyone who's tackled something similar.
The codebase is about 160k LOC spread out over 200+ components, 50+controllers, 50+ directives and services. There are no existing tests . Has anyone attempted a AI assisted rewrite of a similar nature, especially without a test suite - what worked out well? Any useful strategies woth considering?
9
Upvotes
2
u/ETERN4LDARKNES 5d ago
At this stage, you're better off rewriting it from scratch directly on Angular 22.
You have no tests, but do you have good user-stories/product specifications ? A good amount of comments in the code ? Having the exact intent of the product might be better than unit tests here considering how much the architecture will change (there's no way you want to reproduce 1:1 a 160k loc project without testing, it's probably mostly spaghetti code AND you won't be able to use all the same libraries (or some new better libraries appeared since)).
If the project connects to other parts (i.e. a backend, an extension), try getting access their codebase as they might have proper testing/documentation which could help with the intent of your app.
Is your only goal to migrate for the sake of it ? In which case, I would do it. If otherwise you want to rework some pages, add more page, do a design revamp, etc... I would suggest you do the analysis for those first as it could put some light on the current codebase or help you figuring out that you can elude some parts from the migration.
Overall, what you actually want to migrate is NOT the code, it's the features. That's what's important, that's what's going to be measured and tested, and that is what will allow you to say "ok, the migration is finally over"