News for hackers. Stuff that matters.
Re:Rust Is the Future of JavaScript Infrastructure by sroussey on Thursday November 11, 2021 @03:50PM (#29192983)
Electron uses node and node support for es6 modules is new, and electron itself is just putting its toes in the water. Same with Typescript. Are you using .mts .mtsx files?
Re:Rust Is the Future of JavaScript Infrastructure by vorpalhex on Thursday November 11, 2021 @03:55PM (#29193044)
Node support for ES6 modules has been out for years...
Re:Rust Is the Future of JavaScript Infrastructure by josephg on Thursday November 11, 2021 @04:25PM (#29193393)
Es modules are one of hundreds of features that have been added to javascript since es5. Others include typed arrays, promises, async/await, and so on. Babel configured to recompile code to es5 will polyfill all of those JS features. So the highly efficient V8 implementation of Uint8Array is replaced with slow javascript. Code using async await will be rewritten to use a promise polyfill and callbacks. And so on. The resulting code will be bigger and slower. Sometimes much slower depending on what it’s doing.

List of features in each version of JS: https://kangax.github.io/compat-table/es2016plus/ (also check the ES6 tab)