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] Add codemod parser flag (#29059) #29229

Merged
merged 2 commits into from
Oct 29, 2021

Conversation

ElonVolo
Copy link
Contributor

Fix for #29059. Adds that ability to pass jscodeshift parser options to codemod. Is important for users using flowtype who are doing migrations to v5.0.

@ElonVolo ElonVolo changed the title [codemod] Add parser flag (#29059) [codemod] Add codemod parser flag (#29059) Oct 22, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Oct 22, 2021

No bundle size changes

Generated by 🚫 dangerJS against 44af74e

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍 First awesome contribution! I have tested locally, it works!

@siriwatknp siriwatknp requested a review from eps1lon October 26, 2021 04:24
@eps1lon
Copy link
Member

eps1lon commented Oct 26, 2021

I would advise against merging this. The codemod cli is a convenience helper not a replacement for the jscodeshift helper. You should use jscodeshift directly if you need to adjust its options. Otherwise we end up re-implementing the jscodeshift CLI. But I won't be involved with the long term vision of this project anymore so this is not up to me.

@eps1lon eps1lon removed their request for review October 26, 2021 10:41
@siriwatknp
Copy link
Member

I would advise against merging this. The codemod cli is a convenience helper not a replacement for the jscodeshift helper. You should use jscodeshift directly if you need to adjust its options. Otherwise we end up re-implementing the jscodeshift CLI. But I won't be involved with the long term vision of this project anymore so this is not up to me.

Thanks for the info. Do you see another way to fix #29059?

@ElonVolo
Copy link
Contributor Author

I'm done.

@ElonVolo ElonVolo closed this Oct 27, 2021
@mnajdova
Copy link
Member

Why was the issue closed?

@mnajdova mnajdova reopened this Oct 27, 2021
@jennykortina
Copy link

👋🏽 I opened the original ticket. As a user of material UI and flow, I would expect to be able to use the upgrade script like so:

npx @mui/codemod v5.0.0/preset-safe ./ --no-babel --parser=flow

And for it to not crash. We have hundreds of files in our codebase that we use material UI, as the script currently is written only about 20% files actually get converted.

The script crashes anytime there is a maybe flow type (definition here) which I imagine a lot of users who use flow also use.

Thank you so much!

@siriwatknp
Copy link
Member

siriwatknp commented Oct 28, 2021

Why was the issue closed?

@mnajdova I am good with this change, what do you think? (at least I don't see other ways because we force the parser in the current version)

@mnajdova mnajdova merged commit 6926938 into mui:master Oct 29, 2021
@jennykortina
Copy link

Thanks all! If I yarn add @mui/material @emotion/react @emotion/styled now will this change be in there or do I need to wait for y'all to bump the version? Thanks so much!

@siriwatknp
Copy link
Member

Thanks all! If I yarn add @mui/material @emotion/react @emotion/styled now will this change be in there or do I need to wait for y'all to bump the version? Thanks so much!

The codemod release will be next week around Monday.

@jennykortina
Copy link

jennykortina commented Nov 1, 2021

@siriwatknp thanks so much! Where do I check to see if the code release went out/did it go out?

@siriwatknp
Copy link
Member

@siriwatknp thanks so much! Where do I check to see if the code release went out/did it go out?

You can check it here (the next release is likely 5.0.7). https://github.com/mui-org/material-ui/releases

@zannager zannager added the package: codemod Specific to @mui/codemod label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: codemod Specific to @mui/codemod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants