On Fri, Dec 20, 2013 at 12:38 PM, Kevin Smith <zenpars...@gmail.com> wrote:

> Okay, so how will end users or jQuery authors upgrade their promises to
>> become ES6-compliant?
>
>
> I don't know enough about jQuery's internals to write convincing code, but
> the basic idea is that you feature detect for ES6 Promises.  If that test
> passes, then you implement jQuery.Deferred using a Promise subclass (which
> would do assimilation for backward compatibility reasons).  Otherwise you
> implement it the old-fashioned way.
>
> Application developers who are going to hook into the new DOM API's need
> to upgrade their jQuery.
>
> Of course, jQuery promises will still over-assimilate objects which have a
> `then` method but aren't "thenable", but that's jQuery's backward
> compatibility problem, not the entire language's.
>
> Am I missing something?  I usually do...  : )
>


I'd only point out that jQuery's Deferred API varies pretty wildly from ES6
Promises, so this could end up pretty ugly.

The alternative is to just let jQuery be jQuery and upgrade (or bastardize,
depending on your perspective) ES6 Promises to assimilate. I don't know why
this didn't occur to me before -- it seems pretty much ideal.
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to