W3C home > Mailing lists > Public > public-nextweb@w3.org > July 2013

Re: Prollyfills and the global namespace / multi-fills

From: François REMY <francois.remy.dev@outlook.com>
Date: Wed, 3 Jul 2013 20:18:07 +0200
Message-ID: <DUB120-DS13CE11F77AC77B86E5BA9FA5730@phx.gbl>
To: "Marcos Caceres" <w3c@marcosc.com>
Cc: "Brian Kardell" <bkardell@gmail.com>, <public-nextweb@w3.org>
> 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 

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:05:54 UTC