Pinia is the successor to Vuex. It promises to be lighter weight than Vuex (6KB for Pinia 2.0.13, 15KB for Vuex 4.0.2) and to support TypeScript better.
We could not immediately replace Vuex 4 with Pinia, because Pinia isn't fully backwards compatible with Vuex 4. The APIs are reasonably similar, but there are big enough differences that it would be difficult to write compatibility wrappers that would allow code expecting Vuex 4 to run on Pinia. Instead, we would use Vuex 4 and Pinia side by side for a while, with new code using Pinia, and old code being migrated from Vuex 4 to Pinia over time. This theoretically means that both libraries could be loaded on the same page, which would be (slightly) wasteful; but I don't think that it'll happen much in practice, because the features that currently use Vuex tend to be ones that take over the entire page.
To install Pinia in MediaWiki, we would probably want to use pinia.iife.prod.js / pinia.iife.js and wrap them so that VueDemi is aliased to require( 'vue' ). Alternatively, we could use pinia.prod.cjs, but then we would have to set up a module alias for vue-demi to redirect to vue, and we would have to make @vue/devtools-api available (in the iife versions, that package is inlined).