-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Do not monkey patch the global Promise. #304
Comments
This wasn't intentional. This comes from the Promise implementation, see stefanpenner/es6-promise/issues/140 and stefanpenner/es6-promise/issues/141. Either we find a way to disable this or we change the implementation. |
@dduponchel ah I see. And sorry for having been so terse 😃 This is how I currently fix this: const p = Promise
require('jszip')
global.Promise = p |
@dduponchel see https://github.com/kevinbeaty/any-promise. It allows user to select prefered promise library. |
The other solution is to change the implementation. vow or lie look like good alternatives (working in IE 6, lightweight implementation). Any ideas ? |
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 It appears that |
@dduponchel as far as i remember, anypromise will use |
Fixed in v3.1.0. |
This breaks unhandledRejection handler for example.
The text was updated successfully, but these errors were encountered: