Skip to content

3.0.0

Compare
Choose a tag to compare
@calvinmetcalf calvinmetcalf released this 30 Jul 14:02
· 33 commits to master since this release
v3.0.0

Overall it should be very much in line with how es6 promises work in the browser/node and should be about 18% smaller now coming in at 1867 bytes minified and gzipped.

  • BREAKING adds some es6 compatibility fixes to make inheriting possible, which now means Process.[all|race|resolve|reject] may not be called in an arbitrary context, i.e.

    // WON'T WORK
    var resolve = Promise.resolve;
    var promise = resolve(true);
    
    // STILL WORKS
    var promise = Promise.resolve(true);
  • BREAKING new is no longer optional for constructors, e.g.

    // WON'T WORK
    var foo = Promise();
    
    // STILL WORKS
    var foo = new Promise();

    this is exactly how es6 promises work

  • resolve no longer caches falsy promises, this was of minimal perf benefit and could cause global issues issues if somebody was to screw around with one of those cached promises as they were global and mutable, this is theoretically breaking, but honestly you'd have to be doing something pretty dumb for this to be a breaking change in your code.

  • no longer broken into many modules, this doesn't effect performance or how it works in any way, but makes it a lot smaller as the library is small enough that all the wrapping functions added up to a noticeable fraction of the total library size