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 v5 important migration #27032

Merged
merged 85 commits into from Jul 12, 2021
Merged

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Jun 30, 2021

Summary

unit tests increase from 45 to 125 πŸš€

The main transform is preset-migration that combine most of the transformers in folder v5.0.0.
The plan is to let developer run only 1 command to migrate from v4 to v5 (with JSS as a dependency so the application does not crash and they can continue fixing other breaking changes that codemod cannot fix)

// this is the one-line magic
npx @material-ui/codemod@next v5.0.0/preset-migration <folder>
  • add jscodeshift flag similar to react-codemod for "double-quote" options

Review note

The implementation is quite hard to review so checking *.test folder that contains actual and expected result might be better.

Testing Result

I have tested this codemod version with community projects and material-ui-store.

Process of testing

  1. clone project and upgrade react, typescript
  2. upgrade material-ui to v5
  3. run codemod important-migration
    βœ… means the application is running without crash after running codemod

@siriwatknp siriwatknp added the package: codemod Specific to @mui/codemod label Jun 30, 2021
@siriwatknp siriwatknp marked this pull request as draft June 30, 2021 10:06
@mui-pr-bot
Copy link

mui-pr-bot commented Jun 30, 2021

No bundle size changes (experimental)

Generated by 🚫 dangerJS against b3066a1

@siriwatknp siriwatknp marked this pull request as ready for review July 7, 2021 11:21
@siriwatknp
Copy link
Member Author

siriwatknp commented Jul 7, 2021

Let's not abstract all these utilities. The fact that the naming of these is already incorrect shows how problematic utility abstraction of existing utility is. c&p is fine.

They are removed.

@oliviertassinari oliviertassinari changed the title [codemod] add v5 important migration [codemod] Add v5 important migration Jul 7, 2021
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Thanks for the PR on the store. I'm taking it from there.

packages/material-ui-codemod/README.md Outdated Show resolved Hide resolved
@mnajdova mnajdova mentioned this pull request Jul 9, 2021
2 tasks
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

I scanned all files, I could not spot anything suspicious. I would say we could merge it and ask people to try it and collect some feedback. Good job @siriwatknp

@siriwatknp siriwatknp merged commit deaa976 into mui:next Jul 12, 2021
@siriwatknp siriwatknp deleted the v5-codemods branch July 12, 2021 14:19
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.

None yet

5 participants