4 ms·
> Since async and await are strictly better, my recommendation remains to use them instead of vanilla promises Let's not assume that polyfills are free. As far
by vdnkh 9y ago
> Since async and await are strictly better, my recommendation remains to use them instead of vanilla promises
Let's not assume that polyfills are free. As far as I can tell [0], you need two Babel transforms to enable support across browsers, with the generator polyfill running you about 20kb.
[0] https://babeljs.io/docs/plugins/preset-es2017/ https://babeljs.io/docs/plugins/preset-es2017/
- maxfurman 9y agoThe article that the author links in that sentence goes into more depth; it claims that async/await is better in part because V8 can optimize it better than it can Promises. In other words, async/await is better than Promises, provided that you are not using polyfills. He isn't assuming polyfills are free, he is assuming that you don't need them (or that you can pull them out of your bundle over time)