-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[code-infra] Enable babel-plugin-display-name
in vitest
#17903
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
Conversation
JCQuintas
commented
May 19, 2025
- I have followed (at least) the PR section of the contributing guide.
Thanks for adding a type label to the PR! 👍 |
Deploy preview: https://deploy-preview-17903--material-ui-x.netlify.app/ |
vitest.shared.mts
Outdated
plugins: [ | ||
babel({ | ||
babelConfig: { | ||
plugins: ['@mui/internal-babel-plugin-display-name'], | ||
babelrc: false, | ||
configFile: false, | ||
}, | ||
}), | ||
], |
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 for looking into this 👍
It might be nice to import our actual babel.config.js
as the config there, we have a few plugins that modify the code so it would be nice to test under the same conditions that our code actually runs in production.
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.
Yeah, but it seems we had decided not to run our babel config in vitest, it would probably require a lot of changes too #17845 (comment)
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@@ -68,7 +68,7 @@ interface DataGridComponent { | |||
* API: | |||
* - [DataGrid API](https://mui.com/x/api/data-grid/data-grid/) | |||
*/ | |||
export const DataGrid = React.memo(DataGridRaw) as DataGridComponent; | |||
export const DataGrid = React.memo(forwardRef(DataGridRaw)) as DataGridComponent; |
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.
Moved the forwardRef inside the memo to prevent the component name being DataGridRaw
, though I don't know if this is ok. I would expect so, since the entire thing is memoized anyways.
babel-plugin-display-name
in vitest
], | ||
], | ||
babelrc: false, | ||
configFile: false, |
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.
👌