-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] Updates @Tracked to match the Tracked Properties RFC
Updates @Tracked to be a classic decorator as well as a standard native decorator, removes the ability to decorator native getters, and adds more tests for various situations and updates the existing tests. One thing to note is that users can still provide getters/setters to classic classes via tracked: ```js import EmberObject from '@ember/object'; import { tracked } from '@glimmer/tracking'; const Person = EmberObject.extend({ firstName: tracked({ value: 'Tom' }), lastName: tracked({ value: 'Dale' }), fullName: tracked({ get() { return `${this.firstName} ${this.lastName}`; }, }), }); ``` The reasoning behind this is there is no way to do this currently, and it allows us to match behavior between native/classic exactly. Alternatively we could expose the native descriptor decorator that is internal only right now, but unfortunately `computed` will not be able to fill this role since it _requires_ use of `Ember.set`, where native getters/setters do not.
- Loading branch information
Chris Garrett
committed
Feb 6, 2019
1 parent
df39f05
commit 93b8039
Showing
11 changed files
with
445 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.