diff --git a/packages-internal/babel-plugin-minify-errors/__fixtures__/error-code-extraction/input.js b/packages-internal/babel-plugin-minify-errors/__fixtures__/error-code-extraction/input.js index 99d12277d9fe4c..0cc2982ad5f3a3 100644 --- a/packages-internal/babel-plugin-minify-errors/__fixtures__/error-code-extraction/input.js +++ b/packages-internal/babel-plugin-minify-errors/__fixtures__/error-code-extraction/input.js @@ -1,2 +1,2 @@ -throw /* mui-minify-error */ new Error('exists'); -throw /* mui-minify-error */ new Error('will be created'); +throw /* minify-error */ new Error('exists'); +throw /* minify-error */ new Error('will be created'); diff --git a/packages-internal/babel-plugin-minify-errors/__fixtures__/interpolation/input.js b/packages-internal/babel-plugin-minify-errors/__fixtures__/interpolation/input.js index 3400caac942b45..bf99cee19dae5c 100644 --- a/packages-internal/babel-plugin-minify-errors/__fixtures__/interpolation/input.js +++ b/packages-internal/babel-plugin-minify-errors/__fixtures__/interpolation/input.js @@ -1,5 +1,5 @@ const foo = 'foo'; const bar = 'bar'; -throw /* mui-minify-error */ new Error(`MUI: ${foo}, ${bar}`); -throw /* mui-minify-error */ new Error(`MUI: ${foo}` + `, ${bar}`); -throw /* mui-minify-error */ new Error('MUI: ' + `${foo}, ${bar}`); +throw /* minify-error */ new Error(`MUI: ${foo}, ${bar}`); +throw /* minify-error */ new Error(`MUI: ${foo}` + `, ${bar}`); +throw /* minify-error */ new Error('MUI: ' + `${foo}, ${bar}`); diff --git a/packages-internal/babel-plugin-minify-errors/__fixtures__/literal/input.js b/packages-internal/babel-plugin-minify-errors/__fixtures__/literal/input.js index c0cfea02e60489..63567b147abee5 100644 --- a/packages-internal/babel-plugin-minify-errors/__fixtures__/literal/input.js +++ b/packages-internal/babel-plugin-minify-errors/__fixtures__/literal/input.js @@ -1,6 +1,6 @@ -throw /* mui-minify-error */ new Error( +throw /* minify-error */ new Error( 'MUI: Expected valid input target.\n' + 'Did you use `inputComponent`', ); -throw /* mui-minify-error */ new Error( +throw /* minify-error */ new Error( `MUI: Expected valid input target.\n` + `Did you use \`inputComponent\``, ); diff --git a/packages-internal/babel-plugin-minify-errors/__fixtures__/no-error-code-annotation/input.js b/packages-internal/babel-plugin-minify-errors/__fixtures__/no-error-code-annotation/input.js index f0a1c78d61ce55..be815c1b3427b2 100644 --- a/packages-internal/babel-plugin-minify-errors/__fixtures__/no-error-code-annotation/input.js +++ b/packages-internal/babel-plugin-minify-errors/__fixtures__/no-error-code-annotation/input.js @@ -1,3 +1,3 @@ -throw /* mui-minify-error */ new Error( +throw /* minify-error */ new Error( 'MUI: Expected valid input target.\n' + 'Did you use inputComponent', ); diff --git a/packages-internal/babel-plugin-minify-errors/__fixtures__/no-error-code-throw/input.js b/packages-internal/babel-plugin-minify-errors/__fixtures__/no-error-code-throw/input.js index 309b5471f4ec32..3c8d1a793d474b 100644 --- a/packages-internal/babel-plugin-minify-errors/__fixtures__/no-error-code-throw/input.js +++ b/packages-internal/babel-plugin-minify-errors/__fixtures__/no-error-code-throw/input.js @@ -1 +1 @@ -throw /* mui-minify-error */ new Error('missing'); +throw /* minify-error */ new Error('missing'); diff --git a/packages-internal/babel-plugin-minify-errors/__fixtures__/unminifyable-annotation/input.js b/packages-internal/babel-plugin-minify-errors/__fixtures__/unminifyable-annotation/input.js index f6ad4d6105e5f0..865fba71e2aa10 100644 --- a/packages-internal/babel-plugin-minify-errors/__fixtures__/unminifyable-annotation/input.js +++ b/packages-internal/babel-plugin-minify-errors/__fixtures__/unminifyable-annotation/input.js @@ -1,4 +1,4 @@ const foo = 'foo'; const bar = ['bar']; -throw /* mui-minify-error */ new Error(foo); -throw /* mui-minify-error */ new Error(...bar); +throw /* minify-error */ new Error(foo); +throw /* minify-error */ new Error(...bar); diff --git a/packages-internal/babel-plugin-minify-errors/__fixtures__/unminifyable-throw/input.js b/packages-internal/babel-plugin-minify-errors/__fixtures__/unminifyable-throw/input.js index f6ad4d6105e5f0..865fba71e2aa10 100644 --- a/packages-internal/babel-plugin-minify-errors/__fixtures__/unminifyable-throw/input.js +++ b/packages-internal/babel-plugin-minify-errors/__fixtures__/unminifyable-throw/input.js @@ -1,4 +1,4 @@ const foo = 'foo'; const bar = ['bar']; -throw /* mui-minify-error */ new Error(foo); -throw /* mui-minify-error */ new Error(...bar); +throw /* minify-error */ new Error(foo); +throw /* minify-error */ new Error(...bar); diff --git a/packages-internal/babel-plugin-minify-errors/index.js b/packages-internal/babel-plugin-minify-errors/index.js index 254be22c371a83..390c70a545d0e0 100644 --- a/packages-internal/babel-plugin-minify-errors/index.js +++ b/packages-internal/babel-plugin-minify-errors/index.js @@ -3,7 +3,7 @@ const helperModuleImports = require('@babel/helper-module-imports'); const fs = require('fs'); -const COMMENT_MARKER = 'mui-minify-error'; +const COMMENT_MARKER = 'minify-error'; /** * @typedef {import('@babel/core')} babel diff --git a/packages/mui-base/src/unstable_useNumberInput/useNumberInput.ts b/packages/mui-base/src/unstable_useNumberInput/useNumberInput.ts index b3b6ab6de523ff..3c3dc249904d5e 100644 --- a/packages/mui-base/src/unstable_useNumberInput/useNumberInput.ts +++ b/packages/mui-base/src/unstable_useNumberInput/useNumberInput.ts @@ -184,7 +184,7 @@ export function useNumberInput(parameters: UseNumberInputParameters): UseNumberI (otherHandlers: Partial) => (event: React.ChangeEvent & MuiCancellableEvent) => { if (!isControlled && event.target === null) { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( 'MUI: Expected valid input target. ' + 'Did you use a custom `slots.input` and forget to forward refs? ' + 'See https://mui.com/r/input-component-ref-interface for more info.', diff --git a/packages/mui-base/src/useInput/useInput.ts b/packages/mui-base/src/useInput/useInput.ts index 3dd07dc44ee5c2..a7bf95138a5b6c 100644 --- a/packages/mui-base/src/useInput/useInput.ts +++ b/packages/mui-base/src/useInput/useInput.ts @@ -139,7 +139,7 @@ export function useInput(parameters: UseInputParameters = {}): UseInputReturnVal if (!isControlled) { const element = event.target || inputRef.current; if (element == null) { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( 'MUI: Expected valid input target. ' + 'Did you use a custom `slots.input` and forget to forward refs? ' + 'See https://mui.com/r/input-component-ref-interface for more info.', diff --git a/packages/mui-material/src/InputBase/InputBase.js b/packages/mui-material/src/InputBase/InputBase.js index 341c425c8b5c49..54e1c8babea2a2 100644 --- a/packages/mui-material/src/InputBase/InputBase.js +++ b/packages/mui-material/src/InputBase/InputBase.js @@ -424,7 +424,7 @@ const InputBase = React.forwardRef(function InputBase(inProps, ref) { if (!isControlled) { const element = event.target || inputRef.current; if (element == null) { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( 'MUI: Expected valid input target. ' + 'Did you use a custom `inputComponent` and forget to forward refs? ' + 'See https://mui.com/r/input-component-ref-interface for more info.', diff --git a/packages/mui-material/src/Select/SelectInput.js b/packages/mui-material/src/Select/SelectInput.js index a6fd6fe6ccb87a..e8e7dc989c6808 100644 --- a/packages/mui-material/src/Select/SelectInput.js +++ b/packages/mui-material/src/Select/SelectInput.js @@ -371,7 +371,7 @@ const SelectInput = React.forwardRef(function SelectInput(props, ref) { if (multiple) { if (!Array.isArray(value)) { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( 'MUI: The `value` prop must be an array ' + 'when using the `Select` component with `multiple`.', ); diff --git a/packages/mui-material/src/styles/createPalette.js b/packages/mui-material/src/styles/createPalette.js index 67d76525c9a514..d3c47d9dfa9b32 100644 --- a/packages/mui-material/src/styles/createPalette.js +++ b/packages/mui-material/src/styles/createPalette.js @@ -222,14 +222,14 @@ export default function createPalette(palette) { } if (!color.hasOwnProperty('main')) { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `The color object needs to have a \`main\` property or a \`${mainShade}\` property.`, ); } if (typeof color.main !== 'string') { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.\n` + '\n' + diff --git a/packages/mui-material/src/styles/createThemeNoVars.js b/packages/mui-material/src/styles/createThemeNoVars.js index a16356cb747be6..713c3db3f57a76 100644 --- a/packages/mui-material/src/styles/createThemeNoVars.js +++ b/packages/mui-material/src/styles/createThemeNoVars.js @@ -24,7 +24,7 @@ function createThemeNoVars(options = {}, ...args) { } = options; if (options.vars) { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( 'MUI: `vars` is a private field used for CSS variables support.\n' + 'Please use another name.', ); diff --git a/packages/mui-material/src/styles/createThemeWithVars.js b/packages/mui-material/src/styles/createThemeWithVars.js index f3cdb6a49f2475..9e1fd9f76707e9 100644 --- a/packages/mui-material/src/styles/createThemeWithVars.js +++ b/packages/mui-material/src/styles/createThemeWithVars.js @@ -157,7 +157,7 @@ export default function createThemeWithVars(options = {}, ...args) { } if (!defaultScheme) { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( `MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid.`, ); } diff --git a/packages/mui-material/src/styles/index.js b/packages/mui-material/src/styles/index.js index 8c14dec1c6bf32..d98971ae31a471 100644 --- a/packages/mui-material/src/styles/index.js +++ b/packages/mui-material/src/styles/index.js @@ -19,7 +19,7 @@ export { unstable_createBreakpoints } from '@mui/system/createBreakpoints'; // TODO: Remove this function in v6. // eslint-disable-next-line @typescript-eslint/naming-convention export function experimental_sx() { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( 'MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.' + 'For more details, see https://github.com/mui/material-ui/pull/35150.', ); diff --git a/packages/mui-material/src/styles/makeStyles.js b/packages/mui-material/src/styles/makeStyles.js index 2a791811293687..7a22383ce7537a 100644 --- a/packages/mui-material/src/styles/makeStyles.js +++ b/packages/mui-material/src/styles/makeStyles.js @@ -1,5 +1,5 @@ export default function makeStyles() { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( 'MUI: makeStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.', diff --git a/packages/mui-material/src/styles/responsiveFontSizes.js b/packages/mui-material/src/styles/responsiveFontSizes.js index 3d0b197bdf384e..63d343fd8e328b 100644 --- a/packages/mui-material/src/styles/responsiveFontSizes.js +++ b/packages/mui-material/src/styles/responsiveFontSizes.js @@ -50,7 +50,7 @@ export default function responsiveFontSizes(themeInput, options = {}) { let { lineHeight } = style; if (!isUnitless(lineHeight) && !disableAlign) { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( 'MUI: Unsupported non-unitless line height with grid alignment.\n' + 'Use unitless line heights instead.', ); diff --git a/packages/mui-material/src/styles/withStyles.js b/packages/mui-material/src/styles/withStyles.js index ac19a003dcfe00..b8ca2dcb5df811 100644 --- a/packages/mui-material/src/styles/withStyles.js +++ b/packages/mui-material/src/styles/withStyles.js @@ -1,5 +1,5 @@ export default function withStyles() { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( 'MUI: withStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.', diff --git a/packages/mui-material/src/styles/withTheme.js b/packages/mui-material/src/styles/withTheme.js index 21123d5f632698..3c5d8f5ae62a1e 100644 --- a/packages/mui-material/src/styles/withTheme.js +++ b/packages/mui-material/src/styles/withTheme.js @@ -1,5 +1,5 @@ export default function withTheme() { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( 'MUI: withTheme is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.', diff --git a/packages/mui-system/src/colorManipulator/colorManipulator.js b/packages/mui-system/src/colorManipulator/colorManipulator.js index 5bac2ed9936e40..3bc8b02359ced3 100644 --- a/packages/mui-system/src/colorManipulator/colorManipulator.js +++ b/packages/mui-system/src/colorManipulator/colorManipulator.js @@ -68,7 +68,7 @@ export function decomposeColor(color) { const type = color.substring(0, marker); if (!['rgb', 'rgba', 'hsl', 'hsla', 'color'].includes(type)) { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( `MUI: Unsupported \`${color}\` color.\n` + 'The following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().', ); @@ -84,7 +84,7 @@ export function decomposeColor(color) { values[3] = values[3].slice(1); } if (!['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].includes(colorSpace)) { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( `MUI: unsupported \`${colorSpace}\` color space.\n` + 'The following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.', ); diff --git a/packages/mui-system/src/cssContainerQueries/cssContainerQueries.ts b/packages/mui-system/src/cssContainerQueries/cssContainerQueries.ts index 734220dce64182..532ca044dda7ed 100644 --- a/packages/mui-system/src/cssContainerQueries/cssContainerQueries.ts +++ b/packages/mui-system/src/cssContainerQueries/cssContainerQueries.ts @@ -57,7 +57,7 @@ export function getContainerQuery(theme: CssContainerQueries, shorthand: string) const matches = shorthand.match(/^@([^/]+)?\/?(.+)?$/); if (!matches) { if (process.env.NODE_ENV !== 'production') { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( `MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@\` or \`@/\`.\n` + 'For example, `@sm` or `@600` or `@40rem/sidebar`.', ); diff --git a/packages/mui-system/src/index.js b/packages/mui-system/src/index.js index f4e6dc4940a45c..4a4bb930f387fd 100644 --- a/packages/mui-system/src/index.js +++ b/packages/mui-system/src/index.js @@ -36,7 +36,7 @@ export { // TODO: Remove this function in v6 // eslint-disable-next-line @typescript-eslint/naming-convention export function experimental_sx() { - throw /* mui-minify-error */ new Error( + throw /* minify-error */ new Error( 'MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.' + 'For more details, see https://github.com/mui/material-ui/pull/35150.', ); diff --git a/packages/mui-utils/src/capitalize/capitalize.ts b/packages/mui-utils/src/capitalize/capitalize.ts index 851b46f51e1949..b4496bbbbd7def 100644 --- a/packages/mui-utils/src/capitalize/capitalize.ts +++ b/packages/mui-utils/src/capitalize/capitalize.ts @@ -4,7 +4,7 @@ // We only handle the first word. export default function capitalize(string: string): string { if (typeof string !== 'string') { - throw /* mui-minify-error */ new Error('MUI: `capitalize(string)` expects a string argument.'); + throw /* minify-error */ new Error('MUI: `capitalize(string)` expects a string argument.'); } return string.charAt(0).toUpperCase() + string.slice(1);