Skip to content

Conversation

@siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Nov 3, 2025

Reported in #47007 (comment)

New doc page: https://deploy-preview-47164--material-ui.netlify.app/material-ui/customization/shape/

Root cause

Before the fix (#47007), the ThemeVars is using Theme['shape'], so the module augmentation on Theme also applied to ThemeVars
However, it's a cyclic inference which probably one of the root cause for TS performance spike.

The fix (#47007) removes the cyclic inference but causes the regression.

Fix

Both Theme and ThemeVars need to rely on a new interface Shape that extends the @mui/system's interface.

User now needs to augment the Shape instead of the Theme.

declare module "@mui/material/styles" {
  interface Shape {
    extraShape: string
  }
}
  • Test added

@siriwatknp siriwatknp added type: regression A bug, but worse, it used to behave as expected. customization: theme Higher level theming customizability. package: material-ui Specific to Material UI. labels Nov 3, 2025
@mui-bot
Copy link

mui-bot commented Nov 3, 2025

Netlify deploy preview

Bundle size report

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 63cf433

@siriwatknp siriwatknp requested a review from a team November 3, 2025 05:34
@zannager zannager added scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI and removed package: material-ui Specific to Material UI. labels Nov 3, 2025
Copy link
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good ~ tested with the Vite example repo: https://stackblitz.com/edit/github-nztqdw3a?file=src%2FApp.tsx

@siriwatknp siriwatknp merged commit 0c26c37 into mui:master Nov 4, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customization: theme Higher level theming customizability. scope: system The system, the design tokens / styling foundations used across components. eg. @mui/system with MUI type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants