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][Divider] Add codemod for light prop removal #40947

Merged
merged 18 commits into from
Feb 7, 2024

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented Feb 5, 2024

@sai6855 sai6855 added component: divider This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material package: codemod Specific to @mui/codemod labels Feb 5, 2024
@sai6855 sai6855 changed the title [material-ui][DIvider] Add codemod for light prop removal [material-ui][Divider] Add codemod for light prop removal Feb 5, 2024
@mui-bot
Copy link

mui-bot commented Feb 5, 2024

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!

Can I ask you to add the corresponding section to the migration guide and the link from the deprecated prop (see this example)?

packages/mui-codemod/README.md Outdated Show resolved Hide resolved
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 @sai6855!

Seems like we're missing the translations file update, like here: https://github.com/mui/material-ui/pull/40767/files#diff-6c46f30fbca62a52385ccf14faa91a405365deb460022c9b442475a84e5fbe4c

It should be updated by pnpm docs:api

I don't know why the CI didn't notice though 🤔

packages/mui-codemod/README.md Outdated Show resolved Hide resolved
@sai6855
Copy link
Contributor Author

sai6855 commented Feb 6, 2024

I don't know why the CI didn't notice though 🤔

So, [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/) was in different line than @deprecated line, that's why CI didn't picked it up , fixed in this commit 35417d9

I think we missed adding it to this README though:

Sorry missed this!! Done in this commit 78fc792

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.

Some final details

The Divider's `light` prop was deprecated, Use `sx={{ opacity : "0.6" }}` (or any opacity). ([Codemod](https://github.com/mui/material-ui/tree/master/packages/mui-codemod#divider-props)):

```diff
<Accordion
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<Accordion
<Divider

@@ -30,7 +30,7 @@ export interface DividerOwnProps {
/**
* If `true`, the divider will have a lighter color.
* @default false
* @deprecated Use <Divider sx={{ bgcolor: '#eee' }} /> (or any color) instead.
* @deprecated Use <Divider sx={{ bgcolor: '#eee' }} /> (or any color) instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
Copy link
Member

Choose a reason for hiding this comment

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

Now that we added the codemod I would do:

Suggested change
* @deprecated Use <Divider sx={{ bgcolor: '#eee' }} /> (or any color) instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
* @deprecated Use <Divider sx={{ opacity: 0.6 }} /> (or any opacity or color) instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)

Signed-off-by: Diego Andai <diego@mui.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: divider This is the name of the generic UI component, not the React module! package: codemod Specific to @mui/codemod package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants