Skip to content

Commit

Permalink
Merge pull request #12481 from toddjordan/release-1-13
Browse files Browse the repository at this point in the history
[BUGFIX release-1-13] Add deprecation options to some 1.13 deprecations
  • Loading branch information
mixonic committed Nov 5, 2015
2 parents 33df9d9 + f87aaaa commit a7a5271
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 deletions.
8 changes: 6 additions & 2 deletions packages/container/lib/registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ Registry.prototype = {
Ember.assert('Create a container on the registry (with `registry.container()`) before calling `lookup`.', this._defaultContainer);

if (instanceInitializersFeatureEnabled) {
Ember.deprecate('`lookup` was called on a Registry. The `initializer` API no longer receives a container, and you should use an `instanceInitializer` to look up objects from the container.', false, { url: "http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers" });
Ember.deprecate('`lookup` was called on a Registry. The `initializer` API no longer receives a container, and you should use an `instanceInitializer` to look up objects from the container.',
false,
{ id: 'container.calling-lookup-from-registry', until: '2.0.0', url: "http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers" });
}

return this._defaultContainer.lookup(fullName, options);
Expand All @@ -196,7 +198,9 @@ Registry.prototype = {
Ember.assert('Create a container on the registry (with `registry.container()`) before calling `lookupFactory`.', this._defaultContainer);

if (instanceInitializersFeatureEnabled) {
Ember.deprecate('`lookupFactory` was called on a Registry. The `initializer` API no longer receives a container, and you should use an `instanceInitializer` to look up objects from the container.', false, { url: "http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers" });
Ember.deprecate('`lookupFactory` was called on a Registry. The `initializer` API no longer receives a container, and you should use an `instanceInitializer` to look up objects from the container.',
false,
{ id: 'container.calling-lookupfactory-from-registry', until: '2.0.0', url: "http://emberjs.com/guides/deprecations#toc_deprecate-access-to-instances-in-initializers" });
}

return this._defaultContainer.lookupFactory(fullName);
Expand Down
3 changes: 2 additions & 1 deletion packages/ember-application/lib/utils/validate-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export default function validateType(resolvedType, parsedName) {
`property set to true. You registered ${resolvedType} as a ${parsedName.type} ` +
`factory. Either add the \`${factoryFlag}\` property to this factory or ` +
`extend from ${expectedType}.`,
resolvedType[factoryFlag]
resolvedType[factoryFlag],
{ id: 'ember-application.validate-type', until: '3.0.0' }
);
} else {
Ember.assert(
Expand Down
4 changes: 3 additions & 1 deletion packages/ember-runtime/lib/controllers/array_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ export default ArrayProxy.extend(ControllerMixin, SortableMixin, {
},

init() {
Ember.deprecate(arrayControllerDeprecation, this.isGenerated, { url: 'http://emberjs.com/guides/deprecations#toc_arraycontroller' });
Ember.deprecate(arrayControllerDeprecation,
this.isGenerated,
{ id: 'ember-runtime.array-controller', until: '2.0.0', url: 'http://emberjs.com/guides/deprecations#toc_arraycontroller' });

this._super(...arguments);
this._subControllers = [];
Expand Down
4 changes: 3 additions & 1 deletion packages/ember-runtime/lib/controllers/object_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export var objectControllerDeprecation = 'Ember.ObjectController is deprecated,
export default ObjectProxy.extend(ControllerMixin, {
init() {
this._super();
Ember.deprecate(objectControllerDeprecation, this.isGenerated);
Ember.deprecate(objectControllerDeprecation,
this.isGenerated,
{ id: 'ember-runtime.object-controller', until: '2.0.0' });
}
});
4 changes: 3 additions & 1 deletion packages/ember-views/lib/views/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ var Component = View.extend(TargetActionSupport, ComponentTemplateDeprecation, {
*/
template: computed({
get() {
Ember.deprecate(`Accessing 'template' in ${this} is deprecated. To determine if a block was specified to ${this} please use '{{#if hasBlock}}' in the components layout.`);
Ember.deprecate(`Accessing 'template' in ${this} is deprecated. To determine if a block was specified to ${this} please use '{{#if hasBlock}}' in the components layout.`,
false,
{ id: 'ember-views.accessing-template', until: '2.0.0' });

return get(this, '_template');
},
Expand Down
12 changes: 9 additions & 3 deletions packages/ember-views/lib/views/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1345,15 +1345,21 @@ var View = CoreView.extend(
scheduleRevalidate(node, label, manualRerender) {
if (node && !this._dispatching && node.guid in this.env.renderedNodes) {
if (manualRerender) {
Ember.deprecate(`You manually rerendered ${label} (a parent component) from a child component during the rendering process. This rarely worked in Ember 1.x and will be removed in Ember 2.0`);
Ember.deprecate(`You manually rerendered ${label} (a parent component) from a child component during the rendering process. This rarely worked in Ember 1.x and will be removed in Ember 2.0`,
false,
{ id: 'ember-views.manual-parent-rerender', until: '3.0.0' });
} else {
Ember.deprecate(`You modified ${label} twice in a single render. This was unreliable in Ember 1.x and will be removed in Ember 2.0`);
Ember.deprecate(`You modified ${label} twice in a single render. This was unreliable in Ember 1.x and will be removed in Ember 2.0`,
false,
{ id: 'ember-views.render-double-modify', until: '3.0.0' });
}
run.scheduleOnce('render', this, this.revalidate);
return;
}

Ember.deprecate(`A property of ${this} was modified inside the ${this._dispatching} hook. You should never change properties on components, services or models during ${this._dispatching} because it causes significant performance degradation.`, !this._dispatching);
Ember.deprecate(`A property of ${this} was modified inside the ${this._dispatching} hook. You should never change properties on components, services or models during ${this._dispatching} because it causes significant performance degradation.`,
!this._dispatching,
{ id: 'ember-views.dispatching-modify-property', until: '3.0.0' });

if (!this.scheduledRevalidation || this._dispatching) {
this.scheduledRevalidation = true;
Expand Down

0 comments on commit a7a5271

Please sign in to comment.