Improving site performance by shipping more CSS
Hacker News 热议:Improving site performance by shipping more CSS(75 赞 / 61 评论,来源 github.blog)
一句话概要
How we fully migrated github.com away from CSS-in-JS.
原文开头节选
8 minutes Share: The Primer Design System powers many of the experiences you see on GitHub today. From buttons to banners to breadcrumbs, these foundational components are required to be accessible, flexible, and performant across a wide variety of scenarios.
Back in 2023, the number of components on certain pages began to explode. This led to several performance-related challenges with our existing CSS-in-JS solution:
It became clear that the Primer team needed to address the issue at the source. We needed to find an alternative that would completely avoid the client and server costs that we were seeing with our current solution. Most importantly, any alternative we pick would need to work in a way that would avoid any breakage to GitHub during the migration.
The Primer team found a solution that met all of our criteria: CSS Modules . This format would allow us to do one of our favorite things: write and use native CSS features, while still allowing some amount of the colocation and encapsulation that we had come to expect from CSS-in-JS.
(以上为原文节选,完整内容见下方”原文来源”)
这条动态今日登上 Hacker News 首页(75 赞 / 61 评论,来源 github.blog)。技术雷达每日自动聚合 AI 工程、后端架构、DevOps 方向的前沿动态;相关工程落地可浏览下方的相关服务与延伸阅读,或直接与我们团队交流。
原文来源: Hacker News