-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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 optimal-imports
to support v4 and v5-alpha, beta
#28812
Conversation
The The implemented changes would not work if someone upgraded to some v5 alpha version and then run the codemod. So maybe, in the end, the best solution would be to use the cc @eps1lon for thoughts. |
@mnajdova Got it. added |
optimal-imports
v5 to look for es
folderoptimal-imports
to support v4 and v5-alpha, beta
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.
This makes sense to me 👍 Thanks @siriwatknp
The codemod should not transform these paths. It should only transform supported paths and give up on everything else. To catch unsupported paths we can recommend the way we do it via Eslint. Trying to guess the correct path from an unsupported path is a constant uphill battle. I would not recommend it though it's no longer my decision. |
Noted on this point to consider in the future. But I think this PR also help people with the migration which also benefit us with less issue (I hope), so I am merging it. |
Open as draft to discuss about this change. I can reproduce with
@material-ui/core
latest(4.12.3) that codemod cannot transformimport blueGrey from "@material-ui/core/colors/blueGrey";
Got the same error as in #28542
but by using
/es/
folder, it works. @mnajdova what is the reason to use/modern/
at that time?