Re:Material-UI is releasing v5 and rebrands to mui.com
by brundolf on Thursday September 16, 2021 @03:22PM
(#28556097)
I'm not familiar with JSS, but styled-components works by creating a whole new React component for each layer of styling that you'd traditionally use a CSS class for. And despite appearances React components aren't just function calls, they're persistent objects that carry their own overhead. So doing things this way seriously inflates the work that has to happen at runtime.
Using "plain styles" in a component-oriented architecture relies on convention more than I'd like it to, but... the cost of the CSS-in-JS solutions I've seen just seems too high to be worth it. I don't know what the solution is.
I got the value of JSX even if it felt messy - but the css-in-js becoming popular on frontend is one of the why I switched to full backend roles now.
And when he says that changing the implementation of a styling solution improves component performance 5x ... at what point is it OK for a fancy styling abstraction layer that serves no real purpose (it was just as shit to customise as any other solution, doubt it made people significantly more productive, and they said it was a maintenance burden to maintain abstraction layers) suck up that much performance ? Even the "fast" path is order of magnitude slower compared to good old CSS...