You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our usage of Vuex for state management has caused some additional complexity, often simply due to the way that we have used it using shared global state that can be independently updated by different code paths.
Of more concern is the fact that our use of Vuex in the core of the app creates an implicit API that it becomes hard to reason about, and difficult to alert to end users when it is no longer available. This is because to access Vuex state, getters, or actions, they are referenced in components using e.g.: mapGetters(['isAdmin', 'isLearner']) - so if we were to rename these, update them, or remove them, code relying on them would would very little indication that something had gone awry.
Description and outcomes
It is desirable to remove our usage of Vuex as we update and make changes to our code base.
However, because of the extent of our usage of Vuex, this should be done incrementally.
As the primary concerns are removal of an implicit API, and mutations to shared state across different pages within apps, these should be addressed first - so removal of the core Vuex state, getters, mutations, and actions is the first focus of this tracking issue. Individual plugins can then be independently responsible for registering Vuex and instantiating the store, and can take their own path to removing dependence on vuex.
The content you are editing has changed. Please copy your edits and refresh the page.
It may be worth looking at the changes to how the promises are handled in CoachToolsModule in #12755 - the issue that I ran into there was in part related to the fact that the handleApiError action ends with throw error - which led me to run into weird UncaughtError issues when the handleApiError was dispatched within the beforeRouteEnter guard.
When I removed that throw error line, however, the issue was resolved.
But, there are too many uses of the handleApiError action in Kolibri for me to make that change to fix that particular problem, but during work on this issue it'd be worth considering whether or not we need or want it to throw the error back at us.
FWIW - when I removed that throw error the tests passed... but that doesn't mean we've covered error-throwing cases in particular though so it'll require some manual review in service of this issue.
Overview
Our usage of Vuex for state management has caused some additional complexity, often simply due to the way that we have used it using shared global state that can be independently updated by different code paths.
Of more concern is the fact that our use of Vuex in the core of the app creates an implicit API that it becomes hard to reason about, and difficult to alert to end users when it is no longer available. This is because to access Vuex state, getters, or actions, they are referenced in components using e.g.:
mapGetters(['isAdmin', 'isLearner'])
- so if we were to rename these, update them, or remove them, code relying on them would would very little indication that something had gone awry.Description and outcomes
It is desirable to remove our usage of Vuex as we update and make changes to our code base.
However, because of the extent of our usage of Vuex, this should be done incrementally.
As the primary concerns are removal of an implicit API, and mutations to shared state across different pages within apps, these should be addressed first - so removal of the core Vuex state, getters, mutations, and actions is the first focus of this tracking issue. Individual plugins can then be independently responsible for registering Vuex and instantiating the store, and can take their own path to removing dependence on vuex.
Core Vuex API
The text was updated successfully, but these errors were encountered: