[tree view] Introduce a Tree View Store to clean the internals
Fixes #14228 Closes #19426
Extracted PRs
- #20225
- #20233
- #20235
- #20240
In this PR:
- The
storeobject is created once on mount with all its method. There is no code run on every render to update its methods. - The
contextValue.wrapRootproperty have been replaced by manual JSX in the various Tree View components. - The parameters to pass to the store instead of the DOM are now hardcoded on a
useMemoinstead of being listed by each plugin.
Differences with the Scheduler stores
-
The product methods are stored in plugin instead of being defined by the store
On the Scheduler, we call methods like
store.setVisibleResources. For the Tree View, the equivalent would bestore.resources.setVisibleResources. This is because the main store create several sub-classes for each main feature (focus, keyboard navigation, expansion, ...) that expose there own methods. This make the codebase a lot more scalable.
Deploy preview: https://deploy-preview-20051--material-ui-x.netlify.app/
Bundle size report
| Bundle | Parsed size | Gzip size |
|---|---|---|
| @mui/x-data-grid | 0B(0.00%) | 0B(0.00%) |
| @mui/x-data-grid-pro | 0B(0.00%) | 0B(0.00%) |
| @mui/x-data-grid-premium | 0B(0.00%) | 0B(0.00%) |
| @mui/x-charts | 0B(0.00%) | 0B(0.00%) |
| @mui/x-charts-pro | 0B(0.00%) | 0B(0.00%) |
| @mui/x-charts-premium | 0B(0.00%) | 0B(0.00%) |
| @mui/x-date-pickers | 0B(0.00%) | 0B(0.00%) |
| @mui/x-date-pickers-pro | 0B(0.00%) | 0B(0.00%) |
| @mui/x-tree-view | 🔺+1.63KB(+2.50%) | ▼-380B(-1.88%) |
| @mui/x-tree-view-pro | 🔺+963B(+1.09%) | ▼-752B(-2.72%) |
Generated by :no_entry_sign: dangerJS against 63655350d4071c8c51333c33d81a9835d567f099
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
This pull request has conflicts, please resolve those before we can evaluate the pull request.