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

Backport PR 11983 to beta #12036

Merged
merged 2 commits into from
Aug 10, 2015
Merged

Backport PR 11983 to beta #12036

merged 2 commits into from
Aug 10, 2015

Conversation

ef4
Copy link
Contributor

@ef4 ef4 commented Aug 10, 2015

Per request by @rwjblue.

krisselden and others added 2 commits August 10, 2015 00:42
Breakup set method into a top level branching method that has 4 paths, readonly check/throw, clobber set, volatile set or normal set.

`volatile()` does not simply mean don’t cache, it means this value is inherently not observable and/or you need to manually notify/cache the value.

ArrayProxy is a good example, length is observable but has to be manually notified for NativeArray mixin, so ArrayProxy just delegates to the underlying array but doesn’t setup DKs or any notification since it is notified already by the mutation methods.

It is not an escape value for you not getting the correct DKs or it seems to solve some bug I can’t figure out.  It is not the equivalent of the old sprout core behavior and hasn’t been for a while.  If you have a dependency that does not fit into a DK, you can notifyPropertyChange() manually.

If you don’t understand the above you should not be using `volatile` it
has an extremely narrow use case.

Conflicts:
	packages/ember-metal/lib/chains.js
	packages/ember-metal/lib/computed.js

Cherry-picked from 4678ce9
rwjblue added a commit that referenced this pull request Aug 10, 2015
@rwjblue rwjblue merged commit 4589517 into beta Aug 10, 2015
@rwjblue rwjblue deleted the backport-pr-11983 branch August 10, 2015 19:31
@rwjblue
Copy link
Member

rwjblue commented Aug 10, 2015

Thank you!

@denzo
Copy link

denzo commented Aug 15, 2015

Also, "set" does not return the value of the object itself anymore. Instead it returns the value being set. Thus chaining is no longer possible. Was that done intentionally?

@rwjblue
Copy link
Member

rwjblue commented Aug 15, 2015

@denzo - Yes, that was intentional. See related issue #12095.

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

Successfully merging this pull request may close these issues.

5 participants