DEV Community

loading...

Discussion on: 7 Reasons Why JavaScript Async/Await Is Better Than Plain Promises (Tutorial)

Collapse
ironydelerium profile image
ironydelerium

Disable that in Babel and let it spit out the actual async/await code instead of polyfilling it. (I do that for various other features as well, HTML custom elements being a big one, since there isn't a good way to write those in an ES3 compatible manner; new.target and Reflect didn't become available until after classes, and since you need to call 'super()' or equivalent in the constructor...)

Combined with webpack or the like, I'm not sure there, I have yet to use it.

Collapse
ffxsam profile image
Sam Hulick

Not all browsers that I need to support can use async/await, unfortunately, so I need to let babel handle that still.

Thread Thread
ironydelerium profile image
ironydelerium

I get that entirely, but for the initial testing and debugging of such code, I'd still turn it off. It lets you get your logic in order without having to debug a polyfill at the same time.

Thread Thread
ffxsam profile image
Sam Hulick

Ah, I gotcha - just for the purpose of debugging. Makes sense!

Collapse
termita81 profile image
RP

Hi, this is probably a silly question, but how do you disable those generators in Babel? Thanks