kurko / ember-json-api

JSON API adapter for Ember Data.
MIT License
254 stars 62 forks source link

Support for JSON API 1.0 #82

Closed barelyknown closed 9 years ago

barelyknown commented 9 years ago

I'm not sure if you're going to update this library to support JSON API 1.0, but if you are, I submitted this PR https://github.com/eneuhauser/ember-json-api/pull/14 to a more up to date fork that you might want to build on.

SeyZ commented 9 years ago

:+1:

jcloutz commented 9 years ago

1.0 support would be great

koemeet commented 9 years ago

Nice :+1: Would be awesome!

jonkoops commented 9 years ago

I have all intention of getting this library to be complaint with JSON API 1.0, @eneuhauser is doing a lot of awesome work we can all benefit from.

ballPointPenguin commented 9 years ago

Is this library being dovetailed by ember data 1.0? Will ember data just use this library to add support for the JSON API?

gr0uch commented 9 years ago

@ballPointPenguin I'm not really sure, AFAIK Ember Data has not even preliminary support for JSON API yet, though the core devs are aware of @eneuhauser's fork. It will likely be re-implemented by the core devs, perhaps @igorT knows.

jonkoops commented 9 years ago

@daliwali From what I've heard a JSON API adapter will be introduced by the Ember Data team.

If such a library were to be introduced I think we should focus our efforts there and migrate our users as gracefully as we can. There is no use fragmenting the user base over different libraries.

@eneuhauser I would love to have your opinion on this matter seeing you've been such a prolific contributor to the project.

ballPointPenguin commented 9 years ago

Agreed. See, for example https://github.com/emberjs/data/issues/2905 & https://github.com/emberjs/data/pull/2904

ballPointPenguin commented 9 years ago

Also very relevant: https://github.com/eneuhauser/ember-json-api/pull/14

igorT commented 9 years ago

@daliwali we changed our serializers and store apis to use json api, and adding a json api serializer is the next step (approximately 0 lines of code for normalization, as our internal format is json api now). I would expect it to land this week

gr0uch commented 9 years ago

@igorT :+1:

eneuhauser commented 9 years ago

@igorT This is awesome! One thing the ember-json-api library has is an extensive set of unit / integration tests. There has been some work to get them up-to-date with version 1.0 of JSON API and I would like to see how ember-data stacks up against the test cases.

This is also a good community to reach out to for people that have implemented the JSON API spec and many (including myself) are upgrading to 1.0, so plenty to test the new ember-data implementation.

igorT commented 9 years ago

@wecc had looked at the tests and copied/repurposed them i believe.

jonkoops commented 9 years ago

So I'm thinking we should probably start planning a migration path for our users as soon as the official code lands. Currently the meta issue tracking 1.0 of Ember Data is pinned for tomorrow (June 12th) but looking at the list of open issues I'm guessing we're still getting at least one beta release before the actual stable hits.

@kurko @eneuhauser @daliwali Just to get some confirmation, you guys all agree we should go for a depreciation of this library in favour of the official Ember Data one? If we can get a consensus here I'll create an issue to track what needs to be done.

gr0uch commented 9 years ago

@jonkoops in favor :+1:

barelyknown commented 9 years ago

I agree that it makes the most sense to deprecate this library in favor of official Ember Data support.

eneuhauser commented 9 years ago

@jonkoops I'm excited to be a core contributor, but I vote we deprecate the library. It was fun while it lasted.

I'm finally getting back to my Ember project using JSON API, so I can dedicate some time to this library. My plan is to review Ember Data 1.0. Igor indicated the tests have been integrated with the core, but I'd like to just run a sanity check against them. If there are any gaps, I can merge the 1.0 pull request to use this library as a polyfill until Ember Data is completed.

kurko commented 9 years ago

@eneuhauser I agree with you. I already talked to @igorT about it and the right thing to do is to deprecate this one. However, I want to do that at the right moment. A lot of people are using this lib and I think it'd be a disservice to deprecate it while ED is beta.

I'd deprecate it as soon as people have solid alternative in ED. Thoughts?

jonkoops commented 9 years ago

@kurko Yes, I agree. We definitely should not start deprecarion without having a solid alternative. I think we should target deprecation when Ember Data has a stable release.

EmergentBehavior commented 9 years ago

Ember Data 1.13 was released less than 24 hours ago. According to https://github.com/emberjs/data/issues/2905, the JSON-API adapter is now baked in and may be usable from a nightly.

SeyZ commented 9 years ago

:tada: I use the JSONAPI adapter/serializer from the canary build. It works really well.

jonkoops commented 9 years ago

@EmergentBehavior @SeyZ Great to hear! I'll start the deprecation process as soon as this lands in a stable form.

jonkoops commented 9 years ago

I've opened up an issue (https://github.com/kurko/ember-json-api/issues/86) to discuss deprecation and build a todo list. If you have anything to add about what we can do to improve this process, please let me know.

jonkoops commented 9 years ago

@eneuhauser I think we should get the work done in your repo + the 1.0 pull request over to this project. Compliance with v1.0 of the spec is essential to a smooth migration.

eneuhauser commented 9 years ago

@jonkoops Yeah, we can work from the pull requests and issues in my repo. I have my server upgraded to 1.0, so I have live services I can verify the 1.0 pull request.

The biggest issues will be upgrading ember-data. I briefly tested with 1.13.2. It worked, but I got several deprecation warning specific to the custom adapter and serializer.

EmergentBehavior commented 9 years ago

@eneuhauser I had some deprecation warnings too with JSONAPIAdapter/Serializer but was able to overcome them by doing the following:

In application adapter, add:

shouldReloadAll: function() {
        return true;
    }

In application serializer, add: isNewSerializerAPI: true

I had to tweak the serializers to camelCase keys, but otherwise the adapter is working great for me with a JSON-API compatible service I wrote for server-side.

jonkoops commented 9 years ago

@eneuhauser Has blessed us with a marvellous pull request bringing us up to speed with v1.0 spec compliance. I'd appreciate it if some of you could go ahead and give it a try, so we can iron out any bugs. I'll probably be spending next week updating some apps as well. The pull request can be found here: #88

jonkoops commented 9 years ago

I am happy to report we just added JSON API v1.0 support by merging the before mentioned pull request. A huge thanks again to @eneuhauser and @barelyknown.