Skip to content

Conversation

@flaviendelangle
Copy link
Member

While working on #13520, I noticed that if a plugin had an experimental feature and one of its dependencies also had an experimental feature, then the typing broke.

The reason is that calling MergeSignaturesProperty on a union did not work (we ended up with 'virtualization' & 'indentationPerLevel' instead of 'virtualization' | 'indentationPerLevel'.
I changed the logic to instead transform the experimental features into an object inside TreeViewPluginSignature to keep all the merging strategies consistent.

@flaviendelangle flaviendelangle added the scope: tree view Changes related to the tree view. This includes TreeView, TreeItem. label Jun 26, 2024
@flaviendelangle flaviendelangle self-assigned this Jun 26, 2024
TSignatures extends readonly TreeViewAnyPluginSignature[],
> = { [key in MergeSignaturesProperty<TSignatures, 'experimentalFeatures'>]?: boolean };
TOptionalSignatures extends readonly TreeViewAnyPluginSignature[] = [],
> = MergeSignaturesProperty<[...TSignatures, ...TOptionalSignatures], 'experimentalFeatures'>;
Copy link
Member Author

Choose a reason for hiding this comment

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

I also added support for the optional plugins even if we never use it for now, just to be consistent with the instance and params

@mui-bot
Copy link

mui-bot commented Jun 26, 2024

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

Generated by 🚫 dangerJS against f453fca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: tree view Changes related to the tree view. This includes TreeView, TreeItem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants