News for hackers. Stuff that matters.
Re:ES modules are terrible by Chyzwar on Sunday November 07, 2021 @06:21AM (#29138438)
Problem is bothed node.js implementation that leaves most of existing applications without migration path. Even today it is not possible to create full ESM application front or backend. It is worse than python 2 to 3.
Re:ES modules are terrible by throw_m239339 on Sunday November 07, 2021 @07:45AM (#29138987)
I would argue that Node way of doing things isn't in the ecmascript spec. The problem isn't ES modules, it's node.js. One could answer "well node.js existed prior es module specification". Irrelevant. DENO doesn't have this problem.
Re:ES modules are terrible by theprotocol on Sunday November 07, 2021 @06:28AM (#29138482)
Absolutely this. It's not necessarily communicated that well in the article, but this is the main reason people are frustrated.
Re:ES modules are terrible by eyelidlessness on Sunday November 07, 2021 @11:44AM (#29140978)
Node ESM support has gotten a lot better through versions 12-17. The biggest problems for workflows that currently work “well” for CJS are:

1. --experimental-loader is more complex and less stable than --require. But it’s also a lot more robust.

2. There’s no equivalent to the require cache, which makes mocking and long running processes like watch mode challenging. This is partly a benefit, as it discourages cache busting patterns like those used in eg Jest which create awful memory leaks.