News for hackers. Stuff that matters.
Re:Modern Script Loading by kn8 on Saturday September 28, 2019 @05:36AM (#21099398)
The two drawbacks of module/nomodule that I don’t see being discussed often:

- babel compiles async/await down to regenerator when using modules: true (at least for now) - the definition of “modern” browsers will change eventually and module/nomodule detection will not be relevant

Which is why I’d use ua sniffing: https://github.com/KidkArolis/jetpack/blob/master/docs/07-di...

Re:Modern Script Loading by acemarke on Saturday September 28, 2019 @12:13PM (#21101161)
Babel compiles whatever you tell it to, and each piece of syntax is a separate plugin.

For `babel-preset-env` specifically, it compiles whatever syntax is not natively supported by the browser versions you told it to target.

So, compiling `async/await` and compiling ES module syntax are separate things.

Re:Modern Script Loading by developit on Saturday September 28, 2019 @01:27PM (#21101608)
There are a few cases where syntax compilation is split up cleanly, but when you dig into the internals of preset-env, transforms are rarely that isolated. That being said, "watch this space"...