-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[system] Skip styled component from being transformed #46129
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
Conversation
Netlify deploy previewhttps://deploy-preview-46129--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
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.
Hey @siriwatknp!
- Do you know when was this bug introduced?
- Have we checked if this change doesn't introduce other regressions? I'm worried that there are some objects we do want to serialize and might be skipped unintentionally after this change.
Since #43412 due to the preserialization. The full explanation is here.
All the tests are passed, so I don't think it will introduce other regression. I added a test for component selector, so that it prevents the regression in the future. Please review the code again, I refactored to return the style earlier when it's a styled component from Emotion. |
Thanks for the refactor and explanation. One question, as I'm not very familiar with Emotion internals: What is |
Emotion attaches const Child = styled('div')``;
// Child.__emotion_real = Child
const Parent = styled(Child)``; << there is a logic within `styled` to use proper `shouldForwardProps` based on the tag. |
Cherry-pick PRs will be created targeting branches: v6.x |
closes #46102
The root cause is explained here.
Added a regression test to ensure that the component selector works (see https://app.argos-ci.com/mui/material-ui/builds/38372/159820872).