What I'm Using Instead of Ember Data


#1

I’m building a relatively large Ember application that interacts with an API, and for a number of reasons chose not to use Ember Data.

It’s a little rough around the edges, and I’m still working on the exact API for interacting with it, but I thought I’d post it here. It’s called RestModel—here it is on GitHub.

A few points:

  • It always makes API calls. Even when its (currently elementary) caching is enabled, it’ll resolve with the cached data, but still make an API call.
  • There are no model relations. I don’t actually find this useful in working with an API, although I’m thinking of adding the functionality. Currently, nested resources are managed by setting a parents property.
  • It’s extremely easy to learn, and extremely easy to use. I’m working on a team where most of us are relatively new to Ember, and having a library that makes interacting with our API extremely simple has helped us to move very quickly and focus on learning Ember itself.

Some goals further down the line include things like generating classes automatically based on a JSON schema. Our API has a well-defined schema that we can easily derive available endpoints, links, and even some validations from.

Anyway, hope someone finds it useful. It’s not perfect, but it’s given us the simple, low-level wrapper around making API calls we wanted.


#2

Looks very nice, thanks for sharing.