Skip to content

Conversation

@sai6855
Copy link
Contributor

@sai6855 sai6855 commented Feb 5, 2024

@sai6855 sai6855 added scope: divider Changes related to the divier. package: material-ui package: codemod Specific to 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
@sai6855 sai6855 requested a review from DiegoAndai February 5, 2024 07:54
@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)?

@sai6855 sai6855 requested a review from DiegoAndai February 6, 2024 17:21
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 🤔

@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

* 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/)

@sai6855 sai6855 requested a review from DiegoAndai February 7, 2024 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: codemod Specific to codemod. scope: divider Changes related to the divier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants