4 ms·
Is Babel's generator transpiling support good enough to allow this to be transpiled down to ES5?
by david-given 11y ago
Is Babel's generator transpiling support good enough to allow this to be transpiled down to ES5?
- s986s 11y agoIf your looking for es5 promises are much easier to polyfill and much more competitive than generators
- wging 11y agoCan you clarify what you mean by 'competitive'? Are you talking about performance, or some other measure of quality?
- marten-de-vries 11y agoIt is, the resulting code is just a bit harder to read, and the babel-polyfill is required. It's quite good considering they're transpiling generators actually, but it's hard to beat something working on a higher level (async/await straight to promises, like Kneden does.)
- skrebbel 11y agoIt's actually how babel's "standard" async/await support works. First to generators, then generators to ES5-compatible code using Facebook's Regenerator (which includes a polyfill). Pragmatic and it works, but the code isn't pretty. Which is why Kneden was made.