Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate the main mail store to Pinia #10138

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

GVodyanov
Copy link
Contributor

@GVodyanov GVodyanov commented Sep 12, 2024

Fix #9237

This is going to be a big one...

Splitting stores into multiple files isn't very common in Pinia, but I really wanted to do so in this case, I took my inspiration for how to do it from these guys vuejs/pinia#802

A little overview of how this was done:

  • Created a subfolder in /store for all the main mail store stuff
  • Migrate all the getters and remove now useless ones (the ones that just point to a piece of state without modifying it)
  • Migrate the actions file
  • Rename all the mutations to [previous name] + Mutation
  • Migrate dispatch and commit usages in components to the correct Pinia usage
  • Move the renamed mutations into the actions file, hence making them actions (and this time I didn't inline anything, at least yet)
  • Realized that a lot of the getters had parameters, which you can't have in Pinia, so those become actions as well (not renamed)
  • Lots of bugfixing

@GVodyanov GVodyanov added enhancement 2. developing skill:frontend Issues and PRs that require JavaScript/Vue/styling development skills labels Sep 12, 2024
@GVodyanov GVodyanov self-assigned this Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing enhancement skill:frontend Issues and PRs that require JavaScript/Vue/styling development skills
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace global Vuex store with Pinia
1 participant