3 ms·
I wrote this before, I'm writing this here again: Ember is a complete frontend/SPA framework. 2 key advantages Ember.js has over other SPA solutions are server
by izelnakri 8y ago
I wrote this before, I'm writing this here again:
Ember is a complete frontend/SPA framework. 2 key advantages Ember.js has over other SPA solutions are server-side rendering and advanced acceptance/end-to-end testing.
- You can do server side rendering with other frameworks however it is significantly easier and better to do it with Ember.js due to the way ember routing model and ember-data works. You can do acceptance testing with other tech stacks however they cannot be as fast as the usual ember acceptance testing stack + ember mirage. Mirage mocks your backend and introduces an in-memory ORM thus your tests wont ever need to hit your backend or the database, I wrote a better mirage alternative as mirage do have issues outside the context of this topic. Backend mocking comes with 3 major advantages and 1 major disadvantage:
Advantage 1: Your tests will be extermely fast(a speed cypress cannot compete with). Ember test suite knows exactly when your app starts, it can listen to the next visit, next Ember loop in the Run loop for async functions and execute immediately without timers. These are well defined and documented in the framework.
Advantage 2: Most web backends are not built on JavaScript, however current trend is to write acceptance tests in JS/node.js due to the all available ecosystem support in a certain SPA framework/library. Since your backend logic is most probably written in another language you cannot access the backend data in your frontend tests. Ember mirage replaces your backend thus you can access your backend data on acceptance tests for higher test quality. If your backend is written in node.js you can require your models and query them inside the tests thus not much there wont advantage here. For the majority of backends you will have to write your own hacky tool to query your backend if you want higher quality testing. Or you have to write your acceptance tests in your backend language which will be no doubt slower than ember tests + headless browsers that have JS API support.
Advantage 3: You can develop very complex frontend demo applications on the development mode with Ember mirage without a backend. There is a productivity advantage when your frontend developers are not backend developers/not familiar with your backend stack. You can source your backend API responses as Ember mirage fixtures thus eliminate the need for data preparation/model generations with factories for each frontend tests. Also you can easily create demo deployments for client meetings.
Disadvantage: - Sometimes you need to write your backend logic in Ember mirage routes. Ember mirage is still an alpha software and all these add up to the learning curve.
Ember.js has lots of potential and a mature ecosystem.