[BREAKING CHANGE][styles] Remove deprecated v6 exports from @mui/material/styles#48588
[BREAKING CHANGE][styles] Remove deprecated v6 exports from @mui/material/styles#48588silviuaavram wants to merge 2 commits into
Conversation
Deploy previewhttps://deploy-preview-48588--material-ui.netlify.app/ Bundle size
Check out the code infra dashboard for more information about this PR. |
There was a problem hiding this comment.
Pull request overview
Removes several deprecated v6-era exports from the @mui/material/styles public surface as part of the v7 breaking-change cleanup. The deprecated public CssVarsProvider is collapsed into an internal alias still consumed by ThemeProvider, while Experimental_CssVarsProvider, getInitColorSchemeScript, experimental_extendTheme, experimental_sx, and createStyles are removed entirely (source files, type declarations, and barrel exports).
Changes:
- Drop
createStyles,experimental_sx, andexperimental_extendThemefrom both JS and TS barrels and delete their source/declaration files. - Inline the previous public
CssVarsProviderexport asInternalCssVarsProviderand remove theExperimental_CssVarsProviderandgetInitColorSchemeScriptwrappers. - Update
ThemeProvider.tsxto import the renamed internal alias.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
packages/mui-material/src/styles/ThemeProviderWithVars.tsx |
Removes CssVarsProvider, Experimental_CssVarsProvider, getInitColorSchemeScript and exposes only InternalCssVarsProvider + useColorScheme. |
packages/mui-material/src/styles/ThemeProvider.tsx |
Renames import to InternalCssVarsProvider as CssVarsProvider to track the new internal export name. |
packages/mui-material/src/styles/index.js |
Removes barrel exports for createStyles, experimental_sx, and experimental_extendTheme. |
packages/mui-material/src/styles/index.d.ts |
Removes corresponding type-level barrel exports. |
packages/mui-material/src/styles/experimental_extendTheme.js |
Deletes the deprecated wrapper that warned and forwarded to extendTheme. |
packages/mui-material/src/styles/createStyles.js |
Deletes the deprecated JSS-era no-op helper. |
packages/mui-material/src/styles/createStyles.d.ts |
Deletes the matching type declaration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const CssVarsProvider = InternalCssVarsProvider; | ||
|
|
||
| export { useColorScheme, getInitColorSchemeScript, Experimental_CssVarsProvider }; | ||
| export { InternalCssVarsProvider }; |
| export const CssVarsProvider = InternalCssVarsProvider; | ||
|
|
||
| export { useColorScheme, getInitColorSchemeScript, Experimental_CssVarsProvider }; | ||
| export { InternalCssVarsProvider }; |
| @@ -45,7 +36,6 @@ export { default as withTheme } from './withTheme'; | |||
|
|
|||
| export * from './ThemeProviderWithVars'; | |||
This PR removes several deprecated exports that were scheduled for removal in v7:
createStyles— was a no-op helper from the@mui/styles(JSS) era. Removed source file, type declaration, and barrel export.experimental_extendTheme— alias forextendThemeadded during the CSS variables rollout. Removed source file and barrel export. UseextendThemeinstead.experimental_sx— error-throwing stub left aftersxwas moved totheme.unstable_sx. Removed from both JS and type declaration barrels.CssVarsProvider— deprecated alias forThemeProvider. Removed the public export; it remains an internal implementation detail used byThemeProvider.Experimental_CssVarsProvider— deprecated wrapper aroundCssVarsProviderthat logged a console warning. Removed entirely.getInitColorSchemeScript— deprecated wrapper that logged a warning directing users to<InitColorSchemeScript />. Removed entirely.