Skip to content
This repository was archived by the owner on Mar 22, 2019. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions source/blog/2018-05-18-the-emberjs-times-issue-47.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,26 @@ Again you can enjoy reading the Ember.js Times in both the [e-mail](https://the-

## [EMBER THINGS 🐹](#your-url-here)

---

## [EMBER DATA THINGS](#your-url-here)

- new RFC here: https://github.com/emberjs/rfcs/pull/332
---

## [Meta and Link all the Things](#https://github.com/emberjs/rfcs/pull/332)

This backwards compatible RFC allows `ember-data` users to associate optional `meta` and `links` on records alongside the top-level document `meta` (mandatory) and `links` (optional). Sadly, `ember-data` currently stores this information only on relationships and not individual records. The RFC design is pretty straightforward, designate that all `meta` and `links` :
- will be honored in any resource encountered in a json-api compliant document
- when defined on resource identifiers, for example links to resources within a relationship, will be ignored.
- when defined on relationship objects will continue to function as they do today.
- will be exposed as getters on instances of `DS.Model` and will default to null if nothing has been provided.
Similarly, `meta` and `links` will be exposed on instances of `DS.Snapshot`. Although `meta` and `links` are getters on `DS.Model`s, they will be exposed on `DS.Snapshot` as methods:
```js
class Snapshot {
links() {}
meta() {}
}
```
Interestingly, some apps have inadvertently achieved what this RFC purposes by moving `meta` and `links` into `attributes` during serialization and then exposing each of them via `DS.attr`., Therefore, this RFC gives `ember-data` an even more complete "out of the box experience" and will likely be a very welcomed addition to the library.

Think differently? Tell @runspired what you think at https://github.com/emberjs/rfcs/pull/332
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be link chris' github/twitter profile?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh for sure. I ran out of time And had to step away from my computer. I will do it shortly.


---

Expand Down