cujojs / when

A solid, fast Promises/A+ and when() implementation, plus other async goodies.
Other
3.44k stars 396 forks source link

Allow easier use of non-browserified ES6 shim #373

Open briancavalier opened 9 years ago

briancavalier commented 9 years ago

See #367

Using the pre-browserified ES6 shim is problematic for folks who want to include it in their own browserify build. Apparently, browserify chokes on already-browserified files, unless you do some extra work.

Some options:

  1. Rename when/es6-shim/Promise.browserify-es6 to a nicer, more obvious name
  2. Change the name of when/es6-shim/Promise to something that indicates it has already been browserified and also move when/es6-shim/Promise.browserify-es6 to when/es6-shim/Promise. That'd be a breaking change for some folks

Thoughts? Other options?

jgornick commented 8 years ago

@briancavalier It would also be nice if the exported object would match that of https://github.com/jakearchibald/es6-promise (i.e. require('es6-promise').Promise). I've had to modify the browserify shim to add a Promise property on the PromiseContructor:

PromiseConstructor.Promise = PromiseConstructor;

I agree with the ugly-ish name for browserify users, but because so many libs and users already use es6-promise, it would be nice if it could really be a drop-in replacement for es6-promise.

As a side note, I also alias es6-promise to when/es6-shim/Promise.browserify-es6 with aliasify.