JavaScript dependency trees have grown bloated over time due to three main causes: (1) packages built for very old engines (ES3/IE6) or cross-realm safety that most developers no longer need, (2) atomic architecture where trivial one-liners like `Array.isArray(val) ? val : [val]` became their own npm packages with single consumers and supply chain risks, and (3) ponyfills for features now natively supported everywhere that were never removed. Tools like knip, the e18e CLI, npmgraph, and the module-replacements project can help identify and eliminate this bloat. The author argues the small group needing legacy compatibility should maintain their own special stack, while the majority should benefit from modern, lightweight dependencies.

14m read timeFrom 43081j.com
Post cover image
Table of contents
The Three Pillars of JavaScript Bloat1. Older runtime support (with safety and realms)2. Atomic architecture3. “Ponyfills” that overstayed their welcomeWhat can we do about it?Closing Thoughts

Sort: