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

[material-ui][Rating] Deprecate *Props and complete slots, slotProps #45295

Merged
merged 13 commits into from
Feb 24, 2025

Conversation

harry-whorlow
Copy link
Contributor

part of #41281

This PR adds slot the slot prop to rating, whilst deprecating components.

props.iconContainerComponent -> slot.iconContainer

[/] I have followed (at least) the PR section of the contributing guide.

@harry-whorlow harry-whorlow changed the title Add Slots and SlotProps to rating Add Slots to rating Feb 12, 2025
@mui-bot
Copy link

mui-bot commented Feb 12, 2025

Netlify deploy preview

Rating: parsed: +3.03% , gzip: +2.73%
@material-ui/core: parsed: +0.12% , gzip: +0.15%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 33fdbfe

@siriwatknp
Copy link
Member

@harry-whorlow Thanks for your contribution. I was working on this before I went on holiday last week, so let me take over this PR.

Note, the IconContainerComponent is not a slot (based on the prior code), it should be updated to slotProps.icon.component instead.

@siriwatknp siriwatknp marked this pull request as ready for review February 17, 2025 08:12
@harry-whorlow
Copy link
Contributor Author

harry-whorlow commented Feb 17, 2025

@siriwatknp ah I see, sure thing take it away... 🤟

Out of curiosity, was the reason the pnpm proptypes not updating was because I needed to extend RatingOwnProps and the RatingTypeMap instead of one or the other?

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍 Thanks for your contribution!

I'll let @DiegoAndai do the final review.

@zannager zannager added the component: rating This is the name of the generic UI component, not the React module! label Feb 17, 2025
@siriwatknp siriwatknp changed the title Add Slots to rating [material-ui][Rating] Deprecate *Props and complete slots, slotProps Feb 18, 2025
@siriwatknp siriwatknp added the needs cherry-pick The PR should be cherry-picked to master after merge label Feb 18, 2025
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.

Comment on lines -535 to -538
{
// TODO v6: remove this class as it duplicates with the global state class Mui-readOnly
'MuiRating-readOnly': readOnly,
},
Copy link
Member

Choose a reason for hiding this comment

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

I agree with removing this, but we should add it to the upgrade guide: https://github.com/mui/material-ui/blob/master/docs/data/material/migration/upgrade-to-v7/upgrade-to-v7.md

@harry-whorlow harry-whorlow force-pushed the depricate-rating-component branch from 1368bef to bde43b0 Compare February 19, 2025 19:07
@harry-whorlow
Copy link
Contributor Author

harry-whorlow commented Feb 19, 2025

@DiegoAndai, thank's but @siriwatknp deserves the credit on this one! I've rebased master and updated the migration to note the removal of MuiRating-readOnly. 🤟

I'll add to the migration api docs in the morning.

@DiegoAndai DiegoAndai merged commit 6931d9f into mui:master Feb 24, 2025
22 checks passed
Copy link

Cherry-pick PRs will be created targeting branches: v6.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: rating This is the name of the generic UI component, not the React module! needs cherry-pick The PR should be cherry-picked to master after merge v6.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants