-
-
Notifications
You must be signed in to change notification settings - Fork 71
Add deprecation guides for ComputedProperties #1412
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for ember-deprecations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
It created a second property that reflected another property's value. | ||
|
||
## Migration | ||
Prefer direct access to the original tracked state, or use a simple getter and setter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alias
could point to a computed property, a getter, or really anything so this may need to describe how make sure they work going forward.
``` | ||
After: | ||
```js | ||
class Cart { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs reactivity
import ComputedProperty from '@ember/object/computed'; | ||
// rarely used directly | ||
``` | ||
After: Remove the import; refactor any custom meta-programming to simple getters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think custom ComputedProperties weren't rare.
``` | ||
After: | ||
```js | ||
import { isEmpty } from '@ember/utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ember/utils
has a deprecation RFC that has not landed https://github.com/emberjs/rfcs/blob/master/text/0334-deprecate-ember-utils.md?plain=1
No description provided.