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

[DOC beta] Update deprecations in ember-views package #11848

Merged
merged 1 commit into from
Jul 21, 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
2 changes: 1 addition & 1 deletion packages/ember-views/lib/compat/attrs-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ let AttrsProxyMixin = {
if (attrs && key in attrs) {
// do not deprecate accessing `this[key]` at this time.
// add this back when we have a proper migration path
// Ember.deprecate(deprecation(key));
// Ember.deprecate(deprecation(key), { id: 'ember-views.', until: '3.0.0' });
let possibleCell = get(attrs, key);

if (possibleCell && possibleCell[MUTABLE_CELL]) {
Expand Down
7 changes: 5 additions & 2 deletions packages/ember-views/lib/compat/metamorph_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ export var _Metamorph = Mixin.create({
init() {
this._super.apply(this, arguments);
Ember.deprecate('Supplying a tagName to Metamorph views is unreliable and is deprecated.' +
' You may be setting the tagName on a Handlebars helper that creates a Metamorph.', !this.tagName);
' You may be setting the tagName on a Handlebars helper that creates a Metamorph.',
!this.tagName,
{ id: 'ember-views.metamorph-tag-name', until: '2.4.0' });

Ember.deprecate(`Using ${this.__metamorphType} is deprecated.`);
Ember.deprecate(`Using ${this.__metamorphType} is deprecated.`, false,
{ id: 'ember-views.metamorph', until: '2.4.0' });
}
});

Expand Down
7 changes: 5 additions & 2 deletions packages/ember-views/lib/compat/render_buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ export function renderComponentWithBuffer(component, contextualElement, dom) {
*/

export default function RenderBuffer(domHelper) {
Ember.deprecate('`Ember.RenderBuffer` is deprecated.');
Ember.deprecate('`Ember.RenderBuffer` is deprecated.', false,
{ id: 'ember-views.render-buffer', until: '3.0.0' });
this.buffer = null;
this.childViews = [];
this.attrNodes = [];
Expand Down Expand Up @@ -596,7 +597,9 @@ RenderBuffer.prototype = {
if (this._outerContextualElement === undefined) {
Ember.deprecate('The render buffer expects an outer contextualElement to exist.' +
' This ensures DOM that requires context is correctly generated (tr, SVG tags).' +
' Defaulting to document.body, but this will be removed in the future');
' Defaulting to document.body, but this will be removed in the future',
false,
{ id: 'ember-views.render-buffer-contextual-element', until: '3.0.0' });
this.outerContextualElement = document.body;
}
return this._outerContextualElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export default Mixin.create({
delete props['template'];
}

Ember.deprecate('Do not specify ' + deprecatedProperty + ' on a Component, use ' + replacementProperty + ' instead.', !deprecatedProperty);
Ember.deprecate('Do not specify ' + deprecatedProperty + ' on a Component, use ' + replacementProperty + ' instead.',
!deprecatedProperty,
{ id: 'ember-views.component-deprecated-template-layout-properties', until: '3.0.0' });
}
});
7 changes: 5 additions & 2 deletions packages/ember-views/lib/mixins/legacy_view_support.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ var LegacyViewSupport = Mixin.create({
@private
*/
nearestChildOf(klass) {
Ember.deprecate('nearestChildOf has been deprecated.');
Ember.deprecate('nearestChildOf has been deprecated.', false,
{ id: 'ember-views.nearest-child-of', until: '3.0.0' });

var view = get(this, 'parentView');

Expand All @@ -90,7 +91,9 @@ var LegacyViewSupport = Mixin.create({
@private
*/
nearestInstanceOf(klass) {
Ember.deprecate('nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType.');
Ember.deprecate('nearestInstanceOf is deprecated and will be removed from future releases. Use nearestOfType.',
false,
{ id: 'ember-views.nearest-instance-of', until: '3.0.0' });
var view = get(this, 'parentView');

while (view) {
Expand Down
4 changes: 3 additions & 1 deletion packages/ember-views/lib/mixins/view_state_support.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { Mixin } from 'ember-metal/mixin';

var ViewStateSupport = Mixin.create({
transitionTo(state) {
Ember.deprecate('Ember.View#transitionTo has been deprecated, it is for internal use only');
Ember.deprecate('Ember.View#transitionTo has been deprecated, it is for internal use only',
false,
{ id: 'ember-views.view-transition-to', until: '2.4.0' });
this._transitionTo(state);
},

Expand Down
4 changes: 3 additions & 1 deletion packages/ember-views/lib/system/build-component-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ function tagNameFor(view) {

if (tagName !== null && typeof tagName === 'object' && tagName.isDescriptor) {
tagName = get(view, 'tagName');
Ember.deprecate('In the future using a computed property to define tagName will not be permitted. That value will be respected, but changing it will not update the element.', !tagName);
Ember.deprecate('In the future using a computed property to define tagName will not be permitted. That value will be respected, but changing it will not update the element.',
!tagName,
{ id: 'ember-views.computed-tag-name', until: '2.0.0' });
}

if (tagName === null || tagName === undefined) {
Expand Down
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('_template', {
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.component-template-get', until: '3.0.0' });

return get(this, '_template');
},
Expand Down
15 changes: 12 additions & 3 deletions packages/ember-views/lib/views/container_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,18 @@ var ContainerView = View.extend(MutableArray, {
willWatchProperty(prop) {
Ember.deprecate(
'ContainerViews should not be observed as arrays. This behavior will change in future implementations of ContainerView.',
!prop.match(/\[]/) && prop.indexOf('@') !== 0
!prop.match(/\[]/) && prop.indexOf('@') !== 0,
{ id: 'ember-views.container-views-array-observed', until: '2.4.0' }
);
},

init() {
this._super(...arguments);

var userChildViews = get(this, 'childViews');
Ember.deprecate('Setting `childViews` on a Container is deprecated.', Ember.isEmpty(userChildViews));
Ember.deprecate('Setting `childViews` on a Container is deprecated.',
Ember.isEmpty(userChildViews),
{ id: 'ember-views.container-child-views', until: '2.4.0' });

// redefine view's childViews property that was obliterated
// 2.0TODO: Don't Ember.A() this so users disabling prototype extensions
Expand Down Expand Up @@ -305,7 +308,13 @@ var ContainerView = View.extend(MutableArray, {

export var DeprecatedContainerView = ContainerView.extend({
init() {
Ember.deprecate('Ember.ContainerView is deprecated.', !!Ember.ENV._ENABLE_LEGACY_VIEW_SUPPORT , { url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-containerview' });
Ember.deprecate('Ember.ContainerView is deprecated.',
!!Ember.ENV._ENABLE_LEGACY_VIEW_SUPPORT,
{
url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-containerview',
id: 'ember-views.container-view',
until: '2.4.0'
});
this._super.apply(this, arguments);
}
});
Expand Down
4 changes: 3 additions & 1 deletion packages/ember-views/lib/views/core_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ CoreView.reopenClass({

export var DeprecatedCoreView = CoreView.extend({
init() {
Ember.deprecate('Ember.CoreView is deprecated. Please use Ember.View.', false);
Ember.deprecate('Ember.CoreView is deprecated. Please use Ember.View.',
false,
{ id: 'ember-views.core-view', until: '2.4.0' });
this._super.apply(this, arguments);
}
});
Expand Down
8 changes: 7 additions & 1 deletion packages/ember-views/lib/views/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,13 @@ var Select = View.extend({
var DeprecatedSelect = Select.extend({
init() {
this._super(...arguments);
Ember.deprecate(`Ember.Select is deprecated. Consult the Deprecations Guide for a migration strategy.`, !!Ember.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-select' });
Ember.deprecate(`Ember.Select is deprecated. Consult the Deprecations Guide for a migration strategy.`,
!!Ember.ENV._ENABLE_LEGACY_VIEW_SUPPORT,
{
url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-select',
id: 'ember-views.select-deprecated',
until: '2.4.0'
});
}
});

Expand Down
24 changes: 19 additions & 5 deletions packages/ember-views/lib/views/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ function K() { return this; }
@submodule ember-views
*/

Ember.warn('The VIEW_PRESERVES_CONTEXT flag has been removed and the functionality can no longer be disabled.', Ember.ENV.VIEW_PRESERVES_CONTEXT !== false);
Ember.warn('The VIEW_PRESERVES_CONTEXT flag has been removed and the functionality can no longer be disabled.',
Ember.ENV.VIEW_PRESERVES_CONTEXT !== false,
{ id: 'ember-views.view-preserves-context-flag', until: '2.0.0' });

/**
Global hash of shared templates. This will automatically be populated
Expand Down Expand Up @@ -1334,15 +1336,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 Expand Up @@ -1525,7 +1533,13 @@ View.childViewsProperty = childViewsProperty;
var DeprecatedView = View.extend({
init() {
this._super(...arguments);
Ember.deprecate(`Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy.`, !!Ember.ENV._ENABLE_LEGACY_VIEW_SUPPORT, { url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-view' });
Ember.deprecate(`Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy.`,
!!Ember.ENV._ENABLE_LEGACY_VIEW_SUPPORT,
{
url: 'http://emberjs.com/deprecations/v1.x/#toc_ember-view',
id: 'ember-views.view-deprecated',
until: '2.4.0'
});
}
});

Expand Down