GitHub ditched CSS-in-JS after a three-year slog. The result? Pages render 55% faster.
Original headline: GitHub Ditches CSS-in-JS for CSS Modules, Reports 55% Faster SSR After Three-Year Migration — infoq.com
More in Programming and developer news
GitHub has completed a massive three-year engineering project to move its entire website away from CSS-in-JS libraries. The company's Primer design team, led by engineers Josh Black and Marie Lucca, identified that their extensive use of styled-components was causing serious performance problems as the number of components on pages exploded. Server-side rendering times, initial page loads, and style update costs were all scaling poorly. They chose to migrate to CSS Modules, a more static approach that compiles styles into regular stylesheets delivered with the HTML, removing significant runtime work from both client and server.
The painstaking migration involved creating CSS Module variants for every Primer component, gating them behind feature flags, and verifying visual parity. A core challenge was converting over 7,760 instances of the 'sx' prop—GitHub's de facto styling standard for years. A rotation of eight engineers converted 6,419 props over six months, with the final push aided by GitHub Copilot. The result is a 55% reduction in server-side rendering time and 25% faster component initialization. This case study proves that even large, established codebases can achieve significant performance wins by re-evaluating foundational architectural choices.
Read the original at infoq.com
Satirical commentary on real tech news, summarised with AI. Read the original source for the facts. How ZeroDaily works
