Start Date: 2018-05-01 Relevant Team(s): Ember Data RFC PR: https://github.com/emberjs/rfcs/pull/329 Tracking: https://github.com/emberjs/rfc-tracking/issues/21
Ember.Evented functionality on
DS.PromiseManyArray will be
deprecated and eventually removed in a future release. This includes
the following methods from the
trigger. Additionally the
following lifecycle methods on
DS.Model will also be deprecated:
The use of
Ember.Evented is mostly a legacy from the pre 1.0 days of
Ember Data when events were a core part of the Ember Data programming
model. Today there are better ways to do everything that once needed
events. Removing the usage of the
Ember.Evented mixin will make it
easier for Ember Data to eventually transition to using native ES2015
Data must support in the long term.
Ember.Evented mixin will be scheduled to be removed from the
following classes in a future Ember Data release:
trigger methods will be trigger a
deprecation warning when called and will be completly in a future
Ember Data release.
A special deprecation will be logged when users of a
DS.adapterPopulatedRecordArray attempt to listen to the
event. This depecations will prompt users to use a computed property
instead of the
DS.Model will also recieve deprecation warnings when a model is
defined with the following methods:
When a model is instantiated for the first time with any of these methods a deprecation warning will be logged notifiying the user that this method will be deprecated and the user should use an computed or overide the model's init method instead.
Today we do not teach the use of any of the Ember Data lifecycle events in the guides. They are referenced in the API docs but they will be updated to mark the APIs as deprecated and show alternative examples of how to achieve the same functionality using a non event pattern.
The deprecation guide app will be updated with examples showing how to migrate away from an evented pattern to using a computed or imperative method to achieve the same results.
The drawback to making this change is existing code that takes advantage of the Ember Data lifecycle events will need to be updated to use a different pattern.
We could leave the
Ember.Evented mixin on all of the Ember Data
objects that currently support it and continue to support this
interface for the foreseeable future. However, Ember Data itself
doesn't require these events internally. There is only one place in
DS.Error code that takes advantage of the
and that code can be easilly re-written to avoid