# Loading Polyfills Only When Needed

DevFeed: [Loading Polyfills Only When Needed](<https://devfeed.tech/articles/loading-polyfills-only-when-needed-29514.md>)

Original publisher: [Read original article](<https://philipwalton.com/articles/loading-polyfills-only-when-needed/>)

Published: 2016-09-27T22:41:26Z

Content type: tutorial

Language: en

Sources: [Philip Walton](<https://devfeed.tech/sources/philip-walton.md>)

Topics: [polyfill](<https://devfeed.tech/topics/polyfill.md>), [browser](<https://devfeed.tech/topics/browser.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [HTML](<https://devfeed.tech/topics/html.md>)

Tags: [browsers](<https://devfeed.tech/tags/browsers.md>), [html](<https://devfeed.tech/tags/html.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [performance](<https://devfeed.tech/tags/performance.md>), [polyfill](<https://devfeed.tech/tags/polyfill.md>)

## AI overview

The article explains why loading all polyfills for every user can penalize users on modern browsers, then presents the author's approach to conditionally loading polyfills only when needed. It notes tradeoffs involving feature detection, deprecated libraries, and user-agent-based services such as Polyfill Service.

## Source excerpt

New JavaScript and HTML features are being introduced all the time that make our lives as developers easier. In many cases, these new features are so helpful we choose to use them on production websites before they're fully implemented in all browsers. To not break the experience for users on older browsers, we of course include polyfills for any not-fully-supported features.