feat: Add Pinia support#12707
Conversation
|
PERFECT timing. One thing to explore is the SSR state serialization/deserialization of the Pinia store. The equivalence of what we do for Vuex. The setup needs Quasar v2.6 in order for SSR to work (for both app-webpack and app-vite). Wanna dig into this tomorrow or would u like me to do it? |
|
I was actually going to continue with the SSR stuff and docs, as I noted them as TODO and marked the PR as draft. But, it seems like you've needed it just in time, so I will continue with them in separate PRs. I already somewhat know what the solution will be like, so I will continue working tomorrow. |
|
@yusufkandemir will push something for app-vite in quasar-config-file that you'll need tomorrow (#initialVersions.pinia/vuex) --> so that templates/entry/client and server can be handled differently for each store. store.replaceStore for Vuex and Pinia's equivalent stuff Sorry for talking briefly. On a hurry to release all the stuff. PS: you're amazing! keep it going |
|
For SSR it is absolutely necessary to build the /ui package and use it. Both app-webpack and app-vite will break without it on SSR otherwise. |
|
Just saw the draft PR. Your approach actually doesn't require my stuff. Sniffing should work better than wasting time and resources checking for Vuex and Pinia installation. |
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
devbranch (orv[X]branch)Other information:
TODO:
To test it locally:
./quasar/create-app/index.js # your local path might be differentNote: Linting with TS projects doesn't work OOTB, because
create-appis WIP. So, you might want to not choose the linting feature. Alternatively, you can update.eslintrc.js'sparserOptionssection to this:cd into the project you've created.
Update
package.jsonof the created projects to use the local packages:src/pages/Index.vueto actually use the example store:yarn quasar dev # or just "quasar dev"