When comparing React vs Ember, the Slant community recommends React for most people. In the question“What are the best client-side JavaScript MV* frameworks?” React is ranked 7th while Ember is ranked 16th. The most important reason people chose React is:
Since every single UI component is created independently in JavaScript, it becomes very easy to reuse them throughout your app without having to re-write them.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Easy to reuse components
Since every single UI component is created independently in JavaScript, it becomes very easy to reuse them throughout your app without having to re-write them.
Pro Supported by Facebook and Instagram
React is built by Facebook engineers initially to be used only for their inner projects especially to solve the problem of building large complex applications with constantly changing data.
Pro Server side rendering
React can render it's components and data server side, then it sends those components as HTML to the browser.
This ensures faster initial loading time and SEO friendliness out of the box, since it's indexed as any other static website by search engines.
Pro Virtual DOM support
Instead of relying on the DOM, React implements a virtual DOM from scratch, allowing it to calculate precisely what needs to be patched during the next screen refresh. This is orders of magnitude faster than fiddling with the DOM itself.
Pro One-way data flow
React's one-way data binding (or one-way data flow) means that it's easy to see where and how your UI is updated and where you need to make changes. It's also very easy to keep everything modular, fast and well-organized.
Pro Can be used with different libraries
ReactJS can be used independently as the only library for building the front-end, or it can be used alongside JavaScript libraries such as jQuery, or even Angular.
Pro Template engine independent
React provides a template engine (JSX) which is easy to use. But it's not mandatory.
Pro Widely used
The framework is widely used in the industry.
Pro Functional programming style leads to less buggy UIs
Pro Easy to write tests
Since React's virtual DOM system is implemented completely in JavaScript, it's very easy to write UI test cases.
Pro Good debugging tools
React has an official Chrome Extension which is used as a developing and debugging tool. It can be used to quickly and painlessly debug your application or view the whole application structure as it's rendered.
Pro Flux architecture pattern
Flux is a platform agnostic pattern which can technically be used with any application or programming language.
One of Flux' main features is that it enforces uni-directional data flow which means that views do not change the data directly.
With React this is useful because this way it's easier to understand an application as it starts getting more complicated. By having two-way data binding, lead to unpredictable changes, where changing one model's data would end up updating another model. By using the Flux architecture, this can be avoided.
Pro Extensive SVG support
Since React v0.15, SVG is fully supported. React supports all SVG attributes that are recognized by today's browsers.
Pro Keep control over your app's logic
React is just a view library, so you still have (almost) full control over how your app behaves.
Pro Supported by ClojureScript libraries
Reagent, Om, Rum, etc.
Pro Tested on Facebook itself
React is used on one of the most visited websites on the planet, Facebook. With stellar results and with millions of people experiencing it every day.
Pro Opinionated in terms of application structure
Ember already defines the general application structure and organization for you. This was done to prevent developers from making mistakes which would needlessly over-complicate their application. While it's still possible to go out of these practices forced to developers by the Ember authors, you still have to go out of your way to force them.
Pro Ember-CLI
Ember-CLI is a very useful tool. With just a couple of commands it scaffolds the code, installs dependencies and finally compiles everything itself. It's very useful to quickstart an Ember project.
Pro Uses Handlebars
Ember's preferred templating language is Handlebars. This is mainly because Handlebars is a logic-less templating language and Ember tries to keep it's logic outside the view.
Another reason why Ember benefits from Handlebars is mostly aesthetic as Handlebar's clean syntax makes for easier to read and understand templates.
Finally, Handlebars templates are compiled instead of interpreted, which means that they are much faster to load.
Pro Convention over configuration
Ember follows the philosophy of "convention over configuration" meaning that it already has almost everything configured for you, so you just have to start coding and developing your project right away.
Pro Complete front-end stack
Ember is practically a complete full-stack front-end framework. It comes with it's own asset pipeline, router, services etc...
Pro Completely community based
Pro One of the fastest template rendering engines (new glimmer)
Pro Easy to understand documentation
The Ember Guides are well structured and very well written. The API documentation is also fantastic.
Pro Ember's Object model makes the framework extremely consistent
Most of Ember's components come from the Ember Object Model. It's the basis for views, controllers, models and even the framework itself. This means that the framework is extremely consistent since almost every component shares the same core functionalities and properties since they are all derived from the same object.
Pro Excellent routing
Route handlers for the URLs can see a wide range of possible application states, asynchronous logic in the router makes sure of Promises. And implementing makes sense.
Pro The run loop
It batches bindings and DOM updates to increase performance; if similar tasks are added to a batch, the browser would only need to process them in one single go, as compared to re-computing for each task one at a time.
Pro Excellent API
Ember's API are really easy to understand and work with. It has methods which allow you to harness complicated functionalities in an easy to understand way.
Pro New router has less boilerplate code
Ember's new router need much less boilerplate code that it previously did.
Pro Debugging tool for almost every web browser
Ember also has a debugging tool called Ember Inspector which is used for debugging the client side of your app.
Pro Works great with jQuery
You can use any of jQuery’s features.
Pro Useful bindings
EmberJS provides with an extremely handy feature of advanced bindings. With this you can not only set the path to the binding value in your app but also set in which direction you want the changes to propagate to (oneway
, single
, multiple
etc).
Pro Promises everywhere
Promises represent an eventual state in asynchronous logic. Having promises everywhere (almost) means you could write simple and modular code, using almost any API that Ember provides.
Pro Computed properties
Having custom properties in your templates is itself a huge plus but having custom computed properties is an even greater benefit, since now you can code your custom function as a property and call it from your template. Hence rendering your page exactly according to your needs.
Pro Built-in router
Ember comes with built-in routing capabilities. There's no need to install third-party plugins to be able to use routes.
Pro Auto-updating templates
If you've used handlebars (Ember.js's templating is powered by HandleBars) helper tags in your code (like {{#each}}
) you won't have to worry about updating your template each time you add/remove data from your page, Handlebars will auto update your template for you.
Cons
Con Heavy on memory
React's virtual DOM is fast, but it requires storing elements in the virtual and real DOM increasing memory usage for the page. This can be a real problem for single-page webapps designed to be left running in the background.
Con Template(view) mixed into code
Con Verbose
React gets a little verbose as applications get more complicated with more components. It's simply not as straightforward as simply writing HTML and JavaScript would be.
Con You have to learn a new syntax
Requires learning a custom syntax, JSX, that has some gotchas and introduce complexity, a steeper learning curve, and incompatibility with other tools.
Though you can opt out from JSX and use vanilla JS instead. But that is not recommended since it adds a lot of unneeded complexity which JSX tries to avoid.
Con Not a complete solution
React does not do everything for the developer, it's merely a tool for building the UI of a web app. It does not have support for routing or models, at least not out of the box. While some missing features can be added through libraries, to start using React and use it in production, you still would need to have experience, or at least a good grasp on what the best libraries to use would be.
Con Large file size
React's react.min.js
is 145.5KB in size. It's much larger than some other libraries that offer roughly the same features and it's almost the same size as some MV* frameworks such as Angular or Ember that offer more features out of the box.
Although, it should be mentioned that sometimes having a smaller library may force developers to reinvent the wheel and write inefficient implementations on features that React already has. Ending up with a larger application that's harder to maintain and/or that has bad performance.
Con Renders too frequently
Con No support for legacy browsers
React has recently dropped support for Internet Explorer 8. While the library may still work on IE8, issues that affect only IE8 will not be prioritized and/or solved.
Con Large library size
At 69Kb gzipped, it is one of the largest JavaScript frameworks. This means Ember might be an overkill to use on simpler projects.
Con Very opinionated
Ember (and many extensions, like Ember Data) force the implementation down specific architectural paths. These paths are what Ember believes is best practice and typically are fine, but not in all cases. This can occasionally lead to fighting with your framework which is never productive.