News for hackers. Stuff that matters.
Re:Deno Joins TC39 by lucacasonato on Monday December 13, 2021 @08:28AM (#29539376)
ESM is not a frontend thing. ESM is the standardized way of doing module imports in JS. It has a lot of benefits for server side developers too:

- It has language syntax for importing and exporting instead of relying on an implicit global.

- It is asynchronous, allowing for top level await.

- It is reliably statically analyzable.

- Because it is asynchronous, module asset loading can happen in parallel which can mean a significant startup speedup for larger projects.

- It is standardized, so it behaves the same across Node, Deno, the web, bundlers, linters, and other tooling.

Re:Deno Joins TC39 by lloydatkinson on Monday December 13, 2021 @10:37AM (#29540524)
Exactly this and I'm a little disappointed, though not surprised that the response was "well it works for me so what's wrong with it? it's only for frontend". It's actually part of the language.

You also forgot another super important point:

- It actually works. How many times have we all run into some weird error or stack trace because node/npm/babel/webpack/typescript/jest/regenerator-runtime/babel-core/quantum-flux-inverter tower of cards collapses when a commonjs module somehow leaks in from node_modules?

Re:Deno Joins TC39 by forty on Monday December 13, 2021 @02:27PM (#29543347)
Precisely, aren't babel & webpack front end issues?
Re:Deno Joins TC39 by lloydatkinson on Tuesday December 14, 2021 @04:19AM (#29549775)
No
Re:Deno Joins TC39 by forty on Tuesday December 14, 2021 @01:17PM (#29555122)
Why would you babel or webpack your nodejs backend code? (Genuinely asking, I have never needed to do it in the last 10 years, so I assumed this was all about browser compatibility and not having to download thousands of small file over the internet respectively)
Re:Deno Joins TC39 by lucacasonato on Monday December 13, 2021 @10:55AM (#29540695)
Oh, 100% agree on that point :D
Re:Deno Joins TC39 by forty on Monday December 13, 2021 @01:38PM (#29542742)
I'm not convinced :)

Admittedly the largest project I'm working on is mostly in TS now, and I probably get most of the benefits of the import syntax even if require is used under the hood (including linters, which I think worked even before we switched to typescript).