pinia

The Vue Store that you will enjoy using

v2.0.0-rc.4 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-rc.3 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-rc.2 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-rc.1 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-rc.0 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-beta.5 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-beta.4 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-beta.3 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-beta.2 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-beta.1 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.19 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.18 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.17 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.16 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.15 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.14 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.13 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.12 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.11 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.10 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.9 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.8 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.7 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.6 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.5 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.4 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.3 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.2 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v2.0.0-alpha.1 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.1.4 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.1.3 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.1.2 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.1.1 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.1.0 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.36 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.35 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.34 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.33 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.32 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.31 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.30 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.29 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.28 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.27 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.26 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.25 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.24 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.23 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.22 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.21 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.20 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.18 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.17 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.16 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.15 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.14 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.13 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.12 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.11 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.10 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.9 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.8 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.7 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.6 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.5 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.4 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.3 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.2 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.1 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

Pinia v2.0.0 by github-actions[bot]github-actions[bot]

Pinia logo

Stores made simple

Today Pinia is reaching its first release version, and surprisingly, it's not the v1, it's the v2! After 19 Alphas, 5 Betas, and 15 release candidates, almost 2 years from its initial release, 0.0.1, Pinia is now reaching v2.0.0 🎉!

Thanks a lot to everybody who has been using it, specially those trying it out in its early stages (pre v1, with Vue 2).

Pinia has around 80k downloads per month and you can already find a few plugins on npm!. It has become the most complete yet light Store for Vue. It's type safe by default, highly extensible, provides advanced devtools support, is modular by design, making your bundles smaller, and will feel familiar to any person already using Vue with both, an Option and a Setup API.

You can read how it compares to Vuex on the documentation.

Going stable

After entering v2, Pinia will not release breaking changes like it used to in alphas, betas, and rcs. It will focus on providing a great DX through its typings, devtool plugin, and third party plugins. More concrete documentation in the form of Cookbook entries and maybe even videos, are yet to come!

Why skip v1?

Initially, I was keeping two active branches for Pinia and I was releasing v.0.x.x versions at the same time as v2.0.0-0 versions, back-porting across repositories any fixes and new features. This was sometimes easy to deal with with git cherry-pick but when that didn't work, it quickly became hard to keep both branches in sync. At some point, I managed to merge both branches together by using vue-demi and obtain a version of Pinia that worked with both Vue 2 and Vue 3. After that, I decided to stop working on the v1 branch and focus on the v2, which has now reached a stable release version. Because of this, there was never (and will never be) a v1.0.0.

What is next?

Pinia has been production ready for a couple of months now. The only reason it was kept in an RC state was to be able to bring minor breaking changes until the API felt completely right. Now it's time to focus on keeping it up to date with any improvements we might come up for Vuex 5. The fate of Pinia is not clear yet but it shall either be absorbed by Vuex or become a superset of it, keeping its API as aligned as possible with Vuex 5.

Trying it out

If you want to give Pinia a quick try, check out this demo with Vue 3 or this other one with Nuxt 3. You can find a complete list of the examples here.

To learn more about Pinia, take a loot at the documentation.

Supporting Pinia development

If your company uses Vue Router, please consider supporting its development by supporting me 🙏 . It will mean a lot and really help me to keep working on improving the Vue Ecosystem.


If you were already using the release candidate version of Pinia, you can find the list of improvements on the CHANGELOG.md.

pinia@2.0.0-rc.15 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.0-rc.14 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.0-rc.13 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.0-rc.12 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.0-rc.11 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.0-rc.10 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.0-rc.9 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.0-rc.8 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.0-rc.7 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

pinia@2.0.0-rc.6 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v0.5.4 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v0.5.3 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v0.5.2 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v0.5.1 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v0.5.0 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v0.4.1 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v0.4.0 by github-actions[bot]github-actions[bot]

Please refer to CHANGELOG.md for details.

v0.3.1 by posvaposva

Please refer to CHANGELOG.md for details.

v🚀 0.1.0 by posvaposva

  • feat: access the state and getters through this (#190) (7bb7733)
  • refactor: use defineComponent (cae8fca)

Breaking changes

There is no longer a state property on the store, you need to directly access any property

store.state.counter
// becomes
store.counter

getters no longer receive parameters, directly call this.myState to read state and other getters:

getters: {
  doubleCount: state => state.counter * 2
  // becomes
  doubleCounte() {
    return this.counter * 2
  }
}

More at #190

v🚀 0.0.7 by posvaposva

  • fix: make pinia work with nuxt Composition API plugin (#180) (f4e2583)

v🚀 0.0.6 by posvaposva

v🚀 0.1.0-alpha.1 by posvaposva

v🚀 0.0.5 by posvaposva

BREAKING CHANGES

After taking a deeper look at what is necessary for SSR, a few things had to change:

  • Actions are no longer just functions, they must be attached to the store by being passed directly to createStore and they are called as methods of the store (e.g. store.reset())
  • createStore now takes an object instead of positional arguments
// before
export const useMainStore = createStore(
  // id
  'main',
  // state
  () => ({ counter: 0 }),
  // getters
  {
    doubleCount: state => state.counter * 2,
  }
)

export function reset() {
  const store = useMainStore()
  store.state.counter = 0
}
// now
export const useMainStore = createStore({
  id: 'main',
  state: () => ({ counter: 0 }),
  getters: {
    doubleCount: state => state.counter * 2,
  },
  actions: {
    reset() {
      this.state.counter = 0
    },
  },
})
  • feat: allow using getters in other getters (859eeb3)
  • feat: allow empty state option to make it easy to group stores (810e0f0)
  • feat: add nuxt module (4c0ef7a)
  • feat: allow passing the req to useStore (f250622)
  • fix: bind the actions to the store (5e262da)
  • feat: allow useStore to be called within a store (fdf6b45)
  • feat: handle SSR state hydration (2998d53)
  • feat: state hydration (db72247)
  • feat: export types, support state hydration (89996ed)

v🚀 0.0.4 by posvaposva

v🚀 0.0.3 by posvaposva