Hacker News new | ask | show | jobs
by rubber_duck 2175 days ago
Rewriting anything complex and actively used from scratch is not a good idea and the problems have been hashed out may times.

Having said that, angularjs and coffescript is a terrible software stack in a dead ecosystem, the best course of action is probably incremental rewrite - React is really good at that because it starts out as a small rendering library and you can incrementally replace stuff like routing etc.

2 comments

For that example, I would just use Decaffeinate to migrate to ES6, upgrade to TypeScript + AngularJS 1.5+ best practices as OP did, and then follow the official AngularJS -> Angular migration path.

Considering they're two entirely different frameworks, Google did a good job creating a usable compatibility layer. This allows a relatively painless "ship of Theseus"-style transition where you have a combination of Angular and AngularJS components interacting with each other, until eventually it's just Angular components and you can drop AngularJS from the build.

I completely agree. On my next app, I was forced to use AngularJS (in 2017, somehow), but did get to use TypeScript (which is somewhat hobbled by having to use Angular templates), and this is exactly what we're doing now: rewriting components one-by-one in React. I love refactoring and React is much nicer, so I'm having fun with it :)