Change JSZip.external.Promise implementation. #321

Merged
merged 3 commits into from Aug 2, 2016

Projects

None yet

1 participant

@dduponchel
Collaborator

Importing es6-promise had a side effect: this library replaces the
global Promise object (#304) (or tries to, #309). This is an intended
side effect from this library and while its version 4 should give us a
switch for this behavior, I don't know when it will be out (the master
branch of this project still auto replace the Promise).

I replaced it by vow which match the requirements:

  • a Promise implementation
  • a lightweight one
  • works in IE6
  • doesn't have too many dependencies

If a global Promise already exists, prefer it: a native promise is
likely to be better integrated anyway (unhandledRejection in node) and
some libraries (zone.js for example) replace global objects (#303).

I think it is enough for a semver minor version.

Fix #303 #304 #309

@dduponchel dduponchel Change JSZip.external.Promise implementation.
Importing `es6-promise` had a side effect: this library replaces the
global Promise object (#304) (or tries to, #309). This is an intended
side effect from this library and while its version 4 should give us a
switch for this behavior, I don't know when it will be out (the master
branch of this project still auto replace the Promise).

I replaced it by `vow` which match the requirements:
- a Promise implementation
- a lightweight one
- works in IE6
- doesn't have too many dependencies

If a global Promise already exists, prefer it: a native promise is
likely to be better integrated anyway (unhandledRejection in node) and
some libraries (zone.js for example) replace global objects (#303).

I think it is enough for a semver minor version.

Fix #303 #304 #309
e9fc128
@dduponchel
Collaborator

lie was interesting too (and has an API closer to the specs) but pulled more than 40 packages and several MB.
I found out the version 3.1.0 is out and fixed that: lie may be a better choice now.

dduponchel added some commits Aug 2, 2016
@dduponchel dduponchel Merge remote-tracking branch 'stuk/master' into promise 26e2dc6
@dduponchel dduponchel Use lie instead of vow.
The API is closer to the ES6 Promise API and it is smaller than vow.
The previous version had a lot of npm dependencies (which is why I
prefered `vow`) but the latest version fixed that.
0d287a1
@dduponchel dduponchel merged commit ae04e56 into Stuk:master Aug 2, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@dduponchel dduponchel deleted the dduponchel:promise branch Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment