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][FormControlLabel] deprecate componentsProps #41767

Merged
merged 20 commits into from
Apr 26, 2024

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented Apr 4, 2024

part of #41279

@sai6855 sai6855 added docs Improvements or additions to the documentation deprecation New deprecation message package: material-ui Specific to @mui/material component: FormControl The React component labels Apr 4, 2024
@mui-bot
Copy link

mui-bot commented Apr 4, 2024

Netlify deploy preview

FormControlLabel: parsed: +3.63% , gzip: +3.22%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 8b21fdb

@sai6855 sai6855 marked this pull request as draft April 4, 2024 05:55
ownerState,
});

delete typographySlotProps.ownerState;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not entirely sure why deleting ownerState worked, but i looked previous PR's and accordion followed same pattern here https://github.com/mui/material-ui/pull/40418/files#diff-bbc688afec7bc090b1ad7bfd26cc2bedf991eca6fa3d2941b3dcbe04b3ee70a6R183

Copy link
Member

Choose a reason for hiding this comment

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

The accordion case was due to #40653

Is something similar happening in the typography component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in this commit 60d13f6

Copy link
Member

Choose a reason for hiding this comment

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

May I ask you to split that fix into a different PR? That way, the history is cleaner, and we can revert the changes independently if necessary. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, here is the PR -> #41903. once it is merged, i'll merge next branch and ping you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@DiegoAndai as #41903 is merged, this PR is ready for review

@sai6855 sai6855 requested a review from DiegoAndai April 4, 2024 16:44
@sai6855 sai6855 marked this pull request as ready for review April 4, 2024 16:44
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.

Thanks for working on this @sai6855!

ownerState,
});

delete typographySlotProps.ownerState;
Copy link
Member

Choose a reason for hiding this comment

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

The accordion case was due to #40653

Is something similar happening in the typography component?

@sai6855 sai6855 requested a review from DiegoAndai April 10, 2024 05:26
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.

Nice work @sai6855! I only have one question

@@ -18,17 +18,11 @@ describe('<FormControlLabel />', () => {
render,
muiName: 'MuiFormControlLabel',
testVariantProps: { disabled: true },
testLegacyComponentsProp: true,
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to remove this? If not, I would remove it when we remove componentsProps

Copy link
Contributor Author

@sai6855 sai6855 Apr 25, 2024

Choose a reason for hiding this comment

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

got it makes sense, restored this line and made testLegacyComponentsProp to false

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking we keep

testLegacyComponentsProp: true,

Or does that fail?

Copy link
Contributor Author

@sai6855 sai6855 Apr 26, 2024

Choose a reason for hiding this comment

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

Tests are failing on keeping it to true.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I see what happened. The testLegacyComponentsProp only applies to the slots-related tests. Previously, it was true, but the slots-related tests were skipped, so testLegacyComponentsProp: true had no effect. As we stop skipping the slots tests, this flag has an effect, and because the component only has componentsProps and no components, the test fails.

Let's remove testLegacyComponents: true as you did initially. It should've never been added and was probably copy-pasted. Sorry for the confusion; my bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no problem :)
removed testLegacyComponents

@sai6855 sai6855 force-pushed the deprecate-componentProps-formcontrollabel branch from 25d6373 to a09473e Compare April 25, 2024 07:11
@sai6855 sai6855 force-pushed the deprecate-componentProps-formcontrollabel branch from 574599e to 8b21fdb Compare April 26, 2024 15:51
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.

Nice work @sai6855

@DiegoAndai DiegoAndai merged commit 5864bbd into mui:next Apr 26, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: FormControl The React component deprecation New deprecation message docs Improvements or additions to the documentation package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants