---
title: "How we use Web Components at GitHub"
description: "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>."
url: "https://swe.quest/articles/how-we-use-web-components-at-github-43357e36de1ecc50"
canonical: "https://github.blog/engineering/architecture-optimization/how-we-use-web-components-at-github/"
source: "GitHub Engineering"
published: "2021-05-04"
difficulty: "medium"
kind: "Case study"
reading_minutes: 8
tags: ["frontend","browsers","design-systems","typescript","refactoring"]
---

# How we use Web Components at GitHub

A post on [GitHub Engineering](https://swe.quest/sources/github.md), published 2021-05-04, 8 min read, Case study. Original: [https://github.blog/engineering/architecture-optimization/how-we-use-web-components-at-github/](https://github.blog/engineering/architecture-optimization/how-we-use-web-components-at-github/)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [Design systems](https://swe.quest/tags/design-systems.md) (Web & mobile)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)
- [Refactoring & migrations](https://swe.quest/tags/refactoring.md) (Engineering practices)

## Prerequisites

- Custom Elements API
- TypeScript decorators ([easy posts on TypeScript](https://swe.quest/tags/typescript.md?difficulty=easy))

## Keywords

Web Components, Catalyst, ViewComponent, GitHub Elements, eslint-plugin-custom-elements, Template Parts, Declarative Shadow DOM

## Related posts

- [Hydrogen & Tailwind: The Perfect Match for Building Beautiful Storefronts](https://swe.quest/articles/hydrogen-tailwind-the-perfect-match-for-building-beautiful-storefronts-f351623f38eedf37.md): Shopify Engineering · 2022-02-11 · Medium · 10 min read · CSS, Frontend, React, E-commerce, Design systems
  Tailwind'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.
- [Why We Ripped Twin out of 400+ Components](https://swe.quest/articles/why-we-ripped-twin-out-of-400-components-f0b99539dbfc3cb4.md): Railway · 2023-05-04 · Medium · 7 min read · CSS, Frontend, Refactoring & migrations, Build systems, React
  Railway 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.
- [Improving site performance by shipping more CSS](https://swe.quest/articles/improving-site-performance-by-shipping-more-css-41480dcc45d65149.md): GitHub Engineering · 2026-09-25 · Medium · 7 min read · CSS, Web performance, Refactoring & migrations, Design systems, React
  GitHub 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.
- [Upgrading Checkout Blocks app to Polaris web components](https://swe.quest/articles/upgrading-checkout-blocks-app-to-polaris-web-components-6cf6ef4febe89e45.md): Shopify Engineering · 2026-07-16 · Medium · 10 min read · Frontend, Web performance, Refactoring & migrations, React, E-commerce
  Shopify'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.
- [From Ruby to Node: Overhauling Shopify’s CLI for a Better Developer Experience](https://swe.quest/articles/from-ruby-to-node-overhauling-shopify-s-cli-for-a-better-developer-experience-c31f4bbd707f942e.md): Shopify Engineering · 2023-01-10 · Medium · 12 min read · Developer tools, TypeScript, JavaScript, Refactoring & migrations, Testing
  Shopify 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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
