Replies: 6 comments 17 replies
-
So, some modules like @nuxtjs/auth and @nuxtjs/auth-next require vuex store. It causes some difficulties with migration, even in bridge |
Beta Was this translation helpful? Give feedback.
-
Agreed, al my project use Vuex as business logic layer, it super important, but if you add posibility of different stores adding - it will be super! Because type difinition in vuex is HELL :((( P.S. - MobX with proxies superfast now.... |
Beta Was this translation helpful? Give feedback.
-
Having clear goto solutions is a big plus for the vue/nuxt ecosystem. I think its better to support one standard solution everywhere. This creates more synergies with other projects/modules (e.g. with vuex used basically everywhere). It would also be easier to migrate v2 apps hopefully. |
Beta Was this translation helpful? Give feedback.
-
Considering Pinia is becoming the official recommendation in the new vue docs, I believe that should be the supported standard at a minimum: |
Beta Was this translation helpful? Give feedback.
-
When I started build first app with nuxt3 I discovered that keeping store modules in composables directory will be very messy in the future. So I created very small package that add auto imports from store directory. Works well with pinia. |
Beta Was this translation helpful? Give feedback.
-
FWIW, if anyone is looking for Vuex support, I just released a module: https://github.com/richardeschloss/nuxt3-vuex . This will let you keep using your Nuxt2 "store" folder in Nuxt 3 (with some added features). This may come in handy if you have a massive Nuxt2 project (with a massive store) you wish to migrate to Nuxt 3 🚀 🚀 🚀 |
Beta Was this translation helpful? Give feedback.
-
With the introduction of composition-API, it makes less sense of using classic vuex store patterns. In the meantime, having a global state (SSR/SPA) is usually required by the projects and with nuxt, we need to provide a built-in integration layer.
While in vue2 ecosystem,
vuex
was the only option, now we have at least two undergoing projects:Possibility of introducinguseStateuseStore
and more serialize/retrieval utilities into vue 3 core (back portable via@vue/composition-api
?)As currently there are not enough data to pick one approach, it makes sense to not directly choose one library but help to make all different store implementations working nicely with nuxt 3 via each own's module and adding examples, docs for them to the framework. This way,
store/
support can be added with@pinia/nuxt
or@nuxtjs/vuex
modules)When we have a better idea of vue 3's take on the store, we can start drafting built-in store support. Hopefully core, Pinia and Vuex 5 will have almost identical API that we can use it for nuxt 3 layer and allow to switch provider by users.
Beta Was this translation helpful? Give feedback.
All reactions