Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Polyfill Promise only for IE #599

Closed
steida opened this issue Nov 19, 2015 · 4 comments
Closed

Polyfill Promise only for IE #599

steida opened this issue Nov 19, 2015 · 4 comments

Comments

@steida
Copy link
Contributor

steida commented Nov 19, 2015

I think it's right time to polyfill Promise.
http://caniuse.com/#search=promise

@XeeD
Copy link
Contributor

XeeD commented Nov 19, 2015

import Bluebird from 'bluebird';
// Node
global.Promise = Bluebird;
// Browser
window.Promise = Bluebird;

Is it as simple as this?

@steida
Copy link
Contributor Author

steida commented Nov 19, 2015

I would rather use native Promise where available. There are some trade-offs, need to rethink it.

@XeeD
Copy link
Contributor

XeeD commented Nov 19, 2015

I spent hours and hours because I used native Promise instead of Bluebird. The basic error reporting is very bad, at least in Chrome.

@steida
Copy link
Contributor Author

steida commented Nov 19, 2015

That's good to know. Also, we want to have the same implementation everywhere to ensure the same behavior. And angular/angular.js#6697 (comment) and petkaantonov/bluebird#217

Overriding globals seems to be weird for me, so, I suggest to use plain old import Promise, because that's just works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants