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

[codemod] Add utils for *Component and *Props props deprecations #41685

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

DiegoAndai
Copy link
Member

@DiegoAndai DiegoAndai commented Mar 27, 2024

Part of #41281

Add movePropIntoSlots and movePropIntoSlotProps utils for creating codemods, simplifying the development of new codemods for the *Component and *Props props deprecations.

Use these new utils on the existing *Component and *Props props deprecations and add tests for edge cases.

@DiegoAndai DiegoAndai added the package: codemod Specific to @mui/codemod label Mar 27, 2024
@DiegoAndai DiegoAndai requested a review from sai6855 March 27, 2024 15:56
@DiegoAndai DiegoAndai self-assigned this Mar 27, 2024
Comment on lines -14 to -16
}}
slotProps={{
root: { className: 'foo' },
Copy link
Member Author

Choose a reason for hiding this comment

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

slotProps is not modified in the backdrop-props codemod, so there's no need for it on the test case. Same for line 22.

@@ -8,17 +8,18 @@ import { Backdrop as MyBackdrop } from '@mui/material';
slots={{
root: 'div',
}}
slotProps={{
Copy link
Member Author

Choose a reason for hiding this comment

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

slotProps is not modified in the backdrop-props codemod, so there's no need for it on the test case. Same for line 20.

@mui-bot
Copy link

mui-bot commented Mar 27, 2024

Netlify deploy preview

https://deploy-preview-41685--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against f837591

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!!

@DiegoAndai DiegoAndai merged commit ba4fcad into mui:next Apr 10, 2024
20 checks passed
@DiegoAndai DiegoAndai deleted the component-prop-codemod-util branch April 10, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: codemod Specific to @mui/codemod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants