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

[BUGFIX release-1-13] Add deprecation options to some 1.13 deprecations #12481

Merged
merged 1 commit into from
Nov 5, 2015
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
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' });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the 2.0 release these were marked 3.0.0, even though in the text of the message it says its going away in 2.0. Should I update the message too?

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

it is already changed in master, and should be changed to 3.0 here

`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 3.0`,

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Also right below

} 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