Re: Prollyfills and the global namespace / multi-fills

> IMO, the right (™) way to do it is like Promises are done here (wrap in 
> anonymous function):

Yes, of course you want to use a wrapper, I'm speak about what you export in 
the global namespace here. In this case, Alex just expose "Promise" directly 
into the global namespace. This is an issue because its implementation is 
not what will be written in the spec. He should use 
"global.alexRussel.Promise" instead, because then when we use them we know 
we speak about "Alex Russel's implementation of Promises" and if a browser 
ever implements Promises, that won't conflict. Actually, because everybody 
shipped with the name "Promise", the w3c was forced to use another name 
("Future") for the final implementation...



> Depends on who you are building it for.
> If you are building it for a standards org,
> then you want it to be as close to the
> metal as it can be (See Promises prollyfill…

This is certainly not the number one use case of most developpers. If we 
actually want to use on a real website (and most will want that), you need 
prefixes.

That would not be that hard to do

    var Promise = window.alexRussel.Promise;

at the top of your function to import the right things. 

Received on Wednesday, 3 July 2013 18:18:30 UTC