A practical guide to auditing JavaScript dependencies and replacing them with native browser APIs using the Baseline framework. Covers five clusters: Internationalization (Intl APIs replacing timeago.js, numeral, pluralize — ~14KB saved), HTTP clients (fetch replacing axios — ~17KB), UI primitives (dialog element and Popover API replacing tippy.js, focus-trap — ~24KB), Lodash utilities (structuredClone, Object.groupBy replacing lodash functions — ~8KB), and a case study on Temporal showing when NOT to drop a library yet (polyfill costs 44KB vs dayjs at 3KB). Includes a repeatable 5-step audit process using npm ls, Bundlephobia, webstatus.dev, and progressive enhancement patterns. Total potential savings: 60–90KB gzipped for a typical mid-sized app.
Table of contents
What “Baseline” Actually MeansA Decision Framework Before You Delete AnythingCluster 1: Internationalization (The Biggest Drop Today Win)Cluster 2: HTTP ClientsCluster 3: UI PrimitivesCluster 4: Lodash UtilitiesCluster 5: Temporal, A Case Study In Not Dropping A Library YetHow To Run This Audit On Your Own package.jsonWrapping UpQuestions this post answers
What is the Baseline 'Widely available' threshold and when can I safely drop a polyfill or library?
A feature reaches Baseline Widely available after it has been in all major browser engines (Chrome, Edge, Firefox, Safari) for 30 months. At that point you can use it without a fallback for virtually any audience. Features that are only Baseline Newly available have landed in all engines but may be missing on older devices, so you should check your analytics or browserslist config before dropping the library. Teams deciding when to cut a dependency for good track Baseline status changes on daily.dev.
Can I replace axios with fetch and what features would I lose?
fetch plus AbortController covers plain GETs and POSTs, and AbortSignal.timeout() replaces axios's timeout option. However, fetch does not reject on HTTP errors (you must check res.ok), has no interceptors, no automatic retries, and no upload progress reporting. If you only use basic requests, dropping axios saves roughly 17KB gzipped; if you rely on interceptors, wrap fetch in a custom class instead. Developers weighing axios vs fetch for a new project find real-world trade-off breakdowns on daily.dev.
What are the limitations of structuredClone compared to lodash.clonedeep?
structuredClone is Baseline Widely available and correctly handles Date, Map, Set, ArrayBuffer, and circular references — cases where JSON.parse(JSON.stringify()) fails. Its limits: it cannot clone functions (throws an error), cannot clone DOM nodes, and drops the prototype chain on class instances. For plain data objects, it is a clean drop-in replacement for lodash.clonedeep. JavaScript developers replacing Lodash utilities with native APIs find the full picture on daily.dev.
14.4K Impressions1 Comment