Skip to content

Revert "cache option for computed properties." #728

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

Merged
merged 3 commits into from
Jan 26, 2017

Conversation

kazupon
Copy link
Member

@kazupon kazupon commented Jan 25, 2017

@frankdiox
From #722

I think the cache options works in Vue 2 but I could not find any information in the docs.
Is it just a documentation issue or was omitted on purpose for some reason? Thanks.

We merged at #722, but I'll revert it due to not support cache: false for Vue 2 or later.
We can realize same as cache: false with methods.
For this reasons, cache: false explanation intentionally was removed it from Vue 2 docs.

/cc @yyx990803 @chrisvfritz
Please comment if you have something unsatisfactory.

@chrisvfritz chrisvfritz merged commit 8e5107d into master Jan 26, 2017
@frandiox
Copy link
Contributor

@kazupon Since cache: false works in 2.1.4, I guess you mean that it will be removed at some point? I'm wrapping Custom Elements inside Vue components and need to get some element properties that are not reactive. Methods can do the same but it would change the API.

@chrisvfritz
Copy link
Contributor

@frankdiox There are no plans to remove it in 2.x, but it will very likely be gone in v3 (whenever that might be). Please feel free to share more information about your use case though. Plans for the API do often change after learning more about how people are using specific features.

@kazupon
Copy link
Member Author

kazupon commented Jan 26, 2017

@frankdiox
Yes @chrisvfritz said about it. If you have some use-cases, please share more information. :)

@frandiox
Copy link
Contributor

frandiox commented Jan 26, 2017

@chrisvfritz @kazupon Thanks a lot! There are workarounds for my case so I guess cache: false is not a decisive feature. Here is some info:

I have some CustomElements (sliding menu, switch, etc.) that have methods and properties. The properties can be modified programatically by the user in some cases or just by interacting with the element with clicks or drag (e.g. myDialog.isShown). I'm now wrapping these elements within Vue Components (and making a Vue-like API to interact with them) and it was very handy to directly map these element properties to the Vue Component as computed properties (so myVueComponent.$el.pages becomes myVueComponent.pages). I guess I can modify the API and use methods or take the initial value and listen for any modification whenever possible, but I just thought cache: false made this very simple.

By the way, great job with Vue.js and its API guys, it's awesome :)

kazupon added a commit to vuejs/jp.vuejs.org that referenced this pull request Jan 26, 2017
@kazupon kazupon deleted the revert-722-patch-1 branch January 26, 2017 09:31
kazupon added a commit to kazupon/vuejs.org that referenced this pull request Jan 26, 2017
chrisvfritz pushed a commit that referenced this pull request Jan 27, 2017
* add cache option deprecated section

ref: #728
related: 722

* Slight tweak to cache: false deprecation warning
dingyiming added a commit to volksbright/document-standard-vue that referenced this pull request Jan 29, 2017
* vuejs.org-master:
  update instructions about where to open the javascript console
  Fix bug in store pattern example (vuejs#732)
  add cache option deprecated section (vuejs#731)
  Warn about modifying instance in hooks (vuejs#723)
  Revert "`cache` option for computed properties." (vuejs#728)
  update updated lifecycle hook description
  fix fuzzy matching when match already exists
  Update smooth-scroll.js (vuejs#726)

# Conflicts:
#	src/v2/api/index.md
#	src/v2/guide/index.md
#	src/v2/guide/instance.md
#	src/v2/guide/migration.md
#	themes/vue/source/js/common.js
#	themes/vue/source/js/smooth-scroll.min.js
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.

4 participants