-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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][Typography] Deprecate paragraph
prop
#42383
[material-ui][Typography] Deprecate paragraph
prop
#42383
Conversation
Netlify deploy previewBundle size report |
<Typography paragraph>
propparagraph
prop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @walston! I left a small comment. Apart from that, deprecating the paragraph
prop in Typography
requires some more work:
- Deprecate the corresponding class name:
.MuiTypography-paragraph
. You can add a @deprecated JSDoc tag to where it's defined: https://github.com/mui/material-ui/blob/next/packages/mui-material/src/Typography/typographyClasses.ts#L47-L48 - Run
pnpm proptypes && pnpm docs:api
and commit the generated changes. These commands copy the corresponding code comments from .d.ts to .js files and update the corresponding .json files that the docs will read when building the docs website. - Document both deprecations (prop and class name) in the Migrating from deprecated APIs page (code). We can take inspiration from other deprecated props/class names documented on that very page. Remember to sort the newly added section alphabetically.
- Remove all usages of
paragraph
within the codebase. The prop is being used in around 20 files. Maybe replacingparagraph
withcomponent="p" gutterBottom
in some cases is fine, but the spacing will certainly change and this will cause some visual regression tests to fail. We'll need to check case by case.
Remember to read the contributing guidelines and feel free to ping me if you need help.
thanks so much for the instructions @aarongarciah. Happy to make those changes later today. |
Hey @walston! Did you have a chance to take a look? We want to land this on v6, which should be out in the next few weeks. |
oh dang. I'd love that. Apologies, got caught up with a company onsite. I can spend some time working through these things next week. Top of my priorities list now! |
@aarongarciah As I update the migration doc, it looks like there's an expectation there will be a codemod to handle this... Am I expected to write that codemod? |
@walston in this case, I think a codemod doesn't make sense because there's no direct replacement for the
We could codemod number 1 with Even if it was possible, you could ask us to pick it up if you can't do it. |
@aarongarciah I'm working with @walston to get this over the finish line :)
For 1: I don't think we event need to add the component prop, since For 2: Would we want to suggest adding |
Hey @arronhunt! Thanks for working on this. From your comment I'm not sure if you're working on a codemod or not. Just in case, I think we shouldn't spend time in a codemod. Instead, we can focus on writing clear guidance on what changed in the Migrating from deprecated APIs page given we can't possibly know users' intent and where the styles are coming from.
The tag being rendered by
It's fine to omit
We'll remove system props (e.g. |
Hey @arronhunt @walston! Let me know if you need any help. |
@aarongarciah I just pushed updates to the docs, using |
docs/data/material/getting-started/templates/blog/FeaturedPost.js
Outdated
Show resolved
Hide resolved
docs/data/material/getting-started/templates/blog/FeaturedPost.tsx
Outdated
Show resolved
Hide resolved
docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md
Outdated
Show resolved
Hide resolved
@DiegoAndai I just updated the codemod to cater for |
Co-authored-by: Aarón García Hervás <[email protected]> Signed-off-by: Nathan Walston <[email protected]>
Missed a few props, whoops. One more push coming after this. Co-authored-by: Aarón García Hervás <[email protected]> Signed-off-by: Arron Hunt <[email protected]>
e0cc8c7
to
78ffcca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 🚀
Thanks @walston @arronhunt for working on this! |
Signed-off-by: Nathan Walston <[email protected]> Signed-off-by: Arron Hunt <[email protected]> Co-authored-by: Aarón García Hervás <[email protected]> Co-authored-by: Arron Hunt <[email protected]> Co-authored-by: Arron Hunt <[email protected]> Co-authored-by: Aarón García Hervás <[email protected]>
Resolves #42382, resolves #16926