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

remove ES6 promises polyfill from build #572

Closed
k2s opened this issue Aug 14, 2017 · 1 comment
Closed

remove ES6 promises polyfill from build #572

k2s opened this issue Aug 14, 2017 · 1 comment

Comments

@k2s
Copy link

k2s commented Aug 14, 2017

When I load Bluebird and then openpgp.min.js the global Promise object set by Bluebird is replaced with https://github.com/stefanpenner/es6-promise.

Wouldn't it be better to make requirement to provide es6 promise responsibility of the user and not to include it in openpgp build ?

@bartbutler
Copy link
Member

So, the reason for this is that openpgp.js gets loaded as a standalone web worker as well in the browser and relies on ES6 promises in the worker. The way workers are loaded it is tricky to rely on the user to provide an ES6 promise polyfill--the worker script has to be self-contained. So the polyfill has to stay.

We might, however, be able to add some logic which prevents the polyfill from loading if bluebird or other promise implementation already exists. You could also try loading bluebird after openpgpjs.

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

No branches or pull requests

2 participants