Skip to content

Group/project members - migrate non-reactive state to `provide/inject`

Summary

There are a number of properties that are currently stored in app/assets/javascripts/members/store/state.js but are not reactive so do not need to be stored there. As step one in migrating to GlTabs we should slim down the number of properties that are stored in the Vuex store so when we move to Vuex modules only the reactive state will be stored in the namespaced Vuex store.

This also could provide some performance gains since getters/setters are added to Vuex state and these properties don't need to be reactive.

These are properties that should be converted to provide/inject

  • sourceId
  • currentUserId
  • canManageMembers
  • tableFields
  • tableAttrs
  • tableSortableFields
  • memberPath
  • requestFormatter
  • filteredSearchBar

Improvements

  • Make it easier to move towards one Vuex store with multiple namespaced modules
  • Performance gains

Risks

Minimal, this is a well tested section of the codebase

Involved components

Edited by Peter Hegman