gregnb / mui-datatables

Datatables for React using Material-UI
MIT License
2.7k stars 931 forks source link

Remove @mui/styles according to migration from mui v4 to v5 #1826

Open Fullbusters opened 2 years ago

Fullbusters commented 2 years ago

@mui/styles will be deprecated in mui v6 you can read about this here https://github.com/mui-org/material-ui/issues/26571 And even in guide migration from v4 to v5 exist steps for removing @mui/styles from the project here: https://mui.com/guides/migration-v4/#migrate-from-jss I was faced with an issue that mui-datatables still used @mui/styles and I can't remove it from the project.

Think that it's a bug, because:

In my opinion, it`s should be migrated from @mui/styles as soon as possible.

Mui 5 provide for us two ways to remove it: https://mui.com/guides/migration-v4/#migrate-from-jss But the most similar as makeStyles is this: https://dev.to/atonchev/material-ui-5-the-easiest-way-to-migrate-from-makestyles-to-emotion-1i9l

The fastest solution is to add @mui/styles to peerDependency #1820 that allow for devs to remove @mui/styles from their projects, and then step by step doing a migration from @mui/styles to emotion.

Tech Version
Material-UI 5.2.1
MUI-datatables 4.0.0
React 17.0.2
maganezf commented 2 years ago

Up

Fullbusters commented 2 years ago

@zxhmike @wdh2100 @ashfaqnisar can you take a look to this

ashfaqnisar commented 2 years ago

Hey @Fullbusters, I tried the codemod provided by mui and was able to switch most of the jss styles to styled components but it was not able to do the conversion for some of the files. I also looked at tss-react, it seems like a great and easy to switch option, what do you think ?

Fullbusters commented 2 years ago

hey @ashfaqnisar, codemod not switching all things that needed, and they not remove @mui/styles at all, so it's should will be done by devs by themself. yes tss-react it's good alternative, and it's recommended by mui in their guide for migrate https://mui.com/guides/migration-v4/#2-use-tss-react thanks

liamlows commented 2 years ago

@Fullbusters Do we know if the conversion away from utilizing @mui/stylesis happening/has happened? I would like to move away from the deprecated package before I move a project I am working on into production.

Fullbusters commented 2 years ago

@liamlows until recently, I hoped that someone would do it, but I will have to ( I will try to do it this week