Re: Prollyfills and the global namespace / multi-fills

> What does "module" mean here? AMD? NPM? CommonJS?

An object that is self-contained. That includes any kind of module, even 
just:

    window.myProllyfill = {
        Abc: function() {
            ...
        },
        Def: function() {
            ...
        }
    }



> - when you use some global namespace, use a prefix (no code should use 
> your
> function by mistaking it for a native implementation)

Redefining an existing prollyfill that (you think) sucks by another one is 
the best way to have problems because some code most probably rely on the 
"sucking" implementation. That's why you simply do not want prollyfill to 
clash with anything hence special names and prefixes.

You don't have to prefix everything, just enough to make sure people can use 
the polyfill and still be sure no code that never "met" the prollyfill will 
use it by mistake. 

Received on Wednesday, 3 July 2013 17:58:59 UTC