*** Welcome to piglix ***

Polyfill


In web development, a polyfill is code that implements a feature on web browsers that do not support the feature. Most often, it refers to a JavaScript library that implements an HTML5 web standard, either an established standard (supported by some browsers) on older browsers, or a proposed standard (not supported by any browsers) on existing browsers. Formally, "a polyfill is a shim for a browser API".

Polyfills allow web developers to use an API regardless of whether it is supported by a browser or not, and usually with minimal overhead. Typically they first check if a browser supports an API, and use it if available, otherwise using their own implementation. Polyfills themselves use other, more supported features, and thus different polyfills may be needed for different browsers. The term is also used as a verb: polyfilling is providing a polyfill for a feature.

The term is a neologism, coined by Remy Sharp, who required a word that meant “replicate an API using JavaScript (or Flash or whatever) if the browser doesn’t have it natively” while co-writing the book Introducing HTML5 in 2009. Formally, "a shim is a library that brings a new API to an older environment, using only the means of that environment.", and polyfills exactly fit this definition; the term shim was also used for early polyfills, such as HTML5 Shiv. However, to Sharp shim connoted non-transparent APIs and workarounds, such as Spacer GIFs for layout, sometimes known as shim.gif, and similar terms such as progressive enhancement and graceful degradation were not appropriate, so he invented a new term. The term is based on the spackling paste brand Polyfilla, a paste used to cover up cracks and holes in walls, and the meaning "fill in holes (in functionality) in many () ways". The word since gained popularity, particularly due to its use by Paul Irish and in Modernizr documentation.


...
Wikipedia

...