Skip to content
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

[code-infra] Reconfigure react-remove-properties babel plugin #45218

Merged
merged 12 commits into from
Mar 19, 2025
Merged
9 changes: 0 additions & 9 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ function resolveAliasPath(relativeToBabelConf) {
return `./${resolvedPath.replace('\\', '/')}`;
}

/** @type {babel.PluginItem[]} */
const productionPlugins = [
['babel-plugin-react-remove-properties', { properties: ['data-mui-test'] }],
];

/** @type {babel.ConfigFunction} */
module.exports = function getBabelConfig(api) {
const useESModules = api.env(['regressions', 'modern', 'stable']);
Expand Down Expand Up @@ -127,9 +122,6 @@ module.exports = function getBabelConfig(api) {
: []),
];

if (process.env.NODE_ENV === 'production') {
plugins.push(...productionPlugins);
}
if (process.env.NODE_ENV === 'test') {
plugins.push([
'babel-plugin-module-resolver',
Expand Down Expand Up @@ -198,7 +190,6 @@ module.exports = function getBabelConfig(api) {
},
benchmark: {
plugins: [
...productionPlugins,
[
'babel-plugin-module-resolver',
{
Expand Down
17 changes: 2 additions & 15 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
const path = require('path');
const fse = require('fs-extra');

const errorCodesPath = path.resolve(__dirname, './public/static/error-codes.json');

const { version: transformRuntimeVersion } = fse.readJSONSync(
require.resolve('@babel/runtime-corejs2/package.json'),
);
Expand All @@ -22,23 +19,13 @@ module.exports = {
},
],
],
plugins: [
[
'babel-plugin-macros',
{
muiError: {
errorCodesPath,
},
},
],
'babel-plugin-optimize-clsx',
],
plugins: ['babel-plugin-optimize-clsx'],
ignore: [/@babel[\\|/]runtime/], // Fix a Windows issue.
env: {
production: {
plugins: [
'@babel/plugin-transform-react-constant-elements',
['babel-plugin-react-remove-properties', { properties: ['data-mui-test'] }],
['babel-plugin-react-remove-properties'],
['babel-plugin-transform-react-remove-prop-types', { mode: 'remove' }],
],
},
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown/parseMarkdown.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ function createRender(context) {

return `<aside class="MuiCallout-root MuiCallout-${token.severity}">${[
'<div class="MuiCallout-icon-container">',
'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="ContentCopyRoundedIcon">',
'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24">',
`<use class="MuiCode-copied-icon" xlink:href="#${token.severity}-icon" />`,
'</svg>',
'</div>',
Expand Down
20 changes: 20 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.