Let's Say Goodbye to CommonJS (CJS) #55240
-
Node should stop the BS and remove CJS once and for all.
So many discussions, frustration, confusion, work, etc went into this stupid thing, and Node still can'ts stop being obsessed with CJS. Stop the idea of being backward compatible. Even browsers aren't always backward compatible. They aren't even compatible with each other. Just hard delete it in a new major version.
Etc... Just stop. Never mind. I'll try out Deno again, and hopefully it's less trash. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
While browsers aren't always backward compatible, programming environments that have established ecosystems depend on it. Node.js has a vast array of libraries and projects built using CJS. Forcing developers to rewrite or abandon countless existing projects would create a significant burden.
Node.js is offering a path to transition, rather than abruptly forcing everyone to switch to ESM. The coexistence of CJS and ESM lets developers migrate at their own pace, which is especially important for large codebases and legacy systems. The
While it's true that developers need to manage both CJS and ESM for now, that's not unusual in the evolution of programming environments. Tooling has already improved significantly, and Node.js’s approach gives time for libraries and applications to adapt. Eventually, the ecosystem might? be more ESM-centric, but forcing an immediate and hard switch would likely create more frustration than it solves.
Many legacy projects and libraries rely on CJS and are deeply integrated with existing Node.js tools. Removing CJS would alienate developers and businesses that rely on these projects. A sudden break in compatibility would be damaging, as not every project can be easily migrated to ESM due to complexity, resources, or third-party dependencies.
Node.js’s approach is all about developer flexibility. It's not “obsessed with CJS,” but rather respecting its user base's needs. Transitioning to ESM is an ongoing process, and for many, maintaining CJS compatibility is essential for their workflow. I've also marked this discussion as
invalid
|
Beta Was this translation helpful? Give feedback.
While browsers aren't always backward compatible, programming environments that have established ecosystems depend on it. Node.js has a vast array of libraries and projects built using CJS. Forcing developers to rewrite or abandon countless existing projects would create a significant burden.
Node.js is offering a path to transition, rather than abruptly forcing everyone to switch to ESM. The coexistence of CJS and ESM lets developers migrate…