Skip to content
New issue

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

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

Already on GitHub? # to your account

[material-ui][Drawer] Deprecate *Props and complete slots, slotProps #44960

Merged
merged 42 commits into from
Feb 6, 2025

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Jan 7, 2025

Part of #41281

This PR also include SwipeableDrawer because it has Drawer as a direct dependency.

  • Deprecate BackdropComponent, BackdropProps, PaperProps, SlideProps in favor of slots.backdrop, slotProps.backdrop, slotProps.paper, slotProps.transition respectively.
  • Adopt mergeSlotProps to handle callbacks properly.
  • Added a codemod (tested by transforming the drawer demos)
  • Updated the migration doc

Note: I decided not to deprecate ModalProps because it cannot be migrated to slotProps.root. This case is special because the DrawerRoot is a wrapper of Modal (a Material UI component), so the ModalProps must to be spread directly to Modal, not through slotProps.root.

Also, ModalProps cannot be spread directly to Drawer because it's specific to <Drawer variant="temporary">.


@siriwatknp siriwatknp added on hold There is a blocker, we need to wait component: drawer This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material component: SwipeableDrawer The React component. labels Jan 7, 2025
@mui-bot
Copy link

mui-bot commented Jan 7, 2025

Netlify deploy preview

SwipeableDrawer: parsed: +1.34% , gzip: +1.09%
Drawer: parsed: +1.22% , gzip: +0.94%
@material-ui/core: parsed: +0.14% , gzip: +0.12%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 6136688

@siriwatknp siriwatknp removed the on hold There is a blocker, we need to wait label Jan 8, 2025
@siriwatknp siriwatknp marked this pull request as ready for review January 9, 2025 09:59
@siriwatknp siriwatknp requested a review from DiegoAndai January 9, 2025 10:07
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 16, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 31, 2025
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 4, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 4, 2025
@siriwatknp siriwatknp requested a review from sai6855 February 4, 2025 09:39
@sai6855
Copy link
Contributor

sai6855 commented Feb 4, 2025

Few tests are failing after recent changes

Copy link
Contributor

@sai6855 sai6855 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

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

LGTM!

Two small comments about the slots' descriptions

packages/mui-material/src/Drawer/Drawer.d.ts Outdated Show resolved Hide resolved
packages/mui-material/src/Drawer/Drawer.d.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 5, 2025
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Feb 6, 2025
@siriwatknp siriwatknp enabled auto-merge (squash) February 6, 2025 06:04
@siriwatknp siriwatknp merged commit c2335e6 into mui:master Feb 6, 2025
22 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
component: drawer This is the name of the generic UI component, not the React module! component: SwipeableDrawer The React component. package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants