dgeb
I wanted to write out the explicit `return` form of the handler to emphasize that returning a promise in an Orbit event handler has significance. It delays resolution of the event, thereby allowing listeners to participate in that resolution.
Perhaps it was unnecessary for me to _also_ include the implicit return form in that example. However, that's the way I would normally write this function, and I'd like to present "best practices" and show how concise the code is typically.
Still, I think it's a pretty good time to start exploring engines. I'd say that the feature should be quite stable by the time 2.8 stable ships. Plus, we should have a preliminary lazy-loading story finished by then, which has the potential to really impact your app's perceived performance.
JSON API reaches v1.0
There is no consensus on the details of "REST". Every implementation has its subtle quirks and solutions to the same basic problems. Every client library must be customized to adapt to these differences. Since the fundamental aspects aren't agreed upon, there is little chance of defining compatible features at a higher level.
On the other hand, the value proposition for JSON API is rooted in consensus [1]
[1] https://news.ycombinator.com/item?id=9281102
> As JSON-API comes from the Ember.js camp
JSON API has been proven in many languages and frameworks. The JSON API team is diverse and has only one member on the Ember core team (@wycats). More importantly, JSON API has been influenced by hundreds of contributors with diverse backgrounds and specialties.
At this point, JSON API is pretty far from its original extraction from Ember Data. It has come full circle to the point that a JSON API Adapter is being written from scratch for Ember Data (and is now almost fully compatible).
First of all, JSON API provides guidance for a lot of API design decisions that are usually contentious because, although they may seem trivial, they must be made with care in order to be consistent and viable. For instance, JSON API provides guidance for:
* fetching related resources together with primary resources in order to minimize requests
* limiting the fields included in a response document in order to minimize payload size
* paginating data with links that work well with any pagination strategy (page-based, offset-based, and cursor-based)
* sorting results, even potentially based on related resource fields
* representing heterogeneous collections and polymorphic relationships
* representing errors
In my opinion, some of the most useful guidance is related to the representation of relationships, which can include:
* embedded linkage data which "links" primary resources with related resources in a compound document.
* relationship URLs which can retrieve linkage data and directly manipulate the relationship without affecting the underlying resources.
* related resource URLs which can retrieve related resources themselves.
In addition, JSON API supports extensions and has official extensions for performing bulk updates and JSON Patch operations. These particular extensions provide extremely useful mechanisms for transactionally working with multiple resources.
All of this guidance has been forged over the course of two years based on the feedback and contributions of hundreds of developers. Even if you were to incorporate some of this guidance in your APIs piecemeal, it would probably save your team many hours of design discussions.
However, the bigger value proposition of JSON API is just now beginning to be realized. Since we've tightened the "spec" into a proper spec by eliminating many MAYs and SHOULDs, it is now possible to reliably build implementations with a guarantee of compatibility. It's regrettable that it took us so long to move from providing loose guidelines to a more rigid spec, but I truly believe that the awkward intermediate phase provided invaluable feedback that ultimately informed the design of the spec and will improve adoption of 1.0.
We are seeing client libraries being built in JavaScript, iOS, and Ruby, and server libraries in PHP, Node.js, Ruby, Python, Go, and .NET. Although not all are (yet) compliant with the latest changes to the spec, we are tracking progress carefully as the spec nears 1.0 to ensure that we smooth over any rough spots encountered by implementors. I'm personally involved in developing Orbit.js and JSONAPI::Resources, both of which are nearing JSON API compliance.
I can say that it's incredibly satisfying to build applications with compatible client and server libraries. It lets me focus on the design of my application's domain instead of myriad details related to transforming data representations and protocol usage. Even better is the knowledge that other clients can easily use my API and all of its advanced features, regardless of their language and framework. This is ultimately the promise of JSON API, and it won't be long before it's realized.
Jsonapi-resources – Easily Support JSON API in Rails
I'd hoped there wouldn't be confusion with a component in such a different domain (image slider vs. data), but I will consider a rename if that proves to not be the case.
Stay tuned - I'm currently working on an introductory blog post as well as detailed docs and an example app.
Edit: I just updated the readme with essentially the same use cases I mentioned above.
Thought experiment for deciding a web app's architecture
The "Development Drawbacks" of JavaScript Web Applications
Stop using the term "Single Page Application"
It would also force the priority of responsive design. Now that we all work at so many different resolutions, apps and sites should adapt seamlessly to resizing.
Understanding Ember.Object
Beginning Ember.js on Rails: Part 3 (of 3)
Beginning Ember.js on Rails: Part 2
Beginning Ember.js on Rails: Part 1
Warming up to Ember.js
If we abstract analogies too far, I worry that people will ignore them. I tried to leave Uncle Art with very few dots to connect by only changing the "host" business in my analogy.
Here's the analogy I tweeted a couple weeks ago: "SOPA is the equivalent of allowing Disney to shut down a restaurant because a customer drew Mickey Mouse on a napkin."
I think anyone can recognize the injustice in that.
I just registered orbitjs.com but would be willing to donate it. I think the name is a good fit for a framework that aims to keep so many objects moving effortlessly around each other. Contact me (@dgeb) if you're interested.