If JavaScript could finally resolve their build process and module inconsistencies it would be such a fantastic language

Reply to this note

Please Login to reply.

Discussion

Can you recommend good sources that talk about this problem in detail?

This explanation by sindresorhus is a good overview of the modules issue. He removed the old module system from all of his hundreds of open source libraries in one go. 2 months of my life went to upgrading all of that at work 😅

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

And DHH wrote some stuff about the complexity of building JS. Here’s one article I quickly found:

https://world.hey.com/dhh/modern-web-apps-without-javascript-bundling-or-transpiling-a20f2755

Yes, that is a great guide and ESM is a move to the right direction. It still requires you to jump through hoops though, when working with CJS dependencies.

And unfortunately integral parts of the node ecosystem (eg express) still do not publish ESM exports

Thanks guys will check these out!

I think if it is solved, it will be a different language 😂

People are asking too much from JavaScript, it’s good for UI/UX work with HTML and CSS, what it was designed for, for everything else there are better languages out there

JS is ever evolving. You say that it is great at working with CSS, because it was designed for this. Yet when JS was released, CSS was not a thing.

I agree that the “JS for everything” mentality is part of the problem. However at the core the issue is the fragmentation of ecosystems and the vast amount of “standards”

There are ways to improve JS for sure, especially consolidating the modules standard.

Vite is doing a good job, it used to be much worse. But by the nature of it, it will never be as streamlined as go for example. Too many people have different opinions on what JS should be used for and how nowadays

Yes I agree. Vite is amazing, but they focus on the browser and their whole build system is built around ESM. That part of the ecosystem is already great, but it gets hairy where CJS and ESM come together.

Fantastic might be a stretch, but it would reduce 80% of the pain 😅