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
[Fix] Bring experimental_sx
back with error code
#35528
Conversation
|
packages/mui-system/src/index.js
Outdated
export function experimental_sx() { | ||
throw new MuiError( | ||
'MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.' + | ||
'You should remove the import and replace the usage with `theme.unstable_sx(…same value you pass to experimental_sx)` instead.', |
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.
Is there a specific reason why we don't use the same error message?
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.
I feel a bit strange linking the MUI system to Material UI docs.
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.
Alright fair enough. Should we keep ""MUI: The experimental_sx
has been moved to theme.unstable_sx
.For more details, see #35150" instead of the current value. There are three new error messages in error-codes.js
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.
fine for me.
docs/public/static/error-codes.json
Outdated
"20": "MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.For more details, see https://github.com/mui/material-ui/pull/35150", | ||
"21": "MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.To migrate, see https://mui.com/material-ui/customization/theme-components/#the-sx-syntax-experimental", | ||
"22": "MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.You should remove the import and replace the usage with `theme.unstable_sx(…same value you pass to experimental_sx)` instead.", | ||
"23": "MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.For more details, see https://github.com/mui/material-ui/pull/35150." |
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.
"20": "MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.For more details, see https://github.com/mui/material-ui/pull/35150", | |
"21": "MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.To migrate, see https://mui.com/material-ui/customization/theme-components/#the-sx-syntax-experimental", | |
"22": "MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.You should remove the import and replace the usage with `theme.unstable_sx(…same value you pass to experimental_sx)` instead.", | |
"23": "MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.For more details, see https://github.com/mui/material-ui/pull/35150." | |
"20": "MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.For more details, see https://github.com/mui/material-ui/pull/35150." |
I believe this is sufficient now.
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.
Thanks, my bad. I thought that the script would reset and collect the new one.
close #35501
To prevent the import error for those who install Material UI 5.10.x without an explicit MUI system.