Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change JSZip.external.Promise implementation. #321

Merged
merged 3 commits into from
Aug 2, 2016

Conversation

dduponchel
Copy link
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

Importing `es6-promise` had a side effect: this library replaces the
global Promise object (Stuk#304) (or tries to, Stuk#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 (Stuk#303).

I think it is enough for a semver minor version.

Fix Stuk#303 Stuk#304 Stuk#309
@dduponchel
Copy link
Collaborator Author

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant