Skip to content

[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

Merged
merged 17 commits into from
May 22, 2025

Conversation

JCQuintas
Copy link
Member

@JCQuintas JCQuintas self-assigned this May 19, 2025
Copy link

github-actions bot commented May 19, 2025

Thanks for adding a type label to the PR! 👍

@JCQuintas JCQuintas added test core Infrastructure work going on behind the scenes enhancement This is not a bug, nor a new feature scope: code-infra Specific to the core-infra product labels May 19, 2025
@mui-bot
Copy link

mui-bot commented May 19, 2025

Deploy preview: https://deploy-preview-17903--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 56deab8

Comment on lines 10 to 18
plugins: [
babel({
babelConfig: {
plugins: ['@mui/internal-babel-plugin-display-name'],
babelrc: false,
configFile: false,
},
}),
],
Copy link
Contributor

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.

Copy link
Member Author

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)

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 20, 2025
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label May 21, 2025
@@ -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;
Copy link
Member Author

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.

https://app.circleci.com/pipelines/github/mui/mui-x/92158/workflows/efcac4b3-6861-4171-b28c-b67d80af2cbb/jobs/538493

@romgrk romgrk reopened this May 21, 2025
@JCQuintas JCQuintas changed the title try custom babel vitest [code-infra] Enable babel-plugin-display-name in vitest May 22, 2025
@JCQuintas JCQuintas requested review from a team and romgrk May 22, 2025 09:50
@JCQuintas JCQuintas marked this pull request as ready for review May 22, 2025 09:50
],
],
babelrc: false,
configFile: false,
Copy link
Member

Choose a reason for hiding this comment

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

👌

@JCQuintas JCQuintas merged commit bfa8b29 into mui:master May 22, 2025
23 checks passed
@JCQuintas JCQuintas deleted the run-custom-babel-vitest branch May 22, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes enhancement This is not a bug, nor a new feature scope: code-infra Specific to the core-infra product test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants