YouTube Summaries

← All summaries

Saving the web from Javascript bloat

2026-03-29 Sun @t3dotgg

Theo covers James Garbet's article "The Three Pillars of JavaScript Bloat."

The 3 pillars of JS bloat

1. Older Runtime Support & "Safety"

  • Packages like is-string have deep dep trees just to support ES3 (IE6/7) or ancient Node. Almost nobody needs this.
  • Hero Devs maintains ancient codebases — once added 60 deps to axe-object-query for Node 0.4 compat, nearly doubling SvelteKit's deps.
  • Some packages exist purely to protect against global namespace mutation (e.g., math-intrinsics re-exports Math functions).
  • Cross-realm values (iframe vs parent) require workarounds instead of instanceof.

2. Atomic Architecture

  • Packages split to absurd granularity: shebang-regex (2 lines) gets 133M downloads/week. slash gets 96M/week. path-key (4KB) gets 158M/week.
  • Most are used by exactly ONE other package by the same author — inline code with extra npm overhead.
  • Duplicated versions compound the problem.
  • Bigger supply chain attack surface.

3. Ponyfills That Overstayed Their Welcome

  • Ponyfills stick around forever after native support ships.
  • globalThis ponyfill: 49M downloads/week (native since 2019).
  • object.entries: 35M/week (native since 2017).
  • indexOf: 2.3M/week (native since 2010).

What to do

  • E18 Foundation — essential cleanup work, pruning redundant packages.
  • knip tool finds unused deps, dead code, unused imports.
  • E18 CLI with analyze mode recommends replacements.
  • module-replacements project lists modern alternatives.
  • npmx.dev for exploring dependency graphs.
  • Theo donated $5,000 to E18 (total balance was only $17K).