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

Use markRaw() to signal non reactive data in store #11097

Merged
merged 1 commit into from
May 29, 2024

Conversation

rak-phillip
Copy link
Member

@rak-phillip rak-phillip commented May 22, 2024

Summary

This utilizes markRaw() to ensure that certain properties in the Vuex store are marked as "non-reactive".

Fixes #11098

Technical notes summary

Upon further review of #11062, I thought that Object.defineProperty() was being used, in part, to mark certain properties as "non-reactive" in the Dashboard store. $plugin, $router, & $route really don't need reactivity associated with them.

We might want to consider following up in the future to decide if any of these properties belong in the Vuex store at all. We can achieve a similar result by utilizing a singleton or some similar pattern that will allow us to share these definitions throughout Dashboard.

Areas or cases that should be tested

Anything that accesses the $router, $route, or $plugin states stored in the store.

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
@rak-phillip rak-phillip marked this pull request as ready for review May 22, 2024 22:15
@rak-phillip rak-phillip merged commit 67dd70e into rancher:master May 29, 2024
36 checks passed
@rak-phillip rak-phillip deleted the chore/non-reactive-data branch May 29, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure that $router, $route, $plugin, and cache.map are marked as non-reactive
2 participants