mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[tree view] Introduce a Tree View Store to clean the internals

Open flaviendelangle opened this issue 2 months ago • 14 comments

Fixes #14228 Closes #19426

Extracted PRs

  • #20225
  • #20233
  • #20235
  • #20240

In this PR:

  • The store object is created once on mount with all its method. There is no code run on every render to update its methods.
  • The contextValue.wrapRoot property 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 useMemo instead 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 be store.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.

flaviendelangle avatar Oct 22 '25 08:10 flaviendelangle

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%)

Details of bundle changes

Generated by :no_entry_sign: dangerJS against 63655350d4071c8c51333c33d81a9835d567f099

mui-bot avatar Oct 22 '25 08:10 mui-bot

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 29 '25 10:10 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 30 '25 09:10 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 03 '25 11:11 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 04 '25 17:11 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 06 '25 10:11 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 07 '25 10:11 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 10 '25 10:11 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 18 '25 16:11 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Nov 19 '25 09:11 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Dec 01 '25 12:12 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Dec 02 '25 10:12 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Dec 04 '25 12:12 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Dec 04 '25 13:12 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Dec 11 '25 15:12 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Dec 16 '25 18:12 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Dec 18 '25 17:12 github-actions[bot]