Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecations scheduled for 3.0 #5411

Merged
merged 2 commits into from
Apr 6, 2018
Merged
Show file tree
Hide file tree
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: 1 addition & 21 deletions addon/-private/system/model/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ArrayProxy from '@ember/array/proxy';
import { set, get, computed } from '@ember/object';
import { makeArray, A } from '@ember/array';
import MapWithDefault from '../map-with-default';
import { deprecate, warn } from '@ember/debug';
import { warn } from '@ember/debug';

/**
@module ember-data
Expand Down Expand Up @@ -86,25 +86,6 @@ import { deprecate, warn } from '@ember/debug';
@uses Ember.Evented
*/
export default ArrayProxy.extend(Evented, {
/**
Register with target handler

@method registerHandlers
@param {Object} target
@param {Function} becameInvalid
@param {Function} becameValid
@deprecated
*/
registerHandlers(target, becameInvalid, becameValid) {
deprecate(
`Record errors will no longer be evented.`, false, {
id: 'ds.errors.registerHandlers',
until: '3.0.0'
});

this._registerHandlers(target, becameInvalid, becameValid);
},


/**
Register with target handler
Expand All @@ -117,7 +98,6 @@ export default ArrayProxy.extend(Evented, {
this.on('becameValid', target, becameValid);
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @stefanpenner tests broke when I tried to remove _registerHandlers, suspect it's just some tests that need updating but would love you to poke at this if you have a moment.



/**
@property errorsByAttributeName
@type {MapWithDefault}
Expand Down
71 changes: 1 addition & 70 deletions addon/-private/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { typeOf, isPresent, isNone } from '@ember/utils';
import Ember from 'ember';
import { InvalidError } from '../adapters/errors';
import { instrument } from 'ember-data/-debug';
import { assert, deprecate, warn, inspect } from '@ember/debug';
import { assert, warn, inspect } from '@ember/debug';
import { DEBUG } from '@glimmer/env';
import Model from './model/model';
import normalizeModelName from "./normalize-model-name";
Expand Down Expand Up @@ -256,31 +256,6 @@ Store = Service.extend({
*/
adapter: '-json-api',

/**
Returns a JSON representation of the record using a custom
type-specific serializer, if one exists.

The available options are:

* `includeId`: `true` if the record's ID should be included in
the JSON representation

@method serialize
@private
@deprecated
@param {DS.Model} record the record to serialize
@param {Object} options an options hash
*/
serialize(record, options) {
deprecate('Use of store.serialize is deprecated, use record.serialize instead.', false, {
id: 'ds.store.serialize',
until: '3.0'
});

let snapshot = record._internalModel.createSnapshot();
return snapshot.serialize(options);
},

/**
This property returns the adapter, after resolving a possible
string key.
Expand Down Expand Up @@ -1677,11 +1652,6 @@ Store = Service.extend({
this.recordArrayManager._didUpdateAll(modelName);
},

didUpdateAll(modelName) {
deprecate('didUpdateAll was documented as private and will be removed in the next version of Ember Data.', false, { id: 'ember-data.didUpdateAll', until: '2.17.0' });
return this._didUpdateAll(modelName);
},

/**
This method returns a filtered array that contains all of the
known records for a given type in the store.
Expand Down Expand Up @@ -1827,24 +1797,6 @@ Store = Service.extend({
return promiseArray(promise.then(() => array, null, `DS: Store#filter of ${normalizedModelName}`));
},

/**
This method has been deprecated and is an alias for store.hasRecordForId, which should
be used instead.

@deprecated
@method recordIsLoaded
@param {String} modelName
@param {string} id
@return {boolean}
*/
recordIsLoaded(modelName, id) {
deprecate(`Use of recordIsLoaded is deprecated, use hasRecordForId instead.`, false, {
id: 'ds.store.recordIsLoaded',
until: '3.0'
});
return this.hasRecordForId(modelName, id);
},


// ..............
// . PERSISTING .
Expand Down Expand Up @@ -2612,11 +2564,6 @@ Store = Service.extend({
return internalModel;
},

buildInternalModel(modelName, id, data) {
deprecate('buildInternalModel was documented as private and will be removed in the next version of Ember Data.', false, { id: 'ember-data.buildInternalModel', until: '2.17.0' });
return this._buildInternalModel(modelName, id, data);
},

//Called by the state machine to notify the store that the record is ready to be interacted with
recordWasLoaded(record) {
this.recordArrayManager.recordWasLoaded(record);
Expand Down Expand Up @@ -2785,22 +2732,6 @@ Store = Service.extend({
return serializer;
},

lookupAdapter(name) {
deprecate(`Use of lookupAdapter is deprecated, use adapterFor instead.`, false, {
id: 'ds.store.lookupAdapter',
until: '3.0'
});
return this.adapterFor(name);
},

lookupSerializer(name) {
deprecate(`Use of lookupSerializer is deprecated, use serializerFor instead.`, false, {
id: 'ds.store.lookupSerializer',
until: '3.0'
});
return this.serializerFor(name);
},

willDestroy() {
this._super(...arguments);
this._pushedInternalModels = null;
Expand Down
31 changes: 0 additions & 31 deletions tests/unit/store/serialize-test.js

This file was deleted.