Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Modern JS #413
Modern JS #413
Conversation
|
Failure is upstream, I've opened an issue on babel-plugin-transform-async-to-promises to report the dead Promise.resolve(). |
|
@developit Give 0.8.12 a go |
|
I've been trying out a bunch with the |
|
@JoviDeCroock – The issue is defining "modern." The module/nomodule pattern provides the only declarative html driven approach to segmenting functionality. By default module means a lower transpilation ceiling than nomodule, but it's target rapidly decays compared to the next definition of "modern." We need better signals from user-agents. |
|
@kristoferbaxter are you talking about some server that would sniff the user agent and return the correct index.html (with corresponding bundle)? |
|
I'm saying that a more pure declarative signal sent via headers is important. But also, for static documents to be able to leverage via mechanisms similar to declarative html treatments for module/nomodule. We can only work with what we have available today – so the most modern you can provide in a statically defined way is module/nomodule. |
|
Glad to see we're sticking to the syntax.esmodules, built a small webpack plugin when this would go live. |
|
Gotta rebase Update is already in master |
|
I should have clarified in my PR description: I view It might be that we decide on "state your syntax and entry", in which case we'd have microbundle generate ES2018 and es5, or steps between the two. |
|
if i don't set this flag, will preset-env respect the browserlist settings in my package.json? Because it also turns on modules (i am 99% sure) if i force modern browsers by their versions. I use edge last 1 version and ff, chrome and safari last 2 versions + mobile equivalents for ios, ff and chrome the most times. |
|
@hbroer FWIW it sounds like your browserslist configuration is really really close to |
|
My understanding of the flag is that it only turns on modules, but everything which is newer than that feature is transpiled. I really have to take a look into that, because this is only what i think i know with a big question mark above my head ^^ I think this would transpiled to
And I would expect it doesn't transpile if I set browserlist to chrome and firefox last versions (and nothing else). |
|
@hbroer your understanding is correct. I agree it would be nice to have the I think we can improve on this over time, but for now |
|
Ok sounds fine. Maybe there should be a notice in the readme that it is possible to use browserlist instead of the flag to address browsers directly. |
|
Yup, we can add that - it actually became possible by accident when we switched to Babel last week! |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

This PR adds a new
modernvalue for the-formats/-foption. Modern output uses thetarget.esmodulessetting from@babel/preset-envto compile modern output.It might be worth exploring targeting something more like "latest". Would love to hear everyone's thoughts!