Skip to content

Instantly share code, notes, and snippets.

@rauschma
Last active August 20, 2019 18:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rauschma/6a431d51d60a6123982759e6a8579420 to your computer and use it in GitHub Desktop.
Save rauschma/6a431d51d60a6123982759e6a8579420 to your computer and use it in GitHub Desktop.
@simevidas
Copy link

web feature → web platform feature
run on older browsers → run on browsers that don’t support this feature
brings a new feature to older platforms → adds support for a feature to browsers that don’t support it natively
by making global changes… → using JavaScript

@WebReflection
Copy link

Agreed with @simevidas, the term polyfill, as meant on the web, has nothing to do with new vs old, it's about bringing standard features to browsers that don't support those, no matter how old or modern these are.

As example, Custom Elements built-in extends is defined by standard V1 API but Safari doesn't implement it yet, so that a polyfill for Safari only is needed, while Firefox, Chrome, Opera, or newest Edge are fine.

@matthewharwood
Copy link

Shall we add the difference between Polyfill and Ponyfill?

@stuartlangridge
Copy link

stuartlangridge commented Aug 18, 2019

It may be worth saying: it adds that feature to the platform by implementing the standard API in JavaScript. That is: it doesn't just add the feature; it adds the feature exactly as supporting browsers do, so a developer can programme to the standard API and it'll work even on browsers that don't natively provide it.

@rauschma
Copy link
Author

@simevidas, @WebReflection: Thanks for your feedback! I have rewritten the text.

@WebReflection
Copy link

@rauschma that sounds better, yes, but I'd still change one part:

installs that feature on a platform that doesn’t already support it

this feels like a permanent change on the host/user machine

implements that feature on a platform that doesn’t already support it

or even

provides that feature on a platform that doesn’t already support it

seems to be a better wording choice. Eventually, I'd add at runtime to explicit such feature is not permanent.

@WebReflection
Copy link

P.S. since you mentioned the word shim, I'd also mention the word sham, used to indicate the provided feature doesn't fully comply with the standard, due lack of primitives, or due developer intent to bring only partially the mentioned feature.

@rauschma
Copy link
Author

@WebReflection. Fixed, thanks! I only want to describe the most common terms. I hadn’t seen “sham” before yesterday.

@ljharb
Copy link

ljharb commented Aug 19, 2019

the oldest usage of it I’m aware of is the es5-sham (a file in the es5-shim)

@rauschma
Copy link
Author

@ljharb I never noticed it before yesterday (I have known and used es5-shim for years).

@ljharb
Copy link

ljharb commented Aug 20, 2019

¯\_(ツ)_/¯ also es6-shim has an es6-sham. a comparable term for "polyfill" is "prollyfill".

@rauschma
Copy link
Author

Note: My goal is not comprehensiveness, my goal is to bring beginners up to speed, without overwhelming them. Accordingly, I’m trying to answer two questions:

  • What terms will newcomers see often?
  • What concepts should they know about?

I don’t like the term “prollyfill” (as a non-native speaker, I only recently realized that the “prolly” may stand for “probably”). The following document suggests the alternative “speculative polyfill” which I find more intuitive: https://www.w3.org/2001/tag/doc/polyfills/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment