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

Difference with "@ember/object/computed" functions #19

Open
YoranBrondsema opened this issue Aug 5, 2020 · 2 comments
Open

Difference with "@ember/object/computed" functions #19

YoranBrondsema opened this issue Aug 5, 2020 · 2 comments

Comments

@YoranBrondsema
Copy link

It's unclear to me how this module compares to the @ember/object/computed set of functions. Like what's the difference between the reads function from macro-decorators and from @ember/object/computed? It seems like they're both used the same way, as a decorator:

import { reads } from '@ember/object/computed';
import { reads } from 'macro-decorators';

@reads('foo.bar') baz;

It would be good to document this in the README: what the differences are and why one should be used over the other. I don't mind writing a PR for that but I want to understand it myself first :-)

@jordpo
Copy link

jordpo commented Aug 6, 2020

@YoranBrondsema good question. From what I understand it has to do with the different reactivity models between Octane and Classical. Here is the related Ember RFC issue emberjs/rfcs#536

@YoranBrondsema
Copy link
Author

Thanks for pointing to the RFC, that explains it. I understand that @pzuraq is maybe hesitant to mention Ember at all in the docs for macro-decorators since the library aims to be framework-agnostic. But I think it could be useful to add a short blurb on the README for Ember users, cause I imagine most users of this library are Ember users (for now). The blurb would say something like:

Ember.js users: how do these decorators compare to @ember/object/computed functions?

The functions in @ember/object/computed are based on computed properties. This system has been replaced by tracked properties in Ember Octane. Eventually, computed properties will disappear all completely from the Ember.js framework. So we encourage you to use the macros from macro-decorators rather than from @ember/object/computed.

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

2 participants