jargon

Comparison

PolyfillvsPonyfill

Polyfill

you loaded a script that defines the missing method on the global object so the rest of the code can call it.

Code that implements a missing platform API by installing it where the real one would be. It makes the feature available everywhere at the cost of shipping the implementation to browsers that already have it, unless it is loaded conditionally. Because it mutates globals, two polyfills for the same API can conflict, and a partial implementation can be worse than none by passing a feature detection it should fail.

Full entry →

Ponyfill

you imported the replacement as a normal function instead of letting it patch the global object.

The same functionality as a polyfill, exported as a module rather than installed globally. Nothing outside your imports is affected, so it cannot conflict with another library or with a future native implementation, and it can be tree-shaken away. The trade is that third-party code calling the native API still gets whatever the browser has.

Full entry →

Related comparisons