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

[pickers] Add explicit interfaces for components slots and components slots props #4589

Merged
merged 6 commits into from
Apr 26, 2022

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Apr 21, 2022

Part of #4466

Goal

Clean the typing of the components and componentsProps props before expanding the usage of the pattern in future PRs.

  • The XXXSlotsComponent and XXXSlotsComponentsProps are not nullable, it is the XXXProps interface which has a Partial (like on the DataGrid)

  • If the components or componentsProps is defined in one of the interface extended by the current component AND this interface is not tightly linked to the new component, then redefine explicitly components and componentsProps (ie: do not redefine on DesktopDatePickerProps if defined on BaseDatePickerProps, but redefine on CalendarPickerProps if defined on PickersCalendarHeader)

What's next ?

  • Add JSDoc to the existing components and there componentsProps
  • Add a componentsProps for each existing components like on the DataGrid
  • Move the props.XXXXProps and props.XXXXComponent (PopperProps, TransitionComponent, ...) to the slot pattern
  • Improve doc generation for the slots of the pickers

@mui-bot
Copy link

mui-bot commented Apr 21, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 284.3 504.3 407.9 389.6 75.975
Sort 100k rows ms 557.5 1,250 789.6 888.72 227.524
Select 100k rows ms 194.7 405.2 297.2 302.14 85.297
Deselect 100k rows ms 157.7 215.4 171.8 181.94 21.262

Generated by 🚫 dangerJS against 38f8e3f


const releaseInfo = getReleaseInfo();

interface BaseDateRangePickerProps<TDate>
Copy link
Member Author

Choose a reason for hiding this comment

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

This interface was a copy paste of the one in DateRangePicker/shared

@flaviendelangle flaviendelangle added the component: pickers This is the name of the generic UI component, not the React module! label Apr 21, 2022
@flaviendelangle flaviendelangle marked this pull request as ready for review April 21, 2022 08:42
@flaviendelangle flaviendelangle merged commit ebb0e3b into mui:master Apr 26, 2022
@flaviendelangle flaviendelangle deleted the slots-picker branch April 26, 2022 09:41
@flaviendelangle flaviendelangle restored the slots-picker branch May 25, 2022 15:12
@flaviendelangle flaviendelangle deleted the slots-picker branch May 25, 2022 15:17
alexfauquette pushed a commit to alexfauquette/mui-x that referenced this pull request Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants