Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Thoughts on removing ember data from ember

The problem

Ember currently ships with ember data, and it is assumed that you will be using ember data within your application. The getting started guides also make the same assumption, and introduce ember data, before even mentioning that one can return a POJO or a promise that returns a POJO, for example an ajax request.

This contributes to the cognitive load of "learning ember" and I believe contributes substantially to the "steep learning curve" associated with learning ember. Ember data is indeed, a relatively complex product, with at least 4 core concepts to learn (models, store, adapters, serializers). To make matters worse, if your API isn't a nicely structure JSON-API, you're in for a hard time whilst you naviagte the ember data documentation to work out what to do. All of this is unnecessary to a new adopter to ember, and is likely to scare them off the framework entirely.

Background

Whilst some colleagues of mine worked with getting started with ember, they quickly came across stumbling blocks, not with ember itself, but with ember data, due to the fact that our API is not a JSON-API, and understand how to get it to work with ember data is no small task. There are a bunch of concepts to learn before you can get the data down to your components. The fact that the guides don’t explain up front that you can just return a POJO highlights this very problem.

Ember data certainly provides a great standardisation of your data layer, it also provides out of the box functionality for things like fastboot and other adding like ember mirage that “just work”. However not everyones data layer is going to be resource based, some apps don’t need it, some are more transactional rather than “resource” orientated, and forcing people to “opt out” rather than “opt in” feels like the framework is making too many assumptions about how people will build their apps. Those assumptions are great from a UI and convention basis, but I’m not sure the same can be said for the data layer.

Proposed solution

  • Remove ember data from ember's package.json
  • Remove almost all reference to ember data from the getting started guides, perhaps linking at the bottom of the relevant sections
  • Create a separate "How does ember deal with data" section in the guides, and introduce ember data, along with other options like straight up ajax, ember redux, etc.

Conclusion

  • I think ember is great.
  • I think ember data is great.
  • Forcing new ember users to use ember data makes assumptions that I don’t think the framework should make.
  • Introducing ember data when users start to need data persistence feels like the right time, rather than in the getting started guides.
@rtablada

This comment has been minimized.

Copy link

commented Dec 27, 2017

@oligriffiths, I'm currently working on updated documents that would go between the getting started guide and the current super rentals tutorial.

This will do two things:

  1. Cover using Ember with network/request based data without using ED
  2. It will also allow Super Rentals to go into deeper topics

The tutorial we've been working on has been aimed at creating a small contact manager application to cover:

  • Routing
  • Templates
  • Network Requests (without Ember Data) using fetch
  • Actions
@oligriffiths

This comment has been minimized.

Copy link
Owner Author

commented Dec 27, 2017

Dope. That sounds great. Happy to look over it once you’re done.

@Caltor

This comment has been minimized.

Copy link

commented Mar 2, 2018

Finally someone who agrees with us about ember-data! We started using ember about a year ago and I nearly gave up because I had no end of problems trying to get it working with our C# non json.net api. A colleague finally convinced me to drop ember-data and use Ajax requests with POJO instead and my life became 10 times easier overnight. Another colleague has just started with ember and is experiencing the same pain points. It seems if you use node or ruby backend you are fine otherwise you are in for a world of pain. I'm sure ember-data is really great with lots of benefits but other than mirage we are yet to see whst they are. I totally agree with you that ember-data probably puts a lot of people off the fantastic ember framework and has hampered adoption because of perceived difficulty. Please implement this proposal ASAP.

@Gaurav0

This comment has been minimized.

Copy link

commented Mar 2, 2018

Also, if a store were separated out of ember data so that one could get request caching benefits while still using traditional ajax requests that might be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.