facebook / react · Issue No. 37091
With Node.js now offering solid support for require(esm), I suggest React consider a pure ESM build for its next major release.
Currently, React’s primary build artifacts published to npm are still based on CommonJS. Historically, retaining CommonJS made practical sense for compatibility, as a vast number of Node.js tooling and server-side applications rely on synchronous require() to load React.
But today, newer versions of Node.js can synchronously load ESM modules via require(), the fundamental blocker preventing React from migrating to a pure ESM build has essentially disappeared.
Therefore, I believe a pure ESM build for React is now practically viable in the next major version, and I encourage the React team to evaluate this direction. Given that a new major release would likely bump the minimum Node.js runtime requirement as well, this might be the perfect timing to push forward with a pure ESM build.
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.