At work we’ve got a large AngularJS codebase. It’s on 1.x now. Someday we’ll either upgrade the existing code to Angular 2 or start doing everything in React. This post is not about your existing codebase. Angular 1.x will be around and supported for a long time.
However, we recently started a greenfield project. That meant choosing a tech stack. And well… choosing a frontend framework in late 2016 is interesting to say the least. Since this new project will be around for years (hopefully) we didn’t want to choose a framework that is in the later half of its lifecycle.
Make no mistake, interest in Angular 1 is on the decline—not just because Angular 2 is now officially released—but the data is clear about it as well:
This graph plots the number of questions asked on Stack Overflow for the
angularjs tag (as a percentage of all questions asked) per-month. If that’s
not enough to convince you, keep reading because the rest of the data I found
is consistent with this point.
Choosing a Framework
When choosing a framework you need to consider first-and-foremost:
- The requirements of the project
- The technical merits of candidate frameworks
- Everything else
I could go into the technical merits of Angular 2 vs. React, but I’m probably among the least-qualified people to talk on the subject.
What I can talk about is adoption rates. Framework popularity may be lumped into the “everything else” category, but it’s still an important factor. It can influence:
- How easy it is to find good documentation, answers on Stack Overflow, blog posts, etc.
- How quickly people report (and fix) bugs in the framework that may bite you some day
- How long your version of the framework will be supported
Angualr 2 Vs React Adoption
If you search for “angular vs react” you may run across this post by Kamil Przeorski. The author has a React bias, but he posts some compelling data, including this graph of technologies listed in Hacker News job postings over time:
We can learn a few things from this data:
- Backbone and Ember matter, but they’re niche frameworks at this point
- Angular is firmly in the middle of the pack (across all technologies), but appears to have plateaued
- More companies are interested in using React going forward and that number is on the rise
While Hacker News may be representative of many startups and companies at the leading edge of adoption, there is a large world of software development outside of it. I think we need to get more data.
First stop, Google Trends:
Interest in React continues to grow, while Angular is still hugely popular but maybe not growing in popularity. Google only gives us the very broadest strokes (Angular vs React) though.
Looking at Reddit statistics, we can start to tease out interest in Angular 1 vs Angular 2 vs React by looking at the growth of the number of subscribers in the respective subreddits:
That graph is a little noisy. The trends become clearer when we look at the total number of subreddit subscribers over time:
React continues to show strong growth in interest. Interestingly, Angular 1 (/r/angularjs) interest appears to be plateauing, but when you add in Angular 2 (/r/angular2) interest, the overall trend for Angular may be increasing. It is hard to know though, since /r/angular2 growth may be driven by people still subscribed to /r/angularjs.
Everything we’ve seen so far is a decent approximation for how many people want to use Angular or React. In the modern, open-source era though, we can get more direct. How many people are actually using the framework in real world projects? While there is no survey of every real world project out there, we have two good proxies: 1) issues and pull requests submitted to the Github project, and 2) questions asked on Stack Overflow.
Sadly, I don’t know of a tool that graphs the history of issues (or PRs) opened on a Github project over time, so instead have this graph of Github stars over time:
What I can reveal to you is the complete graph from the beginning, Stack Overflow questions over time for all the relevant tags:
This graph plots the number of questions asked on Stack Overflow for the different tags (as a percentage of all questions asked) per-month.
A word of caution about the graph: it is not a good idea to directly compare frameworks by the absolute number of questions asked, since frameworks may differ in the amount of features (more features = more questions) and the quality of documentation (better documentation = fewer questions) among other factors.
It is absolutely valid, however, to compare frameworks by looking at the growth rate of questions. Doing so we can see that React is growing well (although curiously plateauing in recent months, in contrast to all other data). But more interestingly, we can see that while Angular 1 is on the decline, adoption of Angular 2 is strong and growing.
A couple more notes on the graph:
- I included Vue.js, since it is the new up-and-coming framework, but as you can see it has not made large inroads yet
- Since Angular is kind of like React + Redux (+ a little more), I included the Redux tag so you can eyeball what an apple-to-apples comparison between Angular and React+Redux might look like
So What Does It All Mean?
I could start by telling you what we adopted for the greenfield project at work (React), but does it really matter?
In my uninformed opinion, both Angular 2 and React are solid frameworks on their technical merits.
If you agree with my analysis of the framework adoption data, then you know that both Angular 2 and React are strong and growing (looking at Stack Overflow growth and jobs growth respectively).
My takeaway? Pick whichever framework makes sense for your project and don’t worry about it. You’re in good company whichever one you pick and don’t let anyone without data convince you otherwise.