News for hackers. Stuff that matters.
Re:Vue 3.2 by alichapman on Tuesday August 10, 2021 @03:00AM (#28125853)
I think my favourite thing about Vue 3 and the composition API is that VueX is essentially obsolete - you can manage your global state by calling real life functions.

This means instead of doing `dispatch("action")` you just call `action()`.

When using Typescript this is a godsend, as the action functions keep all of their type information.

Re:Vue 3.2 by johnthreevolts on Tuesday August 10, 2021 @03:27AM (#28126029)
I recently found Pinia[1] as replacement for vuex.

- full typing

- real life functions

- vue dev plugin support in store section

- mutations don't exist as separate idea

- also has api, so i wrote little plugin for state synchronization with local storage.

*Typography fix

1. https://pinia.esm.dev/

Re:Vue 3.2 by Tajnymag on Tuesday August 10, 2021 @04:57AM (#28126582)
Wow. That's exactly what I thought Vuex would look like after after the Vue 3 release.

Definitely going to use it for my future project.

Re:Vue 3.2 by AstralStorm on Tuesday August 10, 2021 @05:10AM (#28126645)
Just know what you're getting into, this is a new rather unknown framework with much fewer users and resources than Vue with VueX.
Re:Vue 3.2 by ebr4him on Tuesday August 10, 2021 @06:21AM (#28127052)
Read the docs, its from a Vue core team member and based on a future version of Vuex so you can easily migrate.
Re:Vue 3.2 by oefrha on Tuesday August 10, 2021 @07:17AM (#28127385)
This is great. I feel the urge to delete all the brittle vuex crap from my vue3 ts projects right now.
Re:Vue 3.2 by runarberg on Tuesday August 10, 2021 @11:54AM (#28130379)
Agreed. I do miss the devtool support of vuex though, but there is an RFC for a vuex 5 which will remedy that by fully embracing the composition API.

https://github.com/kiaking/rfcs/blob/vuex-5/active-rfcs/0000...

Re:Vue 3.2 by conradfr on Tuesday August 10, 2021 @05:14AM (#28126668)
I'm the other way, as in the composition API has not clicked yet for me.

I read the doc and it makes sense but once in my project, I fail to see why I would use it, and yes I use vuex.

I probably need to make a Vue3 project from scratch without vuex to get it.