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

Avoid loading Promise polyfill in modern browsers. #59

Closed
lgarron opened this issue Oct 8, 2017 · 5 comments
Closed

Avoid loading Promise polyfill in modern browsers. #59

lgarron opened this issue Oct 8, 2017 · 5 comments
Milestone

Comments

@lgarron
Copy link
Owner

lgarron commented Oct 8, 2017

It's only needed on IE. :-/

Instead of pretty native Promise, I see the polyfill even in Chrome right now.

@lgarron lgarron added this to the v2 milestone Oct 20, 2017
@lgarron lgarron removed the v2 label Oct 20, 2017
@lgarron lgarron changed the title Avoid loading polyfill in modern browsers. Avoid loading Promise polyfill in modern browsers. Feb 9, 2018
@the-spyke
Copy link

the-spyke commented Feb 20, 2018

Just bumped into this issue when I was trying to debug .writeText(...).finally is not a function error.

I work in a browser with no Promise.prototype.finally(), but I do use babel-polyfill which has no power in this case :-(

@lgarron
Copy link
Owner Author

lgarron commented Feb 21, 2018

Yeah, I wish there were a simple solution. Open to (compatible) suggestions.

@the-spyke
Copy link

I'd suggest to build without polyfills and let users use their own if they need it. Just add to readme what ES2015+ features this library requires.

@lgarron
Copy link
Owner Author

lgarron commented Feb 22, 2018

The main point of this library is to be as compatible as possible with old browsers while the new API is rolling out. I don't feel comfortable removing compatibility with IE by default, although I'm okay with users opting out of the polyfill.

@lgarron
Copy link
Owner Author

lgarron commented Feb 22, 2018

99de811 is not super-clean, but it passes the type checks and avoids using es6-promise in browser that already have Promise.

I would prefer not to support multiple builds unless there are specific concerns about build size, so hopefully this will do for now.

@lgarron lgarron closed this as completed Feb 22, 2018
lgarron added a commit that referenced this issue Feb 22, 2018
Changes:
- Avoid using Promise polyfill in modern browsers. #59
lgarron added a commit that referenced this issue Feb 22, 2018
Changes: Fix extra reference to Promise polyfill. #59
lgarron added a commit that referenced this issue Feb 22, 2018
Changes: Fix extra reference to Promise polyfill. #59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants