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.
[ Parent
| on HN ]
> 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.
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.