-
-
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][docs] Add deprecations migration guide #40767
[material-ui][docs] Add deprecations migration guide #40767
Conversation
Netlify deploy previewBundle size report |
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.
Maybe we should add a callout in the Accordion demo doc as well? If you're using the deprecated APIs and you land on that page, you'll be confused when you can't find any mention of them in the Transition section.
docs/data/material/migration/migrating-deprecations/migrating-deprecations.md
Outdated
Show resolved
Hide resolved
docs/data/material/migration/migrating-deprecations/migrating-deprecations.md
Outdated
Show resolved
Hide resolved
docs/data/material/migration/migrating-deprecations/migrating-deprecations.md
Outdated
Show resolved
Hide resolved
docs/data/material/migration/migrating-deprecations/migrating-deprecations.md
Outdated
Show resolved
Hide resolved
docs/data/material/migration/migrating-deprecations/migrating-deprecations.md
Outdated
Show resolved
Hide resolved
docs/data/material/migration/migrating-deprecations/migrating-deprecations.md
Outdated
Show resolved
Hide resolved
docs/data/material/migration/migrating-deprecations/migrating-deprecations.md
Outdated
Show resolved
Hide resolved
docs/data/material/migration/migrating-deprecations/migrating-deprecations.md
Outdated
Show resolved
Hide resolved
docs/data/material/migration/migrating-deprecations/migrating-deprecations.md
Outdated
Show resolved
Hide resolved
docs/data/material/migration/migrating-deprecations/migrating-deprecations.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Sam Sycamore <[email protected]> Signed-off-by: Diego Andai <[email protected]>
Hey @samuelsycamore, thanks for the review! I appreciate it 😊 The only ones I didn't apply:
Question: How do I fix the "Use a non-breaking space for brand name ('Material UI' instead of 'Material UI')" review dog issue? |
Through trial & error on #40403, I've found that using, e.g., |
@danilo-leal @DiegoAndai I could be wrong, but I believe it also works if you type a non-breaking space " " using |
Ah, cool — didn't know about this shortcut; appreciate it! Might be worth adding it to the style guide :) |
Yes good idea! I imagine this is going to trip people up for awhile. |
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.
tentatively approving before those pesky non-breaking spaces are added 😁
196c2d5
to
5f99aa8
Compare
5f99aa8
to
46623cb
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.
Question: How do I fix the "Use a non-breaking space for brand name ('Material UI' instead of 'Material UI')" review dog issue?
cc @oliviertassinari who added this rule recently to confirm.
I use option⌥
+ space
to generate a nonbreaking space. We were using Material-UI in the past to solve this problem, but we changed the name in https://mui.com/blog/material-ui-is-now-mui/. This error comes from #40525. Material UI
is a great option in JSX. For markdown, I'm not a fan, harder to read.
- TransitionComponent={CustomTransition} | ||
+ slots={{ transition: CustomTransition }} |
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.
I think we should follow the git diff format with our syntax connections (two space tab):
- TransitionComponent={CustomTransition} | |
+ slots={{ transition: CustomTransition }} | |
- TransitionComponent={CustomTransition} | |
+ slots={{ transition: CustomTransition }} |
x the other cases
|
||
### TransitionProps | ||
|
||
The Accordion's `TransitionProps` was deprecated in favor of `slotProps.transition` ([Codemod](https://github.com/mui/material-ui/tree/master/packages/mui-codemod#accordion-props)): |
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.
I think we should link to the default branch here so it continue to work even when we are on v6 next
branch
The Accordion's `TransitionProps` was deprecated in favor of `slotProps.transition` ([Codemod](https://github.com/mui/material-ui/tree/master/packages/mui-codemod#accordion-props)): | |
The Accordion's `TransitionProps` was deprecated in favor of `slotProps.transition` ([Codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#accordion-props)): |
x the other cases
import * as React from 'react'; | ||
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
import * as pageProps from 'docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md?@mui/markdown'; | ||
|
||
export default function Page() { | ||
return <MarkdownDocs {...pageProps} />; | ||
} |
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.
The file pathname casing is wrong
Actual: docs/pages/material-ui/migration/migrating-from-deprecated-APIs.js
Expected: docs/pages/material-ui/migration/migrating-from-deprecated-apis.js
it leads to two bugs:
- Side nav not expanded (why I looked in the first place, seemed strange):
- Console errors:
Can we fix it? :)
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.
Great to have this page 👍
|
||
### TransitionComponent | ||
|
||
The Accordion's `TransitionComponent` was deprecated in favor of `slots.transition` ([Codemod](https://github.com/mui/material-ui/tree/master/packages/mui-codemod#accordion-props)): |
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.
I think that we should explain why we are making each deprecation. The very first thing as I developer I would want to understand is why am I going through this pain, what do I get? For example, https://mui.com/material-ui/migration/migration-v3/ illustrates this, we tried to justify why each breaking change.
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.
Yes! We have two overarching deprecation initiatives: standardizing the slots pattern and removing composed classes. I considered adding an explanation of those and then linking accordingly in each deprecation. Would that make sense?
Thanks for the catches @oliviertassinari! handled in #40981 |
Part of: #40417
This PR adds the migration guide for current deprecations.
The idea is for this to be a "living" document:
Preview: https://deploy-preview-40767--material-ui.netlify.app/material-ui/migration/migrating-from-deprecated-apis