Data: Ember Data Deprecation Guide

Created on 5 Dec 2016  路  7Comments  路  Source: emberjs/data

We need your help 馃槃

The Ember guides have a great section with details about deprecated features for Ember itself and we should definitely now have the same for Ember Data.

As you can see below, there is quite a bit of work to do in order to make sure we cover all of the deprecations that have occurred throughout all of the Ember Data 2.x releases.

What We Need From You

  1. Pick a deprecation from the list below.
  2. Post a comment in here letting everyone know what you're planning to work on
    so we don't accidentally duplicate effort.
  3. Make a PR to the emberjs/website repo adding your deprecation to the Ember
    Data Deprecation Guide
    .
  4. Make sure your PR links back to this issue so we can track it.

Deprecation Format

### Deprecations Added in Ember Data <VERSION>

#### <TITLE>

###### until: <DEPRECATED UNTIL VERSION>
###### id: <DEPRECATION ID>
###### feature: <feature flag (if applicable)>

<DETAILS>

Tips

  • Try to provide an explanation for why the change was made. If you're not sure, try asking in #ember-data on the Ember Community Slack.
  • Provide links to the docs where relevant.
  • Provide a before and after example when possible.

Deprecations added in 1.13

  • [x] DS.Store#filter should probably be moved out of codebase into the addon
    link

Deprecations added in 2.3

  • [ ] [ember-application.injected-container](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/-private/system/model/model.js#L1037-L1039)
  • [x] [ds.defaultValue.complex-object](https://github.com/emberjs/data/blob/master/addon/attr.js#L13-L17) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2741
  • [x] [ds.rest-serializer.deprecated-key-for-polymorphic-type](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/rest.js#L767-L770) commit (:lock: @heroiceric) https://github.com/emberjs/website/pull/2755

Deprecations added in 2.4

  • [ ] [ds.errors.registerHandlers](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/-private/system/model/errors.js#L101-L105)

The following are only kinda sorta maybe deprecated for now. See https://github.com/emberjs/data/issues/4694

  • ds.errors.add link
  • ds.errors.remove link
  • ds.errors.clear link

Deprecations added in 2.6

  • [x] [ds.serializer.normalize-hash-deprecated](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/rest.js#L159-L162) (馃敀 @romulomachado) https://github.com/emberjs/website/pull/2742

Deprecations added in 2.7

  • [x] [ember-data.global-ds](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/index.js#L169-L174) (馃敀 @romulomachado) https://github.com/emberjs/website/pull/2743
  • [x] [ds.ember.date.parse-deprecate](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/-private/ext/date.js#L62-L68) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2745
  • [x] [ds.date.parse-deprecate](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/-private/ext/date.js#L74-L88) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2748
  • [x] [ds.serializer.rest.queryRecord-array-response](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/rest.js#L308-L311) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2747

Deprecations added in 2.11

  • [x] [ds.store.recordIsLoaded](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/-private/system/store.js#L1784-L1787) (馃敀 @romulomachado) https://github.com/emberjs/website/pull/2744
  • [x] [ds.store.lookupAdapter](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/-private/system/store.js#L2596-L2599) (馃敀 @romulomachado) https://github.com/emberjs/website/pull/2744
  • [x] [ds.store.lookupSerializer](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/-private/system/store.js#L2604-L2607) (馃敀 @romulomachado) https://github.com/emberjs/website/pull/2744

Deprecations Added in Pending Features

[FEATURE] ds-overhaul-references

  • [x] [ds.references.has-many.push-array](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/-private/system/references/has-many.js#L253-L256) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2758
  • [x] [ds.references.has-many.push-invalid-json-api](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/-private/system/references/has-many.js#L265-L268) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2758
  • [x] [ds.references.belongs-to.push-record](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/-private/system/references/belongs-to.js#L248-L251) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2758

[FEATURE] ds-improved-ajax

  • [ ] [ds.json-api-adapter.ajax](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/adapters/json-api.js#L282-L285)
  • [ ] [ds.json-api-adapter.ajax-options](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/adapters/json-api.js#L290-L293)
  • [ ] [ds.rest-adapter.ajax](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/adapters/rest.js#L1219-L1222)
  • [ ] [ds.rest-adapter.ajax-options](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/adapters/rest.js#L1227-L1230)

[FEATURE] ds-deprecate-store-serialize

  • [x] [ds.store.serialize](https://github.com/emberjs/data/commit/2b1cc7fca2a2afc3ab5ad842c23dc41be1963d23) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2757

[FEATURE] ds-check-should-serialize-relationships PR

  • [x] [ds.serializer.private-should-serialize-has-many](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/json.js#L849-L852) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2756

[FEATURE] ds-payload-type-hooks

  • [x] [ds.json-api-serializer.deprecated-model-name-for-relationship](https://github.com/emberjs/data/commit/1521d5af71b342b718e0f3ca3a716e9387be9633) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2769
  • [x] [ds.json-api-serializer.deprecated-model-name-for-resource](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/json-api.js#L220-L223) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2769
  • [ ] [ds.json-api-serializer.deprecated-model-name-for-polymorphic-type](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/json-api.js#L362-L365)
  • [x] [ds.json-api-serializer.deprecated-payload-type-for-model](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/json-api.js#L497-L500) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2769
  • [x] [ds.json-api-serializer.deprecated-payload-type-for-belongs-to](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/json-api.js#L557-L560) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2769
  • [x] [ds.json-api-serializer.deprecated-payload-type-for-has-many](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/json-api.js#L609-L612) (:lock: @heroiceric) https://github.com/emberjs/website/pull/2769
  • [ ] [ds.json-serializer.deprecated-type-for-polymorphic-relationship](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/json.js#L618-L621)
  • [ ] [ds.rest-serializer.deprecated-model-name-for-polymorphic-type](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/rest.js#L214-L217)
  • [ ] [ds.rest-serializer.deprecated-model-name-for-polymorphic-type](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/rest.js#L828-L831)
Deprecations that need to be added
  • [ ] [JSONAPISerializer#modelNameFromPayloadKey](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/json-api.js#L387-L390)
  • [ ] [JSONAPISerializer#payloadKeyFromModelName](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/json-api.js#L403-L405)
  • [ ] [JSONSerializer#modelNameFromPayloadKey](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/json.js#L722-L724)
  • [ ] [JSONSerializer#payloadKeyFromModelName](https://github.com/emberjs/data/blob/bc9a659998267b7a5b0f6d1a0f5f8be673819368/addon/serializers/json-api.js#L403-L405)

Most helpful comment

Incoming PR for 2.11's deprecations.

All 7 comments

Just did some work on 2.6's ds.serializer.normalize-hash-deprecated. https://github.com/emberjs/website/pull/2742

Incoming PR for 2.7's ember-data.global-ds.

Incoming PR for 2.11's deprecations.

@romulomachado y u so awesomez?

@runspired


Thanks for getting the ball rolling @romulomachado! 馃檶

I believe I can categorize this as:

  • completed (for the most part)
  • unnecessary (for removed feature flags)
  • too late (for things now removed in 3.x)
Was this page helpful?
0 / 5 - 0 ratings