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

proxiable-mixin triggers didInsertElement property changed deprecation/performance warning. #237

Closed
DanChadwick opened this issue Dec 6, 2015 · 3 comments

Comments

@DanChadwick
Copy link
Contributor

Using Ember 2.1.0, I receive:

DEPRECATION: A property of <in-control@view:-outlet::ember387> was modified inside the didInsertElement hook. You should never change properties on components, services or models during didInsertElement because it causes significant performance degradation. [deprecation id: ember-views.dispatching-modify-property]

This seems to be caused by this in proxiable-mixin.js:

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

    var proxy = this.nearestOfType(ProxyMixin);
    if (proxy) {
      proxy.register(this); // <--------------- culprit
    }
  },

I'm rather new to Ember and ember-paper, so I don't have a suggestion for how to address this. Maybe there is there a way to defer this until after didInsertElement without compromising proper functioning?

@kgautreaux
Copy link

You may be correct, but this still open issue (emberjs/ember.js/issues/11505) from June of 2015 indicates that the warning links to the wrong view and always blames the didInsertElement hook when it could be any code that changes component state during render of a component.

In Kris Selden's example he uses the didRender hook but the deprecation warning is still the same. This is on the deprecation documentation todo list (emberjs/ember.js/issues/12290 -> emberjs/website/issues/2256) so if you learn a great deal about it you could perhaps land a PR for the ember website deprecation guide or even ember itself. Hope this saves you some spelunking.

@canufeel
Copy link
Contributor

canufeel commented Jan 9, 2016

@DanChadwick #199 fixes this.

@DanChadwick
Copy link
Contributor Author

This is fixed in wip/v1.0.0 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants