-
-
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
[core] v6 emotion-less css & styled prototype #44247
base: master
Are you sure you want to change the base?
Conversation
const resolvedStyleOverrides = {}; | ||
|
||
// TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly | ||
// eslint-disable-next-line guard-for-in | ||
for (const slotKey in styleOverrides) { | ||
resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey]); | ||
} | ||
|
||
return overridesResolver(props, resolvedStyleOverrides); |
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.
@siriwatknp Sidenote but this is part of what can be optimized, right now the whole styleOverrides
is re-processed each render for each slot, even if overridesResolver
only selects a small slice on the styleOverrides
. It should be stable as long as theme
is stable, so we should be able to pre-serialize & memo this. Same for theme variants.
182151b
to
bdaf9f9
Compare
Netlify deploy previewhttps://deploy-preview-44247--material-ui.netlify.app/ createStyled: parsed: +4.65% , gzip: +3.44% Bundle size reportDetails of bundle changes (Toolpad) |
Prototype for emotion-less styling.
DataGrid PR: mui/mui-x#15160