Elm Tricks from Production–From Angular v1 to Elm in 4 Days

Posted on August 10, 2020 by Riccardo
Originally posted at https://blog.lunarlogic.io/2020/elm-tricks-from-production-angular-to-elm/.

Elm Tricks from Production (Series)

Elm Tricks from Production–IntroElm Tricks from Production–Migrating from Angular v1 to ElmElm Tricks from Production–Declarative, Bug-Free User Interfaces with Custom TypesElm Tricks from Production–Adding Event Listeners to DOM Nodes that do not yet ExistElm Tricks from Production–Automated Testing is Just Another ToolElm Tricks from Production–From Angular v1 to Elm in 4 Days

You might be wondering, how the hell did they manage to migrate the entire frontend of AirCasting from Angular to Elm in 4 days? The answer is simple: we cheated. But we swear this is totally legit and we encourage people to do the same!

In a previous post we explained why and how we choose not to rewrite the entire frontend from scratch:

The best way to rewrite any application from one technology to another is incrementally, while it continues to run. At first the new language can take over separate parts of the application and then gradually incorporate more and more code.

In particular, over the last year, we have been using new features as an excuse to bring us closer to the finish line. In other words, we never stopped producing value for our customers. Also, having the removal of Angular in the back of our minds at all times, allowed us to come up with more and more tricks on how to make it happen. We actually kept a list on the wall in front of us to function as a constant reminder.

After several months of work, we realized we got close enough to remove Angular completely. That is when we took 4 days off the development of new features to complete our mission.

We are pretty sure the cost of those 4 days was worth it. In fact, it will probably be repaid in the next iteration not needing to learn Angular v1 or having to deal with its complexity.

There is still a long way in front of us. As a matter of fact, we only removed Angular by extracting code to vanilla JavaScript and kept the Elm ports. But, for sure, the future looks brighter now!

PinkLetter

It's one of the selected few I follow every week – Mateusz

Tired of RELEARNING webdev stuff?

  • A 100+ page book with the best links I curated over the years
  • An email once a week full of timeless software wisdom
  • Your recommended weekly dose of pink
  • Try before you buy? Check the archives.