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

[codemod] Fix experimentalFeatures codemod for typescript parser #14150

Conversation

MBilalShafi
Copy link
Member

@MBilalShafi MBilalShafi commented Aug 9, 2024

Fix #12874

Weirdly so, the tsx parser vs js parser sometimes behaves differently. It was the case with the removeObjectProperty utility being used in the experimentalFeatures codemod.

This can be visualized here. Try commenting the line 3 of the codemod script export const parser = "tsx"; to have the codemod remove the experimentalFeatures prop properly.

The typescript parser parses the node as ObjectProperty while the js parser parses as Property.

I was not aware of this and I think we should be mindful of testing with both compilers before shipping new codemods.

@MBilalShafi MBilalShafi added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! package: codemod Specific to @mui/codemod labels Aug 9, 2024
@mui-bot
Copy link

mui-bot commented Aug 9, 2024

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

Generated by 🚫 dangerJS against aca4177

@MBilalShafi MBilalShafi marked this pull request as ready for review August 9, 2024 12:05
@MBilalShafi MBilalShafi requested review from michelengelen and a team August 22, 2024 16:27
@MBilalShafi MBilalShafi enabled auto-merge (squash) September 3, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! package: codemod Specific to @mui/codemod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[codemod] mui-x 7.0 migration script
3 participants