Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TreeView] Refactor the tree view internals to prepare for headless API #13311

Merged
merged 6 commits into from
Jun 12, 2024

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented May 30, 2024

  • Move extractPluginParamsFromProps inside useTreeView
  • Simplify the LogExpandedItems doc example (remove support for the root slot)
  • Remove the default plugin list in favor of one list per Tree View component we export (so that RichTreeView can have plugin that SimpleTreeView does not have)

@flaviendelangle flaviendelangle added the component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! label May 30, 2024
@flaviendelangle flaviendelangle self-assigned this May 30, 2024
@mui-bot
Copy link

mui-bot commented May 30, 2024

Deploy preview: https://deploy-preview-13311--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 37de3bd

Copy link

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

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 10, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 10, 2024
Copy link

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

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 10, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jun 10, 2024
@flaviendelangle flaviendelangle changed the title [TreeView] Refacto the tree view internals to prepare for headless API [WIP] [TreeView] Refacto the tree view internals to prepare for headless API Jun 11, 2024
@flaviendelangle flaviendelangle marked this pull request as ready for review June 11, 2024 14:03
const forwardedProps = {} as Omit<TProps, keyof PluginParams>;

Object.keys(props).forEach((propName) => {
const prop = props[propName as keyof typeof props] as any;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had similar issues for normalizing plugins in charts without using any. If one day you find a better solution than your current one, I would be interested :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Given the types of Object.keys I think there is no better solution for now 😢

Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good, but I don't know tree view well enough to spot room for improvement

Copy link
Contributor

@noraleonte noraleonte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice improvement🚀 I really like that we now have a plugin list per component 💙

@noraleonte noraleonte changed the title [TreeView] Refacto the tree view internals to prepare for headless API [TreeView] Refactor the tree view internals to prepare for headless API Jun 12, 2024
@flaviendelangle flaviendelangle merged commit b38bef8 into mui:master Jun 12, 2024
17 checks passed
@flaviendelangle flaviendelangle deleted the refacto-tree-view branch June 12, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants