module: mark require(esm) as stable

This has been released to all active LTS release lines and many
popular packages have been shipping ESM-only distributions based
on the existence of this feature on active LTS. The current documented
behaviors are unlikely to change in a breaking manner within a major
release - as everything with the module loaders, there can always be
subtle changes to undocumented surface that can break edge cases that
assume undocumented behaviors, due to Hyrum's law; but the stability
of this feature is now not different than any other stable parts of
the module loader. It's time to mark it as stable.

PR-URL: https://github.com/nodejs/node/pull/60959
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
Joyee Cheung
2025-12-05 12:02:58 +01:00
committed by Node.js GitHub Bot
parent 902a2e41c7
commit 40c57ed1b5
3 changed files with 8 additions and 8 deletions

View File

@@ -2006,6 +2006,10 @@ added:
- v22.0.0
- v20.17.0
changes:
- version:
- REPLACEME
pr-url: https://github.com/nodejs/node/pull/60959
description: This flag is no longer experimental.
- version:
- REPLACEME
pr-url: https://github.com/nodejs/node/pull/60959
@@ -2019,8 +2023,6 @@ changes:
description: This is now false by default.
-->
> Stability: 1.2 - Release Candidate
Disable support for loading a synchronous ES module graph in `require()`.
See [Loading ECMAScript modules using `require()`][].

View File

@@ -2661,8 +2661,6 @@ A QUIC session failed because version negotiation is required.
### `ERR_REQUIRE_ASYNC_MODULE`
> Stability: 1 - Experimental
When trying to `require()` a [ES Module][], the module turns out to be asynchronous.
That is, it contains top-level await.
@@ -2674,8 +2672,6 @@ before looking for the top-level awaits).
### `ERR_REQUIRE_CYCLE_MODULE`
> Stability: 1 - Experimental
When trying to `require()` a [ES Module][], a CommonJS to ESM or ESM to CommonJS edge
participates in an immediate cycle.
This is not allowed because ES Modules cannot be evaluated while they are

View File

@@ -175,6 +175,10 @@ added:
- v22.0.0
- v20.17.0
changes:
- version:
- REPLACEME
pr-url: https://github.com/nodejs/node/pull/60959
description: This feature is no longer experimental.
- version:
- v23.5.0
- v22.13.0
@@ -195,8 +199,6 @@ changes:
description: Support `'module.exports'` interop export in `require(esm)`.
-->
> Stability: 1.2 - Release candidate
The `.mjs` extension is reserved for [ECMAScript Modules][].
See [Determining module system][] section for more info
regarding which files are parsed as ECMAScript modules.