Ember.js is a framework for web developers. I went through their excellent documentation and made an EmbeRentals app along the way for the sake of learning. You can find the source code and see it live in action.
- Quick Start – the first taste of Ember
- Tutorial – after going through this tutorial you will be able to completely understand EmbeRentals app.
For more in-depth topics:
- The Object Model
- Application Concerns
- Addons and Dependencies
Ember CLI is the official command line utility used to create, build, serve, and test Ember.js apps and addons. You can use it to bootstrap your app, get project structure setup, zero configuration, running, testing, building, using generators for boilerplate code, addons, etc.
Editor / IDE
My choice is WebStorm IDE from Jetbrains, but I am considering trying Atom text editor also.
- ES6 support
- Hot Redeploy – as soon as you change something in the app – page and tests are refreshed.
- Router – each URL is mapped to a router handler and it can provide the data model before rendering a template.
- Templates in Ember use Handlebars. Templates render data from model, use components, give layout, content etc
- Components can be created in Ember for reuse. They contain template and JS file for handling initialization, events, states, etc.
- Service is a singleton containing business logic. I see them as Spring’s services.
- Ember addon is basically NPM package that extends Ember app in some way.
- Using Ember CLI and generators we can create boilerplate code for almost all these elements (components, templates, routes, services, addons, tests..)
- Using Ember CLI we can start and build our app.
- Mirage is a client HTTP stubbing library often used for Ember application testing. I used mirage as our source of data rather than a traditional backend server. Mirage allows us to create fake data to work with while developing our app and mimic an API. The data and endpoints come into play when we use Ember Data to make server requests.
Ember.js takes testing seriously. TDD approach in their docs, Ember CLI automatically creates tests while using it’s generators to create different elements of the app. They use QUnit by default. Excellent support for unit, integration and acceptance testing. If you visit http://localhost:4200/tests you can run and see all test results in the browser. With ember test tests can be run in the console.
You just have to deploy dist folder content to your web server and that’s it. I deployed this app using Surge.sh. I didn’t do production build because I wanted to keep Mirage fake data and not to implement my own API for this app 😉
ember build --environment=development mv dist/index.html dist/200.html surge dist emberentals.surge.sh
Seems like a mature framework worth exploring more deeply. I was surprised that Serbia has Ember community and even a mascot with traditional Serbian clothing: