You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defineProperty is private API, but we suggest it as a way to resolve a deprecation. We should give more guidance for alternatives:
Edward Faulkner’s comments from Slack:
it depends why they’re using it.
If they’re trying to use it as a polyfill for the native Object.defineProperty, they should just use that directly. Every browser Ember supports has that, and Ember itself depends on it.
If they’re trying to make computed properties on a plain old Javascript object, they should not do that. They should either make the object an Ember.Object and declare computed properties in the normal way, or they should keep the object as a POJO and use Object.defineProperty to make a native getter.
If they’re creating computed properties and can’t do it the normal way because they don’t know what the dependent keys are until after construction, they should do their own dependency observation with addObserver and notifyPropertyChange. This is an advanced thing to be doing, more likely in an addon that’s trying to present a whole new API on top of Ember than in an app.
The text was updated successfully, but these errors were encountered:
defineProperty is private API, but we suggest it as a way to resolve a deprecation. We should give more guidance for alternatives:
Edward Faulkner’s comments from Slack:
it depends why they’re using it.
Object.defineProperty
, they should just use that directly. Every browser Ember supports has that, and Ember itself depends on it.addObserver
andnotifyPropertyChange
. This is an advanced thing to be doing, more likely in an addon that’s trying to present a whole new API on top of Ember than in an app.The text was updated successfully, but these errors were encountered: