Skip to content

Commit

Permalink
Merge pull request #5411 from runspired/remove-deprecations
Browse files Browse the repository at this point in the history
Remove deprecations scheduled for 3.0
  • Loading branch information
runspired authored Apr 6, 2018
2 parents 9464ed0 + 1d0e9f2 commit 49f3b02
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 122 deletions.
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);
},


/**
@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 @@ -254,31 +254,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 @@ -1676,11 +1651,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 @@ -1826,24 +1796,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 @@ -2611,11 +2563,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 @@ -2784,22 +2731,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.

0 comments on commit 49f3b02

Please sign in to comment.