News for hackers. Stuff that matters.
Re:Bun v1.0.0 by swyx on Friday September 08, 2023 @02:44PM (#37437667)
agree. i ought to be a javascript expert by now but nothing makes me feel dumber than navigating all the type:module and .js/cjs/mjs/ts stuff. for a production app of course you should be clear about what you are writing. but for prototyping Bun's permissiveness lets me write code first and worry about the rest later.
Re:Bun v1.0.0 by arjvik on Friday September 08, 2023 @03:34PM (#37438337)
> for a production app of course you should be clear about what you are writing

Agree in sentiment, but I don't think this even applies to the module/import mess. My experience has been that the difficulty is in using different packages that made different choices, and making them interop with your own code. I have still yet to make top-level await work in a Typescript codebase where I need to import nontrivial packages. I don't think you should ever need to worry about the specific way your modules are imported, not in prototyping or in production.

Re:Bun v1.0.0 by pests on Friday September 08, 2023 @11:12PM (#37441897)
I've been writing JavaScript for a long... long... time and I've kinda zoned out the last few years with regards to ESM vs CSJ

I only know that I perfer writing import over require as those semantics and syntax make more sense to me.

Re:Bun v1.0.0 by afgrant on Saturday September 09, 2023 @03:11AM (#37442970)
For the benefit of the future reader, I’m guessing you meant “CJS”, short for CommonJS.