Skip to content

Do you need to polyfill promises? #36

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

Closed
matthewmueller opened this issue Sep 6, 2017 · 4 comments
Closed

Do you need to polyfill promises? #36

matthewmueller opened this issue Sep 6, 2017 · 4 comments
Labels

Comments

@matthewmueller
Copy link

matthewmueller commented Sep 6, 2017

It seems like this library depends on window.Promise being available. Is that true? Are there any other requirements for this library?

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Sep 7, 2017

Yes, the library expects an implementation or a polyfill. If you use async iterators, you'll need Symbol.asyncIterator.

@matthewmueller
Copy link
Author

matthewmueller commented Sep 7, 2017

Okay good to know! It'd be great to either document that somewhere or even better provide the polyfills via tslib (npm's promise-polyfill is tiny).

Currently it's a bit confusing when the target in tsconfig says "es3" and the typescript language permits async, but then your code doesn't work in IE11.

I think typescript providing a stable language with cross-browser support would be sooo huge.

@NeoLegends
Copy link

even better provide the polyfills via tslib

I am absolutely against that. Please polyfill yourself according to the browser targets you want to support, but don't put the additional library bloat on everyone by automatically polyfilling everything.

@fis-cz
Copy link

fis-cz commented Jun 19, 2018

Just opened another discussion, what should be filled or polyfilled by ts and what should not.
see 25027

@microsoft microsoft locked as resolved and limited conversation to collaborators Jun 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants