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] Stop using the WrapperVariantContext in MonthCalendar and YearCalendar #7382

Merged
merged 13 commits into from
Jan 12, 2023

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Jan 3, 2023

Part of #7372

Changelog

Breaking changes

  • The modeMobile and modeDesktop classes have been removed from the PickersMonth and PickersYear internal components.

    If you were using those classes on responsive components,
    you can import DEFAULT_DESKTOP_MODE_MEDIA_QUERY from @mui/x-date-pickers or @mui/x-date-pickers-pro (or use your custom media query if any):

     <GlobalStyles
       styles={{
    -    [`.${pickersYearClasses.modeDesktop}`]: {
    -      backgroundColor: 'red'
    -    }
    +    [DEFAULT_DESKTOP_MODE_MEDIA_QUERY]: {
    +      [`.${pickersYearClasses.root}`]: {
    +        backgroundColor: 'red'
    +      }
    +    }
    -    [`.${pickersYearClasses.modeMobile}`]: {
    -      backgroundColor: 'red'
    -    }
    +    [DEFAULT_DESKTOP_MODE_MEDIA_QUERY.replace('@media', '@media not')]: {
    +      [`.${pickersYearClasses.root}`]: {
    +        backgroundColor: 'red'
    +      }
    +    }
       }}
     />

    Works exactly the same way for PickersMonth

@flaviendelangle flaviendelangle self-assigned this Jan 3, 2023
@flaviendelangle flaviendelangle added breaking change component: pickers This is the name of the generic UI component, not the React module! labels Jan 3, 2023
@mui-bot
Copy link

mui-bot commented Jan 3, 2023

Messages
📖 Netlify deploy preview: https://deploy-preview-7382--material-ui-x.netlify.app/

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 672.2 1,161.7 672.2 928.48 179.938
Sort 100k rows ms 795.5 1,309.1 1,309.1 1,040.2 197.169
Select 100k rows ms 190.8 329.7 308.1 280.86 51.95
Deselect 100k rows ms 184.6 354.6 222.5 248.9 61.217

Generated by 🚫 dangerJS against 68edf42

@flaviendelangle flaviendelangle marked this pull request as ready for review January 6, 2023 15:20
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 9, 2023
@github-actions
Copy link

github-actions bot commented Jan 9, 2023

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

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

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

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

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

Looking great ❤️
Leaving a few nitpick comments.

@flaviendelangle
Copy link
Member Author

@LukasTy I added a migration guide
I think almost nobody uses this so maybe we can even skip the variable export and hardcode the media query on the diff.

Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

Great work! 🚀
This had a lot of small moving parts. 🙈

I added a migration guide
I think almost nobody uses this so maybe we can even skip the variable export and hardcode the media query on the diff.

Indeed, probably 0.1% would have depended on those classes, but better to account for those than to handle issues later down the line. 👍

@flaviendelangle flaviendelangle merged commit bf48ee0 into mui:next Jan 12, 2023
@flaviendelangle flaviendelangle deleted the items-per-row branch January 12, 2023 08:45
@LukasTy LukasTy added the v6.x label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: pickers This is the name of the generic UI component, not the React module! v6.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants