A meticulous task: Picking a new JS framework
Our main product was created in 2015. Back then, ReactJS wasn’t yet very mature, VueJS was still a baby, and Angular 2 was not yet a thing! So at this moment, AngularJS was a good framework option, as it was well maintained, old enough to be stable, and had the biggest community. It was also something we were familiar with :)
As the original framework was AngularJS, you would assume (and we thought the same) that a migration to latest Angular would be the easiest. But we found out that going from AngularJS 1.5 to Angular 8 would be a huge gap, and it would be as complicated as migrating to any other framework. Angular 2+ has very little to do with Angular 2-.
So without an easy choice, we started to look around for new competitors, and there were a quite a few of them! The stars of the moment were Angular, VueJS, React, and VanillaJS (when knowing the scope of the project, this last one was obviously more a fantasy than an actual choice).
The most important things to keep in mind while choosing a framework is to know why do you need one at all, what it’s going to be used for, and by whom!
A good way to find out the need for frameworks is to define what’s fairly simple (things most people do in their web apps) and what’s more complex (very specialised things that we do) in our product. That’s what we did!
This way, we found out that our product has a fair number of distinctive qualities from the perspective of a frontend developer:
We also identified that the main complex technical points are:
Another important consequence of the framework choice is that all the current developers have to understand the technology enough to use it, and to like it enough so they want to continue using it. It will also drive the recruitment orientation, as we would have to look for future developer with skills in the chosen framework, or at least with motivation to learn and use it. Nobody is looking to use AngularJS on their next cool project!
From that perspective, an framework with a good hype on the market, easy to learn, as well as the ability to continue writing in JS, HTML and SASS, would make it easier to recruit new developers and to keep existing ones.
This analysis lead us to believe we were in the need for a lightweight framework with efficient state management, that would minimise the choices we would have to make as developer, in order to keep consistency between components written by different people, while enforcing good practices.
Now that we had a better idea of what we needed, we went through the nasty job of comparing frameworks by listing the pros and cons, testing performances, evaluating code cleanness, and checking good practices. There are many framework comparison articles out there, we read a bunch, built some prototypes and compiled an overview of our thoughts below.
|Created by||Evan You|
|Hype (github stars)||51K||136K||148K|
|Key advantage||Full MVC||Native Apps||Separation of Concerns|
|CLI & tools||+++||++||+++|
|Enforcing good practices||++||+||+++|
So, first thing to note here is that the these three framework are the real deal, all of them are good choices! They have strong communities, are mature, used by big companies, come with great documentation and have better performance than pretty much everything else on the market!
It’s just up to you to decide which one fits the use you are going to make of it, and the team that’s going to use it!
That said, in our case, after a quick try on each of the three main frameworks, we first eliminated Angular because of it’s size, complexity, learning curve steepness, and lack of flexibility. But the choice between React and VueJS was more complicated.
Both were flexible enough, had good practices, a nice and growing community, great performance due to their reactiveness, and good overall feeling when being used by the dev team. VueJS has a faster learning curve. It also keeps it simple using JS/HTML/SASS, and being able to update to pretty much any language component by component. Finally, the team loved having each component in just one file, having a CLI to easily interact with webpack building process. We were also seduced by the simplicity of routing (vue-router) and state management (vuex).
So after a few POC using VueJS to rewrite some basic components of our in-house library, the choice was made: we would use VueJS!
Now the main question was: how are we going to migrate our product smoothly, avoiding any regressions, continuing to improve the product with new features and deploying weekly? But we will answer that in detail in another article!
Remy @ 2019-09-24