[core] Remove styled from @material-ui/styles in core#26101
Merged
[core] Remove styled from @material-ui/styles in core#26101
styled from @material-ui/styles in core#26101Conversation
|
@material-ui/core: parsed: -0.19% 😍, gzip: -0.20% 😍 |
mnajdova
commented
May 3, 2021
mnajdova
commented
May 3, 2021
| const { className, ...other } = props; | ||
| const classes = useStyles(); | ||
|
|
||
| return <MarkdownElement className={clsx(classes.root, className)} {...other} />; |
Member
Author
There was a problem hiding this comment.
MarkdownElement is build with JSS, we cannot override with emotion currently, so just temporary replacing styled() with makeStyles().
mnajdova
commented
May 3, 2021
| return importPath.replace(stylesSrcPath, '@material-ui/styles'); | ||
| } | ||
|
|
||
| const systemSrcPath = path.posix.join('..', 'material-ui-system', 'src'); |
Member
Author
There was a problem hiding this comment.
The build was failing without this, as the system is referenced in the experimentalStyled().
Member
There was a problem hiding this comment.
We can strip these fixes in TypeScript 4.3. Their current dev build no longer requires manual rewriting.
Member
Author
There was a problem hiding this comment.
Perfect, I was confused why it was failing at the beginning. It's great that we can drop them 👍
oliviertassinari
approved these changes
May 3, 2021
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
42 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One step toward the removal of
@material-ui/stylesin v6.Breaking changes
The
styledJSS utility is no longer exported from@material-ui/core/styles. You can use@material-ui/styles/styledinstead. Make sure to add aThemeProviderat the root of your application, as thedefaultThemeis no longer available. If you are using this utility together with@material-ui/core, it's recommended you use theThemeProvidercomponent from@material-ui/core/stylesinstead.