[COMPASS-4485] Move compass-crud state items into a store Created: 05/Nov/20 Updated: 10/Jan/24 Resolved: 16/Mar/22 |
|
| Status: | Closed |
| Project: | Compass |
| Component/s: | CRUD, Tech debt |
| Affects Version/s: | None |
| Fix Version/s: | No version |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Rhys Howell | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Not Needed |
| Description |
|
Currently compass-crud stores a number of items in it's component's states. Things like editing state, update error messages, and whether or not fields/documents are expanded. This also might help prevent us from having bugs which can occur when reconciling a store's state with a components state within the render cycle which is something we currently do in `componentDidUpdate` in the `json-editor` component for instance https://github.com/mongodb-js/compass-crud/blob/master/src/components/json-editor.jsx These are things which should be stored in a store, which we can persist when the plugin is unmounted. This would free us from keeping various plugins mounted while not visible: https://github.com/mongodb-js/compass-collection/pull/135 which is a performance hit. |
| Comments |
| Comment by Rhys Howell [ 16/Mar/22 ] |
|
Going to close this as I think it makes sense to probably address it differently. Currently we are extracting some of the document rendering logic which should start to make the pain point causing this ticket this go away. |