Post

It’s a real shame that folk a decade ago weren’t warning developers against utterly insane things like CSS-in-J —  oh.

GitHub@github.com

GitHub.com has fully moved off CSS-in-JS to CSS Modules, resulting in 55% less server-side render time and 25% faster component init. https://github.blog/engineering/architecture-optimization/improving-site-performance-by-shipping-more-css/

Ah yes, people are so unfair for having a mental model of "CSS-in-JS" that is informed by: 1. The seminal CSS-in-JS talk by vjeux who coined the phrase and showed a 100% runtime implementation. 2. Dominant implementations like Emotion and Styled Components.

0 reposts1 like

If a library author uses a term historically associated with runtime execution, and shows people a syntax that looks like runtime execution (“but we have a special compiler that removes it, don't worry”), then turning around and calling people unfair for having the wrong idea is a bit cheeky.

Server actions, for example. The function from the same file as the UI component is never shipped to the browser because its body starts with the magic string 'use server', regardless of whether it has backend-related content or is just used as a way to move a heavy computation to a stronger machine

Yes, it is unfair to extrapolate your experience with one library to the whole ecosystem. It's like when you tried React, it was slow, and then you promised yourself you would never touch frontend frameworks again and, from this point on, only interact with the DOM through native browser APIs

Remember the time when React was only a client-side library and didn't have capabilities for static site generation, as well as no server components? There was such a time. React is now the most popular frontend tool. Ecosystems are capable of evolving and learning lessons. React and CSS-in-JS did