News for hackers. Stuff that matters.
Re:Ask HN: Why does every package+module system become a Rub... by xiphias2 on Monday January 30, 2023 @06:04AM (#34578222)
Npm has lots of not understandable mistakes: it should already be as good with ES6+TS as other systems. Import should just work everywhere.

We should have left Commonjs a long time ago, while keeping backwards compatibility.

At the same time what I see with the node+npm system is that everything is just ,,it just doesn't work by default''.

Having 10 other package managers doesn't work either, they are faster, but don't solve this problem.

Re:Ask HN: Why does every package+module system become a Rub... by eurasiantiger on Monday January 30, 2023 @08:17AM (#34579181)
Just use .mjs extension for your code, add extensions to your imports and everything does just work.
Re:Ask HN: Why does every package+module system become a Rub... by noahtallen on Monday January 30, 2023 @06:50PM (#34588484)
Except in typescript, where you have to import a file with the .js extension, despite the actual file being .ts: https://github.com/microsoft/TypeScript/issues/42151, https://github.com/microsoft/TypeScript/issues/49083, https://github.com/microsoft/TypeScript/issues/16577

This one issue (IMO) is preventing parts of the ecosystem from switching to esm.

Re:Ask HN: Why does every package+module system become a Rub... by mhio on Tuesday January 31, 2023 @01:16AM (#34591874)
How does the js extension stop a project from targeting ESM?