Skip to content

Add Vuex 2.0 Deprecations (lower priority, as upgrading to Vuex 2.0 is optional for Vue 2) #2

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

Closed
7 tasks
chrisvfritz opened this issue Sep 17, 2016 · 9 comments

Comments

@chrisvfritz
Copy link
Contributor

chrisvfritz commented Sep 17, 2016

Patterns:

  • vuex: { should be replaced by action/mutation/getter/state helpers on methods and computed properties
  • store.watch('XXX', ...) -> store.watch(state => state.XXX, ...) The 1st argument of watch should be the function that returns sub state tree.
  • middlewares -> plugins
  • store.dispatch -> store.commit mutations are now triggered by commit method.
  • The arguments of store.dispatch and store.commit is no longer variadic. It now accepts a single payload value as the 2nd argument.
  • silent flag for silent dispatch is now declared in 3rd argument options object.
  • payload arguments changes (see Add Vuex 2.0 Deprecations (lower priority, as upgrading to Vuex 2.0 is optional for Vue 2) #2 (comment))
@ktsn
Copy link
Member

ktsn commented Sep 18, 2016

List updated 😄

@chrisvfritz
Copy link
Contributor Author

@ktsn Thanks! These look great!

@chrisvfritz
Copy link
Contributor Author

@ktsn How would you feel about having all the migration info in the main guide, but on a separate Migration from vuex 1.x page? My thinking is it would make it simple to keep the same format for all the migrations and people could look in only one place while migrating. Then it could be linked to from the vuex docs.

@ktsn
Copy link
Member

ktsn commented Sep 20, 2016

Sounds good to me.

@chrisvfritz chrisvfritz changed the title Add Vuex Regressions Add Vuex Deprecations Sep 24, 2016
@mckaydavis
Copy link

mckaydavis commented Oct 3, 2016

For the vuex: {...} deprecation warnings, please be sure to suggest use of the mapGetters, mapActions, mapMutations, and mapState helper functions. reference: vuejs/vuex#236

@chrisvfritz
Copy link
Contributor Author

@mckaydavis Planning on it. 😃 👍

@TheDutchCoder
Copy link

TheDutchCoder commented Oct 7, 2016

Can you add the change in actions as well?
Vuex2 only takes 1 payload argument, whereas Vuex1 could take any amount of arguments.

Vuex 1 Example:

export const addToCart = ({ dispatch, state }, product, foo, bar) => {
  // Use product, foo, bar.
}

Vuex 2 Example:

export const addToCart = ({ commit, state }, payload) => {
   // Use payload.product, payload.foo, payload.bar.
}

@chrisvfritz
Copy link
Contributor Author

@TheDutchCoder Yes, we should be able to catch that!

@chrisvfritz chrisvfritz changed the title Add Vuex Deprecations Add Vuex 2.0 Deprecations (lower priority, as upgrading to Vuex 2.0 is optional for Vue 2) Oct 13, 2016
@chrisvfritz
Copy link
Contributor Author

Closing, as the tool already migrates people to a minimal version of Vuex that allows them to use Vue 2, which is the primary purpose of the tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants