Today I completely wiped away Pinia
from a large Vue codebase at work. It was an immense effort, but I’m so pissed I didn’t mind working overtime.
The main reason to use Pinia is that you can inspect the state in DevTools – an idea taken from React –, but guess what. The extension only exists for Chrome now, and the current old Firefox version is broken. It looks like a project driven by amateurs, just like the horrible VSCode extension. And I’m not alone on this.
For the global stores, I’m simple using a reactive
object, with functions and computed values inside – that’s what Pinia does anyway. I found this by digging into its source code. I also found that a computed
inside a reactive
makes the .value
unnecessary, which is a merit of Vue’s reactivity system, which I still believe to be the best out there.
const state = reactive({ loading: false, name: '', foo: computed(() => state.name + '.'), doAction(): { console.info('Hello'); }, });
I really regret choosing Vue back in the day for this project. I should’ve choosen good ol’ React, because despite its flaws, it’s dependable.