-
Notifications
You must be signed in to change notification settings - Fork 283
Open
Description
Summary
When using the trash modal while editing a channel
content nodes are added to contentNodesMap Vuex state
studio/contentcuration/contentcuration/frontend/channelEdit/vuex/contentNode/index.js
Line 15 in d6f06c2
| contentNodesMap: {}, |
Example:
studio/contentcuration/contentcuration/frontend/channelEdit/views/trash/TrashModal.vue
Line 210 in d6f06c2
| this.loadContentNodes({ parent__in: [this.rootId] }), |
The goal of this issue is to refactor the feature to not add/retrieve data to/from contentNodesMap and rather move towards using a more local state that will be cleared after a user stops using the feature.
Background
- We accumulate content nodes data in Vuex
contentNode/statefrom various Studio features of thechannelEditapp and there is no mechanism for clearing them which causes memory leaks. This issue is part of a larger group of issues (see Improve Studio's performance when navigating and editing channels' content (channelEditapp) #3363) that aim to refactor problematic features away from using Vuex global state towards private in-components state or state that’s shared between more components but is cleared at some point and optimized performance-wise in general. - Ultimately, we want to get rid of globally stored content nodes data completely, however, this will be implemented incrementally, and therefore it’s fine to use mixed sources of data in the transition stage as long as all features continue working well from the user-point of view. Using composables is not required in all cases but is recommended as it has proven to be useful for state management across our products and it is flexible enough to allow us to keep using Vuex partially during the transition stage.
Acceptance criteria
- No content nodes are added/retrieved to/from
contentNodesMapwhen using the trash modal (applies to all sub-components if there are any) - The new implementation avoids the pitfalls of our current implementation that are described in the “Background” section and is optimized performance-wise overall
