Skip to content

[v20.x] backport require(esm) and related patches

This backports https://github.com/nodejs/node/pull/51977 and related bug fixes. To reduce the amount of conflicts some other patches touching adjacent lines are also backported.

Note that src: backport FromV8Array is a special backport of https://github.com/nodejs/node/pull/51758 which implements the internal API using the old array iteration approach, because the new V8 API is not available in v20.x - so it's still not going to get any benefit from the new API, but at least this helps reducing the source conflicts when backporting future commits that make use of the new faster callback-based array iteration API.

Module format detection is not backported because all the recent changes in format detection on the main branch are built on top of https://github.com/nodejs/node/pull/50322. If https://github.com/nodejs/node/pull/50322 is not backported first, rewriting the later changes to use the old internal API is going to make backporting it out-of-order even harder. But since that PR is pretty big and adds a new dependency it seems less risky to just backport that separately.

Merge request reports

Loading