How we use Web Components at GitHub
GitHub moved from jQuery to native Web Components starting in 2014 and now ships dozens of custom elements such as <include-fragment>, <details-dialog> and <relative-time>. Engineers author components in the Rails monolith with Catalyst, a TypeScript decorator library, paired one-to-one with ViewComponent on the server, and enforce practices with ESLint plugins and ratchet tests that block deprecated patterns like facebox. Proven components are generalized, stripped of Catalyst and published as dependency-free, style-free open-source elements with TypeScript definitions. One example is <typing-effect>, built in under 40 lines to avoid a fivefold bundle-size increase from typed.js.
Related posts
- Hydrogen & Tailwind: The Perfect Match for Building Beautiful Storefronts
Shopify Engineering mediumAdeptTailwind's utility classes ship as the default styling option in Shopify's React-based Hydrogen storefront framework, and the case for them rests on componentization: styles live in reusable React components rather than semantically named classes like BEM-style product-card__title, so layouts can be copied or extracted (e.g. ProductCard to BlogCard) without renaming or duplicating CSS. Further arguments include enforced spacing and color constraints for visual consistency, copy-paste composability from libraries like Tailwind UI, easier team collaboration, and not having to name things. The tradeoff is a real learning curve that still requires CSS fundamentals, eased by good docs and the VSCode extension.
- Why We Ripped Twin out of 400+ Components
Railway mediumAdeptRailway replaced twin.macro with vanilla Tailwind across 400+ React components, which removed the last dependency on Babel and let the monorepo move fully to SWC. Dev cold starts dropped from ~35s to ~1.5s, a full build from 220s to 42s, and CI from 4-6 to 2-4 minutes. The migration took ~30 PRs with a codemod and custom helpers. Nested selectors moved to Tailwind-processed CSS files, theme() calls became CSS variables, and Twin's inline-style precedence and automatic merging were handled by migrating pages first and core components last, using `!` overrides and tailwind-merge.
- Improving site performance by shipping more CSS
GitHub Engineering mediumAdeptGitHub migrated its Primer Design System and the github.com codebase from styled-components CSS-in-JS to CSS Modules, removing runtime styling costs on client and server. Primer components moved first, each behind a feature flag and checked against visual regression snapshots, which cut server-side render time by 55% and component initialization by 25%. A wrapper package, @primer/styled-react, kept the legacy `sx` prop working during the transition. About 7,760 `sx` props were then migrated with a VS Code plugin, codemods and later Copilot coding agents, followed by decoupling theming, and dotcom reached 100% CSS Modules in June 2026 without breakage.
- Upgrading Checkout Blocks app to Polaris web components
Shopify Engineering mediumAdeptShopify's Checkout Blocks team migrated five high-traffic checkout UI extensions from React and the legacy Remote UI bridge to Preact, remote-dom and Polaris web components, rewriting them in TypeScript, and cut transferred bundle sizes by 40-85% and extension load time by about 8% at P50. Most of the work went into fitting under the new 64KB gzip bundle limit. Dropping react-reconciler saved about 89KB, a custom AI-assisted Liquid parser validated against a 42,000-line production parity corpus replaced liquidjs, and markdown-to-jsx was kept by aliasing React to Preact. The team migrated one extension per day, smallest first, behind new success/failure metrics. That monitoring caught a useId() ID-collision bug, which was rolled back the same day, and the work also produced upstream Polaris component fixes.
- From Ruby to Node: Overhauling Shopify’s CLI for a Better Developer Experience
Shopify Engineering mediumAdeptShopify rewrote its CLI from Ruby to TypeScript on Node to reduce system requirements, unify the Theme, App and Hydrogen workflows, and stay easy for internal teams to contribute to. Go and Rust were rejected despite their static binaries because few Shopify engineers know them. Node won over Ruby because its module system lets multiple versions of a transitive package coexist, which supports modular plugins. The new architecture rests on a shared @shopify/cli-kit package, custom ESLint rules, cross-OS CI testing, a monorepo, and a functional, MVC-like split of models, commands and services. It also uses Vitest unit tests, Cucumber E2E tests, and oclif plugins with hooks for dependency inversion.