PackageTrack

npm

vuex

4.1.0vuejs/vuex

state management for Vue.js

Release timeline

62 releases since 2015
20152026

One column per quarter.

Releases

  1. 4.1.014 Oct 2022
    Release notes

    Vue Core Version Requirement Change

    This release contains an important fix (#1883) that relies on the effectScope API from Vue core, which is only available in Vue 3.2+.

    Bug Fixes

    4.0.2 (2021-06-17)

    Bug Fixes

    • devtools: fix no getters displayed on root module + better getters inspector (#1986) (bc20295)
    • build: cjs build failing due to __VUE_PROD_DEVTOOLS__ defined (#1991) (#1992) (7151622)

    4.0.1 (2021-05-24)

    Features

    • dx: add devtools integration (#1949)
    Open source →
  2. 4.0.217 Jun 2021
    Release notes

    Bug Fixes

    • devtools: fix no getters displayed on root module + better getters inspector (#1986) (bc20295)
    • build: cjs build failing due to __VUE_PROD_DEVTOOLS__ defined (#1991) (#1992) (7151622)
    Open source →
    Additional notes

    v4.0.2 Latest

    Latest

    Compare

    Choose a tag to compare

    Open source →
  3. 4.0.124 May 2021
    Release notes

    Features

    • dx: add devtools integration (#1949)
    Open source →
    Additional notes

    v4.0.1

    Compare

    Choose a tag to compare

    Open source →
  4. 4.0.02 Feb 2021
    Release notes2 sources agree

    This is the official Vuex 4 release.

    The focus for Vuex 4 is compatibility. Vuex 4 supports Vue 3, and it provides the exact same API as Vuex 3, so users can reuse their existing Vuex code with Vue 3.

    There are a few breaking changes described in a later section, so please check them out.

    You can find basic usage with both Option and Composition API in the example directory.

    It's still released under next tag in NPM package as same as Vue 3. We're planning to remove next tag once Vue 3 is ready to remove it.

    There have been a lot of contribution to make Vuex 4 stable. Thank you all for your very much appreciated help. It wouldn't have been possible without this wonderful Vue community!

    Documentation

    To check out docs, visit next.vuex.vuejs.org.

    Breaking changes

    Installation process has changed

    To align with the new Vue 3 initialization process, the installation process of Vuex has changed.

    To create a new store instance, users are now encouraged to use the newly introduced createStore function.

    import { createStore } from 'vuex'
    
    export const store = createStore({
      state() {
        return {
          count: 1
        }
      }
    })

    Whilst this is not technically a breaking change, you may still use the new Store(...) syntax, we recommend this approach to align with Vue 3 and Vue Router 4.

    To install Vuex to a Vue instance, pass the store instance instead of Vuex.

    import { createApp } from 'vue'
    import { store } from './store'
    import App from './App.vue'
    
    const app = createApp(App)
    
    app.use(store)
    
    app.mount('#app')

    Bundles are now aligned with Vue 3

    The following bundles are generated to align with Vue 3 bundles:

    • vuex.global(.prod).js
      • For direct use with <script src="..."> in the browser. Exposes the Vuex global.
      • Global build is built as IIFE, and not UMD, and is only meant for direct use with <script src="...">.
      • Contains hard-coded prod/dev branches and the prod build is pre-minified. Use the .prod.js files for production.
    • vuex.esm-browser(.prod).js
      • For use with native ES module imports (including module supporting browsers via <script type="module">.
    • vuex.esm-bundler.js
      • For use with bundlers such as webpack, rollup and parcel.
      • Leaves prod/dev branches with process.env.NODE_ENV guards (must be replaced by bundler).
      • Does not ship minified builds (to be done together with the rest of the code after bundling).
    • vuex.cjs.js
      • For use in Node.js server-side rendering with require().

    Typings for ComponentCustomProperties

    Vuex 4 removes its global typings for this.$store within Vue Component to solve issue #994. When used with TypeScript, you must declare your own module augmentation.

    Place the following code in your project to allow this.$store to be typed correctly:

    // vuex-shim.d.ts
    
    import { ComponentCustomProperties } from 'vue'
    import { Store } from 'vuex'
    
    declare module '@vue/runtime-core' {
      // Declare your own store states.
      interface State {
        count: number
      }
    
      interface ComponentCustomProperties {
        $store: Store<State>
      }
    }

    createLogger function is exported from the core module

    In Vuex 3, createLogger function was exported from vuex/dist/logger but it's now included in the core package. You should import the function directly from vuex package.

    import { createLogger } from 'vuex'

    Bug Fixes Included Since 4.0.0-rc.2

    Open source →
    Additional notes

    v4.0.0

    Compare

    Choose a tag to compare

    Open source →
  5. 4.0.0-rc.225 Nov 2020pre-release
    Release notes2 sources agree

    Bug Fixes

    • fix getters stop working when component is destroyed (#1884) (c3a695e)
    • stop throwing an error on hasModule when parent does not exists (#1850) (f76d72d)

    Features

    • build: enable named esm module import on node.js >= 14 (4f4a909)
    Open source →
    Additional notes

    v4.0.0-rc.2

    Compare

    Choose a tag to compare

    Open source →
  6. 4.0.0-rc.130 Oct 2020pre-release
    Release notes

    Bug Fixes

    Features

    • types: adding logger type for logger plugin (#1853) (cb3198d)
    Open source →
    Additional notes

    Bug Fixes

    Features

    • types: adding logger type for logger plugin (#1853) (cb3198d)

    3.5.1 (2020-06-29)

    Open source →
    Additional notes

    v4.0.0-rc.1

    Compare

    Choose a tag to compare

    Open source →
  7. 4.0.0-beta.429 Jun 2020pre-release
    Release notes2 sources agree

    Bug Fixes

    • types: add missing logger.d.ts file to the package (#1789) (a477334)
    • warn when unregistering non existing module (#1786) (7cec79d)
    Open source →
    Additional notes

    v4.0.0-beta.4 Pre-release

    Pre-release

    Compare

    Choose a tag to compare

    Open source →
  8. 4.0.0-beta.329 Jun 2020pre-release
    Release notes

    Bug Fixes

    Features

    • include createLogger function in core export (afa566d)
    • include logger plugin to the core export (#1783) (04e2bd8)
    Open source →
    Additional notes

    v4.0.0-beta.3 Pre-release

    Pre-release

    Compare

    Choose a tag to compare

    Open source →
  9. 4.0.0-beta.211 May 2020pre-release
    Release notes

    Bug Fixes

    • types: add useStore function (#1736) #1739
    • build: fix iife build containing process.env.
    Open source →
  10. 4.0.0-beta.125 Apr 2020pre-release
    Release notes

    Features

    • Added TypeScript support.

    Breaking Changes

    Bundles are now aligned with Vue 3

    The bundles are generated as below to align with Vue 3 bundles.

    • vuex.global(.prod).js
      • For direct use via <script src="..."> in the browser. Exposes the Vuex global.
      • Note that global builds are not UMD builds. They are built as IIFEs and is only meant for direct use via <script src="...">.
      • Contains hard-coded prod/dev branches, and the prod build is pre-minified. Use the .prod.js files for production.
    • vuex.esm-browser(.prod).js
      • For usage via native ES modules imports (in browser via <script type="module">.
    • vuex.esm-bundler.js
      • For use with bundlers like webpack, rollup and parcel.
      • Leaves prod/dev branches with process.env.NODE_ENV guards (must be replaced by bundler).
      • Does not ship minified builds (to be done together with the rest of the code after bundling).
    • vuex.cjs.js
      • For use in Node.js server-side rendering via require().

    Typings for ComponentCustomProperties

    Vuex 4 removes its global typings for this.$store within Vue Component due to solving issue #994. When using TypeScript, you must provide your own augment declaration.

    Please place the following code in your project to have this.$store working.

    // vuex-shim.d.ts
    
    declare module "@vue/runtime-core" {
      // Declare your own store states.
      interface State {
        count: number
      }
    
      interface ComponentCustomProperties {
        $store: Store<State>;
      }
    }
    
    Open source →
  11. 4.0.0-alpha.115 Mar 2020pre-release
    Release notes

    This is the Vue 3 compatible version of Vuex. The focus is compatibility, and it provides the exact same API as Vuex 3, so users can reuse their existing Vuex code for Vue 3.

    Status: Alpha

    All Vuex 3 feature works. There are a few breaking changes described in a later section, so please check them out. You can find basic usage with both option and composition API at example folder.

    Please note that it's still unstable, and there might be bugs. Please provide us feedback if you find anything. You may use vue-next-webpack-preview to test out Vue 3 with Vuex 4.

    Breaking changes

    Installation process has changed

    To align with the new Vue 3 initialization process, the installation process of Vuex has changed as well.

    You should use a new createStore function to create a new store instance.

    import { createStore } from 'vuex'
    
    const store = createStore({
      state () {
        return {
          count: 1
        }
      }
    })
    

    This is technically not a breaking change because you could still use new Store(...) syntax. However, to align with Vue 3 and also with Vue Router Next, we recommend users to use createStore function instead.

    Then to install Vuex to Vue app instance, pass the store instance instead of Vuex.

    import { createApp } from 'vue'
    import store from './store'
    import App from './APP.vue'
    
    const app = createApp(Counter)
    
    app.use(store)
    
    app.mount('#app')
    

    Kown issues

    • The code is kept as close to Vuex 3 code base as possible, and there're plenty of places where we should refactor. However, we are waiting for all of the test cases to pass before doing so (some tests require Vue 3 update).
    • TypeScript support is not ready yet. Please use JS environment to test this for now.
    Open source →
  12. 3.6.226 Jan 2021
    Release notes

    Bug Fixes

    • build: fix wrong path name for the export module (679313b)
    Open source →
    Additional notes

    v3.6.2

    Compare

    Choose a tag to compare

    Open source →
  13. 3.6.126 Jan 2021
    Release notes

    Bug Fixes

    • fix tree shaking notworking in webpack bundle (#1906) (1dc2d1f)
    Open source →
    Additional notes

    v3.6.1

    Compare

    Choose a tag to compare

    Open source →
  14. 3.6.025 Nov 2020
    Release notes

    Bug Fixes

    • stop throwing an error on hasModule when parent does not exists (#1850) (#1851) (12aabe4)

    Features

    • types: adding logger type for logger plugin (#1853) (cb3198d)
    • build: enable named esm module import on node.js >= 14 (#1872) (acddab2)
    Open source →
    Additional notes

    v3.6.0

    Compare

    Choose a tag to compare

    Open source →
  15. 3.5.129 Jun 2020

    Nothing published for this version

  16. 3.5.029 Jun 2020

    Nothing published for this version

  17. 3.4.011 May 2020
    Release notes

    Features

    Open source →
  18. 3.3.025 Apr 2020
    Release notes

    Bug Fixes

    Features

    • Add prepend option for subscribe and subscribeAction (#1358) (a39d076)
    • logger: createLogger can optionally log actions (#987) (18be128)
    Open source →
  19. 3.2.019 Apr 2020
    Release notes

    Features

    3.1.3 (2020-03-09)

    Bug Fixes

    • Prevent invalidating subscription iterator (#1438) (e012653)

    3.1.2 (2019-11-10)

    Bug Fixes

    • tweak mapping helper warning message (#1641) (e60bc76)
    • types: avoid broadening vue instance type when using map helpers (#1639) (9a96720)
    • add warnings when the different namespaced modules has the same names… (#1554) (91f3e69)
    • Should vuex mapState print error message #1093 (#1297) (e5ca2d5)
    • Warn about conflicts between state and module (#1365) (538ee58)
    • docs: Clearify state object type (#1601) (de06f76)

    Performance Improvements

    • Implementing a cache for the gettersProxy object creation (#1546) (4003382)

    3.1.1 (2019-05-08)

    Bug Fixes

    Features

    • devtool: allow usage in non-browser environments (#1404) (665455f)
    • esm build: build ES modules for browser (#1533) (d7c7f98)
    Open source →
  20. 3.1.39 Mar 2020

    Nothing published for this version

  21. 3.1.210 Nov 2019

    Nothing published for this version

  22. 3.1.18 May 2019

    Nothing published for this version

  23. 3.1.017 Jan 2019
    Release notes

    Bug Fixes

    Features

    • add ability to turn off devtools on vuex by passing an off options (#1407) (be75d41)
    • ensure errors in action subscribers do not break actions (acd7249)

    Reverts

    • Revert "Update util find (#1205)" (fix #1286) (273bf86), closes #1286

    3.0.1 (2017-11-01)

    Open source →
  24. 3.0.11 Nov 2017

    Nothing published for this version

  25. 3.0.011 Oct 2017
    Release notes

    Features

    • typings: adapt to the new Vue typings (#909) (65dbfec)

    BREAKING CHANGES

    • typings: It is no longer compatible with the old Vue typings

    • chore(package): bump typescript and vue core typings

    • chore: bump vue

    • Update package.json

    Open source →
  26. 2.5.011 Oct 2017
    Release notes

    Bug Fixes

    • initialize root state as an empty object if state function returns no value (#927) (0e9756b)

    Features

    2.4.1 (2017-09-27)

    Bug Fixes

    • allow installation on extended Vue copies (c87b72f)
    • link to details of mutations in components (#930) (e82782b)
    • move auto installation code into the store constructor (#914) (852ac43)

    Features

    • allow to passing functions in mapActions/mapMutations (fix #750) (#924) (be15f32)
    Open source →
  27. 2.4.127 Sept 2017

    Nothing published for this version

  28. 2.4.029 Aug 2017
    Release notes

    Bug Fixes

    • typings: watch() returns an unwatch function (#922) (a4bd081)
    • add missing typings and docs of createNamespacedHelpers (#910) (7ad573b)

    Features

    • store: bind mutation and action handlers to store (#872) (67da622)

    Performance Improvements

    • do not connect devtools if Vue.config.devtools == false (#881) (dd7f817)
    Open source →
  29. 2.3.118 Apr 2017

    Nothing published for this version

  30. 2.3.013 Apr 2017
    Release notes
    • Add '-loader' suffix to webpack config (#722) (84b4634), closes #722

    BREAKING CHANGES

    • It's no longer allowed to omit the '-loader' suffix when using loaders. You need to specify 'babel-loader' instead of 'babel'. My version of webpack: 2.2.0-rc.3 Adding the '-loader' suffix fixed the problem. Not sure though how safe it is to use 'babel-loader' instead of 'babel' with previous webpack versions...

    2.2.1 (2017-02-26)

    Open source →
  31. 2.2.126 Feb 2017

    Nothing published for this version

  32. 2.2.026 Feb 2017
    Release notes

    2.1.2 (2017-02-06)

    Reverts

    • Revert "Update modules.md (#534)" (5e145b3), closes #534

    2.1.1 (2016-12-17)

    Open source →
  33. 2.1.324 Feb 2017

    Nothing published for this version

  34. 2.1.26 Feb 2017

    Nothing published for this version

  35. 2.1.117 Dec 2016

    Nothing published for this version

  36. 2.1.016 Dec 2016

    Nothing published for this version

  37. 2.0.030 Sept 2016

    Nothing published for this version

  38. 2.0.0-rc.624 Sept 2016pre-release

    Nothing published for this version

  39. 2.0.0-rc.515 Aug 2016pre-release

    Nothing published for this version

  40. 2.0.0-rc.45 Aug 2016pre-release

    Nothing published for this version

  41. 2.0.0-rc.311 Jul 2016pre-release

    Nothing published for this version

  42. 2.0.0-rc.15 Jul 2016pre-release

    Nothing published for this version

  43. 1.0.118 Jan 2017

    Nothing published for this version

  44. 1.0.030 Sept 2016

    Nothing published for this version

  45. 1.0.0-rc.25 Jul 2016pre-release

    Nothing published for this version

  46. 1.0.0-rc1 Jul 2016pre-release
    Release notes

    0.8.2 (2016-06-28)

    0.8.1 (2016-06-28)

    Open source →
  47. 0.8.228 Jun 2016

    Nothing published for this version

  48. 0.8.128 Jun 2016withdrawn: incorrect dist build

    Nothing published for this version

  49. 0.8.023 Jun 2016
    Release notes

    0.7.1 (2016-06-22)

    Open source →
  50. 0.7.122 Jun 2016

    Nothing published for this version

  51. 0.7.021 Jun 2016
    Release notes

    0.6.3 (2016-04-23)

    0.6.2 (2016-03-08)

    0.6.1 (2016-03-07)

    Open source →
  52. 0.6.323 Apr 2016

    Nothing published for this version

  53. 0.6.28 Mar 2016

    Nothing published for this version

  54. 0.6.17 Mar 2016

    Nothing published for this version

  55. 0.5.14 Mar 2016

    Nothing published for this version

  56. 0.5.04 Mar 2016
    Release notes

    0.4.2 (2016-03-02)

    0.4.1 (2016-03-01)

    Open source →
  57. 0.4.22 Mar 2016

    Nothing published for this version

  58. 0.4.11 Mar 2016

    Nothing published for this version

  59. 0.4.01 Mar 2016

    Nothing published for this version

  60. 0.3.016 Feb 2016
    Release notes

    Bug Fixes

    Open source →