mui-datatables icon indicating copy to clipboard operation
mui-datatables copied to clipboard

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

Open Fullbusters opened this issue 3 years ago • 6 comments

@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:

  • it increases the size of bundle without any benefits,
  • using not last version of mui functional: mui 5 using emotion/styled/sx, but mui v4 using jss. That means now mui-datatables have two different ways for styles.

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

Fullbusters avatar Dec 03 '21 09:12 Fullbusters

Up

maganezf avatar Dec 07 '21 13:12 maganezf

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

Fullbusters avatar Dec 17 '21 15:12 Fullbusters

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 ?

ashfaqnisar avatar Dec 17 '21 18:12 ashfaqnisar

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

Fullbusters avatar Dec 20 '21 09:12 Fullbusters

@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.

liamlows avatar Jan 26 '22 21:01 liamlows

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

Fullbusters avatar Feb 16 '22 09:02 Fullbusters