Issue #11493 mentioned that the following deprecation is not mentioned in the deprecations guide:
DEPRECATION: A property of <Ember.OutletView:ember1021> was modified inside the didInsertElement hook. You should never change properties on components, services or models during didInsertElement because it causes significant performance degradation.
I'd just like to request that someone who's knowledgeable about the reasons behind this deprecation add it to the guide (or at least, in the meantime, explain it below).
Can you confirm that this is on the list of deprecations pending addition to the deprecations guide? The list is in a large checklist issue in the emberjs/website issues.
@rwjblue it is not in the deprecations to add issue. I made a comment to request it to be added here
For handling that deprecation, I am currently using this implementation:
myMethod: function () {
Ember.run.schedule('afterRender', this, function () {
// some code
});
}.on('init')
instead of this:
myMethod: function () {
// some code
}.on('didInsertElement')
in some cases.
thanks @furkanayhan! that's the same solution I'm currently using and it definitely removes the deprecation. I'm interested to hear the reasoning behind this deprecation as well as if there are any other "officially" recommended alternatives.
Added to the list, thanks!
Most helpful comment
For handling that deprecation, I am currently using this implementation:
instead of this:
in some cases.