Wiki: ESM in Node.js: a tangled tale of asynchronicity, compatibility, and people
For agents: Markdown version · Wiki index · Explore
- Speaker: Gil Tayar
- Event: Reversim Summit 2021
- Video: https://www.youtube.com/watch?v=FyUrfol7EMw
- Transcript: /transcripts/2021/21-FyUrfol7EMw.md
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: JavaScript, Software Engineering, Architecture, Open Source
Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.
Summary
This talk explores the turbulent history, politics, and technical challenges surrounding the adoption of ECMAScript Modules (ESM) in Node.js. The speaker details the deep clash between the CommonJS ecosystem and native ESM standards, highlighting how architectural disagreements and standardization efforts caused intense community friction. Ultimately, the audience learns how persistence, compromises, and sheer community burnout shaped the modern module system we use today.
Key points
- 4:36 Node.js originally adopted CommonJS as its module system in 2009 because JavaScript lacked a built-in module system at the time.
- 7:46 Browserify and later Babel combined with Webpack bridged frontend and backend development by transforming ESM to CommonJS.
- 9:51 ES 2015 officially introduced ESM as a language-level syntax with static exports and asynchronous loading semantics.
- 18:35 Integrating native ESM into Node.js sparked a massive architectural dilemma regarding how to handle interoperation with CommonJS files.
- 23:00 Node.js ultimately decided to rely on file extensions and package configuration flags to distinguish between ESM and CommonJS, triggering fierce public backlash.
- 26:08 A dedicated working group was formed to seek consensus, but progress stalled for over a year due to irreconcilable disagreements.
- 28:22 Many vocal opponents eventually left the working group out of exhaustion, leaving the original maintainers to finalize a pragmatic, good-enough compromise.
Takeaways
- Understand the fundamental differences between CommonJS runtime execution and ESM static graph loading.
- Recognize that large-scale architectural migrations in foundational ecosystems often require years of iteration and compromise.
- Be aware of open-source burnout and the human cost of intense technical debates.
Questions this talk answers
- What are the core technical differences between CommonJS and ECMAScript Modules?
- Why was bringing native ESM support to Node.js such a controversial and difficult process?
- How do module bundlers like Webpack differ in execution compared to native Node.js module resolution?
Technologies
Node.js, JavaScript, Babel, Webpack, Browserify
Tags
commonjs, esm, javascript, nodejs, open source, software architecture, standardization