Codemod for migration from `@material-ui/styles`'s `makeStyles` to `tss-react`
See original GitHub issueHi,
I am trying to start a discussion to see if it is possible/feasible to create a codemod that would migrate from @material-ui/styles
makeStyles
and withStyles
to the tss-react
’s equivalents.
The motivation is to help the developers to migrate from @materia-ui/core
(v4) to @mui/material
(v5) in a more automated way. From what I was seeing from time to time in the activity of the project, looks like most (all?) features that @material-ui/styles’ API provided are already implemented. If this is the case, I would like to hear your opinion, on whether you think this could actually be automated, or there are things that are still depending on a person being involved when migrating.
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:11
- Comments:19 (10 by maintainers)
Top Results From Across the Web
Migrating from JSS (optional) - Material UI - MUI
We provide a codemod to help migrate JSS styles to styled API, ... import Typography from '@mui/material/Typography'; -import makeStyles from ...
Read more >garronej/tss-react: makeStyles is dead, long live ... - GitHub
js 13 appDir 🥳 . 'tss-react' is intended to be the replacement for @material-ui v4 makeStyles and 'react-jss' . ✅ Seamless integration with...
Read more >Setup - TSS React
If you are migrating from @material-ui/core (v4) to @mui/material (v5) checkout the migration guide from MUI's documentation website here.
Read more >@mui/codemod - npm
jss-to-tss-react Migrate JSS styling with makeStyles or withStyles to the corresponding tss-react API.
Read more >Material UI v4 to v5 migration... Worth doing? : r/reactjs - Reddit
I recently upgraded a project (63k sloc) that made heavy use of makestyles over styled. It was a pain in the ass, TSS-React...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @mnajdova,
I am off today but trust that I will try and see what’s feasable.
@garronej @mnajdova The app I work on has over 500 usages of
makeStyles
, so I’m going to start working on the codemod. I’ll only be able to devote occasional blocks of time to this, but we are planning to migrate our app to v5 within the next quarter so I should finish it within the next couple months. I’ll be focusing on just the patterns that occur within our code, but that will cover enough cases to create a solid foundation to add more cases to.I haven’t used jscodeshift before, but the examples already in https://github.com/mui/material-ui/tree/master/packages/mui-codemod/src/v5.0.0 give me enough to speed my learning along.
You can follow my progress here: #31802