T
Theo - t3.gg·TechA rant about Javascript bloat
TL;DR
Most JavaScript shipped on the web is unnecessary bloat caused by outdated runtime support, atomic over-packaging, and abandoned polyfills nobody removed.
Key Points
- 1.Three distinct pillars cause JavaScript bloat. James Garbet's article identifies: (1) older runtime support, (2) atomic architecture, and (3) pony fills that overstayed their welcome — each adding unnecessary dependencies to modern projects.
- 2.Pillar 1 — Legacy runtime support bloat exists for an extremely niche audience. Packages like `is-string` carry deep dependency trees (has-symbols, call-bind, get-intrinsic, etc.) solely to support ES3 engines like IE6/7 or Node 0.4, used almost exclusively by contractors like Hero Devs maintaining ancient codebases.
- 3.The Hero Devs incident nearly doubled SvelteKit's dependency count. When LJ Harb took over the `axe-object-query` package, adding backward-compat dependencies caused ~60 new direct deps — one package (`deep-equal`) alone added 50 — prompting Rich Harris to publicly object and users to suspect a supply chain attack.
- 4.Pillar 2 — Atomic architecture creates absurdly over-split packages. Examples: `slash` (2 lines, 96M downloads/week), `path-key` (4KB file, 158M/week), `shebang-regex` (2 lines, 133M/week), and `rfi` (1 line, 32M/week) — packages with a single consumer that could simply be inlined.
- 5.Atomic packaging creates supply chain risk and duplication costs. A compromised maintainer last year affected hundreds of tiny building blocks and all higher-level packages depending on them; version conflicts also force duplicate installs of the same package (e.g., two versions of `is-docker` and `path-key` in Nuxt's tree).
- 6.Pillar 3 — Pony fills for long-supported features still get millions of weekly downloads. `globalthis` (supported since 2019) gets 49M downloads/week; `object.entries` (2017) gets 35M; `index-of` (2010, created by TJ Holowaychuk who left JS a decade ago) still gets 2.3M — all entirely unnecessary on modern engines.
- 7.Practical tools exist to audit and reduce bloat today. Recommendations include: `knip` (finds unused deps/dead code), the E18 CLI analyze/migrate mode (e.g., auto-migrates from `chalk` to `picocolors`), `npmgraph` for visualizing dependency trees, and the Module Replacements project listing modern alternatives.
- 8.The host donated $5,000 to the E18 Foundation to back ecosystem cleanup. He called E18 'essential for JS to survive,' noting the organization only had ~$17,000 total — barely enough to pay one developer once — urging viewers and companies to contribute financially.
Life's too short for long videos.
Summarize any YouTube video in seconds.
Quit Yapping — Try it Free →