Around the time I first published this I started assessing this myself. It is never an easy decision because there is so much to consider.
This article was originally written as a summary of Rob’s excellent talk. I still believe it is well worth spending a full hour to watch the whole talk yourself, however as time passes on there are things moving on from the point when he gave the talk in June 2016.
I am gradually updating this article and extending this article to contain more information about other libraries and frameworks that I consider to be worthy alternatives to the shortlist that Rob selected. I also welcome you to submit your own suggestions and I will try to accommodate them if I can.
The NDC Oslo Talk
Rob introduces himself and says due to time constraints he’ll be presenting a “hello world” like example of each framework. Each app is a web component which simply shows First Name, Last Name and a computed Full Name.
First he asks you to bear in mind that:
- He’s obviously biased, especially against Angular 2 (also bear in mind that this summary could potentially contain some other bias)
- Don’t be swayed or swept up by hype. Be professional and choose what meets the needs of your business.
As bias is a theme here, it is only fair to discuss any possible biases I might have.
I am not paid to write for Outlier Developer or have any financial interests in any particular framework. Most recently I have been using Vue JS, which was not included in Eisenberg’s talk but is a very elegant framework.
Any personal commentary on the talk is (italicized and in round brackets).
Rob believes our tendency to jump to technology choices too quickly is a systemic problem in our industry.
The frameworks under the spotlight are:
- Angular 1.x
- Angular 2 (I will also be covering Angular v4, 5, 6 and 7 in this article)
Rob says he’s trying to be as unbiased as he can be, and will cover the frameworks in alphabetical order.
He points out that they aren’t all frameworks in the same category, or even all frameworks.
Angular 1.x is an all-in-one framework. Rob says it is
pretty much deprecated, there’s literally a fixed number of months left on the lifetime of that framework
it’s probably fair to say that you shouldn’t start a new project in Angular JS right now, and you should be thinking about how you might migrate any existing code bases.
(When I first wrote this article, but I defended Angular 1.x here, but in 2018 it is now absolutely right that you can dismiss Angular 1.x. The Ionic Framework now uses the newer Angular and Angular v6 is far better than the old v1.)
Rob describes Angular 2, Aurelia, Ember and Polymer as also All-in-one frameworks, but modern ones.
React is not a framework, per se. It’s a view rendering engine or a component model.
Rob says that although the demo is extremely simple, it shows the different approaches that each framework takes.
Rob recommends Visual Studio Code and is using it on his Mac. I’ve since heard Mark Rendle and others agree with this point. I have found WebStorm is well worth the license fee but if you want a free solution Visual Studio Code works pretty well.
(For brevity, I’ll be referring to lines of code. Some lines of code can be much longer or shorter or more or less readable than others so to get the full picture you’ll need to watch the video for yourself. Rob has a style of leaving a blank line at the end of each file. I will discount those. The line count stats do not attempt to keep up to date with any newer versions released, only the versions at the time of the recording.)
index.html is 13 lines of code
We see the ng-controller and ng-model directives.
app.js is 8 lines of code. Rob describes this as a throwback to the previous generation of frameworks: Angular specific modules rather than ES2015 modules. He describes the Angular 1 two way data-binding model.
(As of Angular 1.5 we have Angular Components as a superior alternative to using controllers and directives. See Scott Allen’s Building Components with Angular 1.5 for more.)
Rob says Angular 2 really focuses on TypeScript, and
index.html is 32 lines of code
(I could not believe that there isn’t a simpler way to write this in Angular 2. Rob has found some Angular 2 documentation that pulls in a whole load of modules. For the purposes of developing a hello world type app, Rob is pulling in the following modules:
- shims for IE.js
- angular2-polyfills.js (no longer part of the Angular2 RC)
Update: I have found this code is very similar to the Bill Stavroulakis “Hello Component” demo which you can find on Plnkr. Bill describes it as “a very simple Angular 2 setup”. I was very surprised to find that this simple demo won’t work at all without Rx.js. You can create “Angular 2 components” easily, but using the Web Components standard with Angular 2 appears to be a lot harder. Fortunately this situation has improved considerably in Angular 6 and up.
Bill is a fan of Polymer JS and has created several Hello Component demos available at HelloComponent.com
Please let me know if there’s an easier way to achieve this.)
main.ts — 4 lines
app.component.ts — 20 lines
Rob explains the Angular2 decorator. He uses an inline template rather than using a template URL. He also explains two-way data-binding in Angular2, and points out that Google have deviated from the HTML specification by using mixed casing.
index.html — 10 lines. This imports System JS and uses it to import the Aurelia bootstrapper.
app.js — 8 lines
app.html — a template with 5 lines of code. Rob explains the two way data binding mechanism used here.
index.html — 16 lines. Imports jquery, handlebars, ember and app.js
app.js — 23 lines. Rob says Ember is a very strict MVC paradigm and requires a router even for Hello World.
index.html — 10 lines.
my-app.html — 22 lines including template, a script block and 4 blank lines.
Rob says the web components centric philosophy concerns him because
…it doesn’t make sense to do everything in HTML but there it is, that’s my opinion
Rob likens Polymer to the long forgotten Microsoft Acropolis project from 2008 which tried to do everything in XAML.
(Again, some totally unnecessary imports doing nothing except adding ridiculous complexity to a hello world app.)
app.js — 39 lines.
At 28 mins in we’re wrapped up with the hello world examples and go into the slides.
Size (minified, not gzipped)
- React+Redux — 156k or 167k with plugins
- Angular 1 – 158k minimum, 240k with router, HTTP and animation system
- Polymer — 222k minimum, 302k (spec compliant)
- Aurelia — 252k minimum, 302k with standard plugin
- Ember — 435k including router
- Angular 2 — 698k minimum, 919k with RxJS, 1023k with RxJS and router and HTTP client
(Not that Redux is in any way large, but it is unfair to add Redux to the file size for React only. Redux happens to be more commonly used by React users, but it is an optional extra regardless of which framework you choose.)
Rob mentions that the Angular team are using tree shaking to reduce the file size.
This test uses DB Monster Repaint. Numbers are frames per second.
Aurelia — 90–105/130–150 (with optimisation plugins)
Angular 2 — 80–90/110–130 (with optimisation plugins)
Polymer — 50–60
React — 45–50
Ember — ???
Rob says that to be honest all of these frameworks are very fast because 50 frames per second is faster than what we can usually see.
(This tool was popularised by Ryan Florence (from Facebook) in his talk at Conf 2015 showing React was faster than Angular 1 and much faster than Ember at the time it was recorded.
You can see Matthieu Ancelin’s dbmon repaint rate challenge which tests a much wider choice of frameworks. After a long time with Aurelia as a “TODO” implementation at the moment, the Aurelia optimised test is available, and its fast.
Latest Performance Developments (updated 20th Oct 2018)
A Run all button has recently been added to dbmon making it easy to compare all the featured library and frameworks against each other. Try it yourself: open it in a new tab, click run all and come back to see the results after you’ve finished reading this article.
The dbmon test was updated in 2017 with adjustable mutations percentages. I have used 50% mutations, because below that the tests give fps rates well above what the human eye can detect (over 100 fps). As a developer, your aim should be just to keep the frame rates consistent at about 30 fps and optimize for the scenarios where the frame rate is at its worst.
I ran the optimized tests for Rob’s selected frameworks on my laptop on Chrome 67 for Windows and got these results:
Only naive implementations for Polymer and Ember are currently available. Results are the average frame rates.
Some other selected framework/technology results:
Vanilla JS — 104 fps
I also ran these tests on Firefox and Edge. Frame-rates are significantly slower in both of these browsers. I found Angular 1 outperformed Polymer on Edge. Ember performance is massively improved with the latest version and there is an optimized version here which is insanely quick!
Many other fast frameworks are tested here as well. Angular Light and Motorcycle score well, although not as fast as Inferno. At the end of the talk Rob recommends Riot as an alternative to React. I found Riot scored 48 fps at 50% mutations. Also see more benchmarks from auth0
It is interesting that Rob downplays the significance of leading performance here because — giving the Aurelia team the benefit of the doubt — in the past other frameworks have easily generated a lot of interest just by being very vocal about their superior benchmark results. It is a crown which is never held for very long however.)
Aurelia: HTML, ES 2016, Web Components (including the Shadow DOM)
Polymer: HTML, ES 2015, Web Components
Ember: HTML, ES 2015
Angular 2: ES 2016 (TypeScript). Non Compliant: NG2 Markup and Dart
Angular 1: HTML, ES5. Non Compliant: Modules, Dependency Injection
React: ES 2015. Non Compliant: JSX
(Web Components is still not yet a proper standard but has now reached “V1” — See Taylor Savage’s article on V1 support in Chrome 53/54+.
Web Components Shadow DOM is currently a Working Draft
Web Components Custom Elements is a Working Draft
TypeScript is not a standard, and ES 2016 is a standard.
The latest ES standard is ES 2017)
Excellent: Aurelia and Ember
Moderate: Angular 1
Poor: Angular 2 and Polymer
Rob says Separated Presentation is less of a technical issue than a people issue.
Obtrusive: Angular 1, Angular 2, React
Rob provides some commentary for the purpose of justifying these claims.
(These are opinions not measurements)
Very Interoperable: Aurelia, Ember, Polymer
Average: Angular 2
High Friction: Angular 1, React
That concludes the technical comparison. At 43 minutes in Rob moves on to discussing the project and the team.
Project and Team
The table is very useful but has too much information to recreate here, so see the video at (43:30) for that.
Rob says although Angular 2 is claimed to be at Release Candidate Status, there are still breaking changes being made and
it’s not really a release candidate if you look at what’s really happening there.
(In my opinion this was fair comment at the time but is no longer relevant as Angular 2 is far more mature now, Angular 4, 5 and 6 even more so.)
Rob says there is a patent clause in the React license, which prohibits you from using it to compete with Facebook, or if you have an intellectual property dispute with another company using React.
He says this is why Google and Microsoft employees don’t use React.
Latest Version Information (updated 20th Oct 2018)
You can find React’s Patent clause here.
And Dennis Walsh makes the case that React’s Patent clause is much ado about nothing.
The latest version of React is v16.5 and this has many improvements to React DOM.
It’s now about 2 years since Aurelia reached v1.0.
Check out the new features in the Oct 2018 release.
Several other great new Aurelia features:
- New Chrome Debugger
- Webpack v2 support
- CLI enhancements
- Hot module reload
- VS Code plugin enhancements
- HTML Template Validation
For more details see the Aurelia blog.
Angular 7 is now released and it includes CLI Prompts, Virtual Scroll, Drag and Drop and more!
Angular 6 came out in May 2018, and it focused on improving the toolchain and on making it easier to develop quickly with Angular.
Since v2 was released, the Google team has met its own proposed schedule on releasing new minor and major versions
Angular 2.1 — Route Preloading
Angular 2.2 — AOT + ngUpgrade
Angular 2.3 — Language Service
Angular 2.4 — “Stability Interjection”
Angular 4 — March 2017
Angular 5 — Sept/Oct 2017
Angular 6 — May 2018
Angular 7 — Oct 2018
Angular 8 — Planned for early 2019
The Google Team have agreed to release new patch versions every week, a new minor version every month and a major version every 6 months.
By new major version we mean new features and potential breaking changes since the last release. So we should not necessarily get overexcited about new major versions, or conflate higher major numbers with very much higher quality.
For full details see Igor Minar’s blog post and opening keynote. Igor makes many interesting points in the keynote.
Google always use the latest version of AngularJS for their own applications. He also mentions TypeScript and the desire to support v2.1.
Some of the new Angular features delivered were:
- Better Compiler Errors
Angular 4 is backwards compatible with Angular 2 (but not Angular 1) so Angular 2+ is a much better bet for new applications that you will need to maintain and improve over a long lifetime.
The Google team recommends we use the latest version.
Asked about using Angular with a module loader Igor said
“This will probably change in 6 months…it seems that webpack is a better option from the developer ergonomics.”
he goes on to explain where Rollup or SystemJS may be better.
Google’s Green Tea app was rewritten big-bang for Angular 2.
Angular 2 on Pluralsight
The most recent course is John Papa’s Angular CLI course.
The Pluralsight Angular 2 Fundamentals course is a huge 10 hour course.
There is also a Play by Play course by John Papa and Dan Wahlin.
I’ve also written reviews of first look and getting started. Deborah Kurata’s getting started course has been updated for the RTM version of Angular 2 and contains more than an hour of additional content than her original course.
If you haven’t currently invested in Polymer 1.x or 2.x, I recommend using v3.x.
For v1.x users, to learn about the upgrade path to Polymer 2.0 watch Polymer 2.0 in 2.0 seconds. To understand how it works see Polymer 2.0: Under the Hood. Rob Dodson describes Polymer as an opinionated usage of Web Components.
Another good watch is What’s New in Polymer Tools.
And if you want to move your website from jQuery to Polymer, check out Craig Shoemaker’s HTML5 Web Components course.
Ember v3.5.0 is out now and v3.6.0 is in Beta.
Noel Peden has produced the Pluralsight course Getting Started with Ember 2
For a history of the evolution of Ember.js see the EmberConf 2017 keynote — Yehuda Katz and Tom Dale address the common perception that Ember is an outdated framework with too much baggage 21 minutes in. They are continually working to modernize the framework in a way that doesn’t alienate the existing user base.)
Another detailed table at 48 mins in. Rob claims that the Angular teams don’t use their own frameworks, and that only the Aurelia and Ember teams are available to provide training.
(If you need React JS Training it is provided by Ryan Florence and Michael Jackson from Facebook)
Community and Communication
Another table of information and commentary on how strong each community is and how well the teams communicate with those communities.
All frameworks score well on this.
Another table of information at 54 mins giving details on:
- Corporate Buy-in
- Commercial Support
- Customer Relations
- Official Relations
- Official Partners
- Brand Recognition
Rob says Angular 1, Angular 2 and Polymer are not Google products. They are open source side projects from teams inside of Google.
(For detail’s on Google’s CRM system greentea, and it’s relationship with Angular, see How Google Uses Angular 2 with Dart. Google has also rewritten Google Adwords using Angular 2, and this is millions of lines of code.)
Yes: Aurelia and Ember
Maybe: Polymer (or web components JS) and React (or Riot to avoid the patent problem and smaller size)
Rob says React is much better for read only apps and a lot more work for input intensive apps.
No: Angular 1 and Angular 2
Rob finishes the talk by re-iterating that he is biased, but hoping that the talk included useful information.
(I definitely feel that this talk has been useful to me. When doing your own assessment don’t forget there’s also Elm, Meteor, Cycle, Marionette, Inferno, Sails, Vue and many others worth considering.
Agree with Rob’s opinions? Disagree? Please leave your comments to discuss.
There is no one framework that is objectively “best”. Every option has its own strengths and weaknesses as we have seen. Your choice should depend on your own circumstances. A few guidelines:
Do not bother using Angular 1 anymore
Strongly consider Angular 7 if:
- You are a fan of TypeScript or have developers with TypeScript experience
- You want to write large, very high performance applications
- You don’t mind taking a bit more time to learn an advanced framework
- You don’t mind your users downloading a larger than average file
- You do not want to fall behind the technology curve (it is being regularly updated in a way that makes it easy to stay current)
Strongly consider React if:
- You are writing a medium or large scale app and are concerned about maintainability
- You prefer to make your own specialized decisions on how your software works — you enjoy investigating and evaluating new technologies
- If you write a bug you prefer to fail fast and early
- You do not mind writing a bit more code as long as it clear and understandable
- You are not religious about web components, as React’s virtual DOM does the job well enough
- You are not frightened by the patent clause
Strongly consider Ember if:
- You are not particularly interested in chasing the latest shiny things; you just want something that is proven and reliable
- You don’t want to waste time being overwhelmed by the number of possible solutions to a problem — you want an opinionated framework that gives you standardized and high quality solutions to the common problems
Strongly consider Polymer if:
- You love Web Components
- You love minimalism
- Your users, or most of them, are using very modern browsers
- You want the minimum “startup tax” on your users — the Polymer file size is tiny
Strongly consider Aurelia if:
- You want a framework that doesn’t get in your way too much
- You are a fan of Web Components
- You appreciate a clean syntax
- You consider standards compliance an important consideration
- You only hire good developers, so you are confident they will be able to learn the framework quickly enough
Fun Fun Function: Too many tools and frameworks! (how to deal with it)
Tessa Thronton: How to learn web frameworks
Review of Brian Noyes’ Aurelia Fundamentals course