Thanks to visit codestin.com
Credit goes to github.com

Skip to content

module: implement the "module-sync" exports condition #54648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

joyeecheung
Copy link
Member

@joyeecheung joyeecheung commented Aug 29, 2024

This patch implements a "module-sync" exports condition that's enabled when require(esm) is enabled, so that packages can supply a sycnrhonous ES module to the Node.js module loader, no matter it's being required or imported. (Currently require(esm) is still under --experimental-require-module on v22. It will be unflagged in the upcoming v23 release first. We expect to also unflag require(esm) in v22 after testing in 23).

This is similar to the "module" condition that bundlers have been using to support require(esm) in Node.js, and allows dual-package authors to opt into ESM-first only on newer versions of Node.js that supports require(esm) to avoid the dual-package hazard.

{
  "type": "module",
  "exports": {
    "node": {
      // On new version of Node.js, both require() and import get
      // the ESM version
      "module-sync": "./index.js",
      // On older version of Node.js, where "module-sync" and require(esm) are
      // not supported, use the CJS version to avoid dual-package hazard. 
      // When package authors think it's time to drop support for older versions of
      // Node.js, they can remove the exports conditions and just use "main": "index.js".
      "default": "./dist/index.cjs"
    },
    // On any other environment, use the ESM version.
    "default": "./index.js"
  }
}

Or if the package is only meant to be run on Node.js and wants to fallback to CJS on older versions that don't have require(esm)

{
  "type": "module",
  "exports": {
    // On new version of Node.js, both require() and import get the ESM version
    "module-sync": "./index.js",
    // On older version of Node.js, where "module-sync" and require(esm) are
    // not supported, use the CJS version to avoid dual-package hazard. 
    // When package authors think it's time to drop support for older versions of
    // Node.js, they can remove the exports conditions and just use "main": "index.js".
    "default": "./dist/index.cjs"
  }
}

For package authors: this only serves as a feature-detection mechanism for packages that wish to support both CJS and ESM users during the period when some active Node.js LTS versions support require(esm) while some older ones don't. When all active Node.js LTS lines support require(esm), packages can simplify their distributions by bumping the major version, dropping their CJS exports, and removing the module-sync exports condition (with only main or default targetting the ESM exports). If the package needs to support both bundlers and being run unbundled on Node.js during the transition period, use both module-sync and module and point them to the same ESM file. If the package already doesn't want to support older versions of Node.js that doesn't support require(esm), don't use this export condition.

For bundlers/tools: they should avoid implementing this stop-gap condition. Most existing bundlers implement the de-facto bundler standard module exports condition, and that should be enough to support users who want to bundle ESM from CJS consumers. Users who want both bundlers and Node.js to recognize the ESM exports can use both module/module-sync conditions during the transition period, and can drop module-sync+module when they no longer need to support older versions of Node.js. If tools do want to support this condition, it's recommended to make the resolution rules in the graph pointed by this condition match the Node.js native ESM rules to avoid divergence.

We end up implementing a condition with a different name instead of reusing "module", because existing code in the ecosystem using the "module" condition sometimes also expect the module resolution for these ESM files to work in CJS style, which is supported by bundlers, but the native Node.js loader has intentionally made ESM resolution different from CJS resolution (e.g. forbidding import './noext' or import './directory'), so it would be semver-major to implement a "module" condition without implementing the forbidden ESM resolution rules. For now, this just implments a new condition as semver-minor so it can be backported to older LTS.

The tests added in this patch match the output of using the modulecondition from webpack and esbuild bundles, will a small difference in rollup outputs. See https://github.com/joyeecheung/test-module-condition

Fixes: #52173
Refs: https://github.com/joyeecheung/test-module-condition
Refs: #52697
Refs: https://webpack.js.org/guides/package-exports/#target-environment-independent-packages

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. labels Aug 29, 2024
@joyeecheung
Copy link
Member Author

cc @guybedford

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.24%. Comparing base (e35299a) to head (e96699e).
Report is 1012 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54648      +/-   ##
==========================================
+ Coverage   88.03%   88.24%   +0.21%     
==========================================
  Files         652      652              
  Lines      183797   183886      +89     
  Branches    35863    35853      -10     
==========================================
+ Hits       161804   162279     +475     
+ Misses      15242    14896     -346     
+ Partials     6751     6711      -40     
Files with missing lines Coverage Δ
lib/internal/modules/esm/get_format.js 89.28% <100.00%> (ø)
lib/internal/modules/esm/utils.js 98.89% <100.00%> (+<0.01%) ⬆️
lib/internal/modules/helpers.js 99.03% <100.00%> (+0.98%) ⬆️

... and 98 files with indirect coverage changes

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we document the subtle difference between "module" and "import" at https://nodejs.org/api/packages.html#conditional-exports?

@joyeecheung
Copy link
Member Author

joyeecheung commented Aug 30, 2024

There is a huge section in packages.md that teaches some questionable practices (see #52174) that will soon be outdated when we unflag --experimental-require-module. I am not sure if we should just update that doc now, or leave a TODO (I am inclined to just leave a TODO and don't let this get held back by a huge doc bikeshedding - IMO this documentation doesn't belong in the API docs at all, it should probably be placed in some example repo like the n-api examples that are easier to update and less abstract when it describes multi-file structures)

@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 1, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 1, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 4, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 4, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung
Copy link
Member Author

I did a bit more testing with other bundlers, and put the results in https://github.com/joyeecheung/test-module-condition

In summary it allows running unbundled code that produce the same output as bundled produced by webpack and esbuild. Rollup has a difference in that it doesn't respect insertion-order priorities, but I guess that's probably a problem that can apply to any other exports conditions.

@nicolo-ribaudo
Copy link
Contributor

It would be great if the docs mentioned that module is not a catch-all for ESM, but that you should only use it when your ESM does not use top-level await.

@phryneas
Copy link
Contributor

phryneas commented Sep 5, 2024

This could be problematic where packages ship build explicitly for bundlers, but not for node.

Just as an example: there is a good bunch of packages that use module because it does not get picked up by node, in elaborate schemes to get around a dual package hazard.
Pinging @Andarist on this, as he is shipping a lot of those packages.

You can find some explanation on this in https://github.com/graphql/graphq where we are exploring to ship CommonJS for require, and stubs re-exporting that CommonJS for imports.
module is used explicitly targeting bundlers with a completely different build.

I do not think that this exact bundling schema would be impacted negatively (as this PR would also get around the dual package hazard), but I imagine there might be more reasons to have something "not for node" in module.

Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point @phryneas !

I confirm that this PR breaks require('xstate') under --experimental-require-module.

targos
targos previously requested changes Sep 5, 2024
Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meant to block.

@joyeecheung
Copy link
Member Author

I confirm that this PR breaks require('xstate') under --experimental-require-module.

How did you confirm that this breaks require('xstate') though? I tried it out locally, and it's actually working as intended - require('xstate') === await import('xstate') is even returning true (because we don't need to add the __esModule hack for xstate since it has no default exports, but even if it does, all the name exports are still going to be reference equal)

According to graphql/graphql-js#4062, take the base path for example:

    ".": {
      "module": "./dist/xstate.esm.js",  // Original ESM version
      "import": "./dist/xstate.cjs.mjs",  // Re-exports of the transpiled CJS
      "default": "./dist/xstate.cjs.js"  // Transpiled ESM version
    },

Before this PR, import 'xstate' picks up the re-exports of the transpiled CJS while require('xstate') picks up the transpiled CJS. After this PR, both of them gets the original ESM version under --experimental-require-module (although this reminds me to fill the gap, we should also make it flagged for import). This is actually the desirable situation, and basically the point of choosing module. If we end up inventing a new condition, say require-module, then the package has to do this if they want to ask newer versions of Node.js to use ESM for require()

    ".": {
      "require-module": "./dist/xstate.esm.js",  // Original ESM version
      "module": "./dist/xstate.esm.js",  // Original ESM version
      "import": "./dist/xstate.cjs.mjs",  // Re-exports of the transpiled CJS
      "default": "./dist/xstate.cjs.js"  // Transpiled ESM version
    },

This further bloating is what we are trying to avoid by implementing module, as bundlers already have intended it to be an optimization for require(esm) on Node.js targets.

@joyeecheung
Copy link
Member Author

joyeecheung commented Sep 5, 2024

I imagine there might be more reasons to have something "not for node" in module.

Do you have an example? Considering bundlers have been using this as an optimization for bundling code that does require(esm) on Node.js, it seems risky for a module to deviate from the intended use case already. The cost of using a new condition name for this is that we will risk further bloating the package.json as described in #54648 (comment), instead of keeping existing package.json work out of the box if they are following a guideline such as https://webpack.js.org/guides/package-exports/#target-environment-independent-packages

@targos
Copy link
Member

targos commented Sep 5, 2024

I'm no longer with my computer but my reproduction ended up in a throw (while v22 with the flag doesn't throw).
Just install xstate, write a commonjs file that requires it, and run the file with the node built from this PR.
Without the flag it passes, with the flag it throws.

joyeecheung added a commit to joyeecheung/node that referenced this pull request Feb 5, 2025
This patch implements a "module-sync" exports condition
for packages to supply a sycnrhonous ES module to the
Node.js module loader, no matter it's being required
or imported. This is similar to the "module" condition
that bundlers have been using to support `require(esm)`
in Node.js, and allows dual-package authors to opt into
ESM-first only newer versions of Node.js that supports
require(esm) while avoiding the dual-package hazard.

```json
{
  "type": "module",
  "exports": {
    "node": {
      // On new version of Node.js, both require() and import get
      // the ESM version
      "module-sync": "./index.js",
      // On older version of Node.js, where "module" and
      // require(esm) are not supported, use the transpiled CJS version
      // to avoid dual-package hazard. Library authors can decide
      // to drop support for older versions of Node.js when they think
      // it's time.
      "default": "./dist/index.cjs"
    },
    // On any other environment, use the ESM version.
    "default": "./index.js"
  }
}
```

We end up implementing a condition with a different name
instead of reusing "module", because existing code in the
ecosystem using the "module" condition sometimes also expect
the module resolution for these ESM files to work in CJS
style, which is supported by bundlers, but the native
Node.js loader has intentionally made ESM resolution
different from CJS resolution (e.g. forbidding `import
'./noext'` or `import './directory'`), so it would be
semver-major to implement a `"module"` condition
without implementing the forbidden ESM resolution rules.
For now, this just implments a new condition as semver-minor
so it can be backported to older LTS.

Refs: https://webpack.js.org/guides/package-exports/#target-environment-independent-packages
PR-URL: nodejs#54648
Fixes: nodejs#52173
Refs: https://github.com/joyeecheung/test-module-condition
Refs: nodejs#52697
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
joyeecheung added a commit to joyeecheung/node that referenced this pull request Feb 5, 2025
This patch implements a "module-sync" exports condition
for packages to supply a sycnrhonous ES module to the
Node.js module loader, no matter it's being required
or imported. This is similar to the "module" condition
that bundlers have been using to support `require(esm)`
in Node.js, and allows dual-package authors to opt into
ESM-first only newer versions of Node.js that supports
require(esm) while avoiding the dual-package hazard.

```json
{
  "type": "module",
  "exports": {
    "node": {
      // On new version of Node.js, both require() and import get
      // the ESM version
      "module-sync": "./index.js",
      // On older version of Node.js, where "module" and
      // require(esm) are not supported, use the transpiled CJS version
      // to avoid dual-package hazard. Library authors can decide
      // to drop support for older versions of Node.js when they think
      // it's time.
      "default": "./dist/index.cjs"
    },
    // On any other environment, use the ESM version.
    "default": "./index.js"
  }
}
```

We end up implementing a condition with a different name
instead of reusing "module", because existing code in the
ecosystem using the "module" condition sometimes also expect
the module resolution for these ESM files to work in CJS
style, which is supported by bundlers, but the native
Node.js loader has intentionally made ESM resolution
different from CJS resolution (e.g. forbidding `import
'./noext'` or `import './directory'`), so it would be
semver-major to implement a `"module"` condition
without implementing the forbidden ESM resolution rules.
For now, this just implments a new condition as semver-minor
so it can be backported to older LTS.

Refs: https://webpack.js.org/guides/package-exports/#target-environment-independent-packages
PR-URL: nodejs#54648
Fixes: nodejs#52173
Refs: https://github.com/joyeecheung/test-module-condition
Refs: nodejs#52697
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
joyeecheung added a commit to joyeecheung/node that referenced this pull request Feb 5, 2025
This patch implements a "module-sync" exports condition
for packages to supply a sycnrhonous ES module to the
Node.js module loader, no matter it's being required
or imported. This is similar to the "module" condition
that bundlers have been using to support `require(esm)`
in Node.js, and allows dual-package authors to opt into
ESM-first only newer versions of Node.js that supports
require(esm) while avoiding the dual-package hazard.

```json
{
  "type": "module",
  "exports": {
    "node": {
      // On new version of Node.js, both require() and import get
      // the ESM version
      "module-sync": "./index.js",
      // On older version of Node.js, where "module" and
      // require(esm) are not supported, use the transpiled CJS version
      // to avoid dual-package hazard. Library authors can decide
      // to drop support for older versions of Node.js when they think
      // it's time.
      "default": "./dist/index.cjs"
    },
    // On any other environment, use the ESM version.
    "default": "./index.js"
  }
}
```

We end up implementing a condition with a different name
instead of reusing "module", because existing code in the
ecosystem using the "module" condition sometimes also expect
the module resolution for these ESM files to work in CJS
style, which is supported by bundlers, but the native
Node.js loader has intentionally made ESM resolution
different from CJS resolution (e.g. forbidding `import
'./noext'` or `import './directory'`), so it would be
semver-major to implement a `"module"` condition
without implementing the forbidden ESM resolution rules.
For now, this just implments a new condition as semver-minor
so it can be backported to older LTS.

Refs: https://webpack.js.org/guides/package-exports/#target-environment-independent-packages
PR-URL: nodejs#54648
Fixes: nodejs#52173
Refs: https://github.com/joyeecheung/test-module-condition
Refs: nodejs#52697
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
@joyeecheung joyeecheung added the backport-open-v20.x Indicate that the PR has an open backport label Feb 6, 2025
@joyeecheung
Copy link
Member Author

Backport in #56927

joyeecheung added a commit to joyeecheung/node that referenced this pull request Feb 6, 2025
This patch implements a "module-sync" exports condition
for packages to supply a sycnrhonous ES module to the
Node.js module loader, no matter it's being required
or imported. This is similar to the "module" condition
that bundlers have been using to support `require(esm)`
in Node.js, and allows dual-package authors to opt into
ESM-first only newer versions of Node.js that supports
require(esm) while avoiding the dual-package hazard.

```json
{
  "type": "module",
  "exports": {
    "node": {
      // On new version of Node.js, both require() and import get
      // the ESM version
      "module-sync": "./index.js",
      // On older version of Node.js, where "module" and
      // require(esm) are not supported, use the transpiled CJS version
      // to avoid dual-package hazard. Library authors can decide
      // to drop support for older versions of Node.js when they think
      // it's time.
      "default": "./dist/index.cjs"
    },
    // On any other environment, use the ESM version.
    "default": "./index.js"
  }
}
```

We end up implementing a condition with a different name
instead of reusing "module", because existing code in the
ecosystem using the "module" condition sometimes also expect
the module resolution for these ESM files to work in CJS
style, which is supported by bundlers, but the native
Node.js loader has intentionally made ESM resolution
different from CJS resolution (e.g. forbidding `import
'./noext'` or `import './directory'`), so it would be
semver-major to implement a `"module"` condition
without implementing the forbidden ESM resolution rules.
For now, this just implments a new condition as semver-minor
so it can be backported to older LTS.

Refs: https://webpack.js.org/guides/package-exports/#target-environment-independent-packages
PR-URL: nodejs#54648
Fixes: nodejs#52173
Refs: https://github.com/joyeecheung/test-module-condition
Refs: nodejs#52697
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
joyeecheung added a commit to joyeecheung/node that referenced this pull request Feb 6, 2025
This patch implements a "module-sync" exports condition
for packages to supply a sycnrhonous ES module to the
Node.js module loader, no matter it's being required
or imported. This is similar to the "module" condition
that bundlers have been using to support `require(esm)`
in Node.js, and allows dual-package authors to opt into
ESM-first only newer versions of Node.js that supports
require(esm) while avoiding the dual-package hazard.

```json
{
  "type": "module",
  "exports": {
    "node": {
      // On new version of Node.js, both require() and import get
      // the ESM version
      "module-sync": "./index.js",
      // On older version of Node.js, where "module" and
      // require(esm) are not supported, use the transpiled CJS version
      // to avoid dual-package hazard. Library authors can decide
      // to drop support for older versions of Node.js when they think
      // it's time.
      "default": "./dist/index.cjs"
    },
    // On any other environment, use the ESM version.
    "default": "./index.js"
  }
}
```

We end up implementing a condition with a different name
instead of reusing "module", because existing code in the
ecosystem using the "module" condition sometimes also expect
the module resolution for these ESM files to work in CJS
style, which is supported by bundlers, but the native
Node.js loader has intentionally made ESM resolution
different from CJS resolution (e.g. forbidding `import
'./noext'` or `import './directory'`), so it would be
semver-major to implement a `"module"` condition
without implementing the forbidden ESM resolution rules.
For now, this just implments a new condition as semver-minor
so it can be backported to older LTS.

Refs: https://webpack.js.org/guides/package-exports/#target-environment-independent-packages
PR-URL: nodejs#54648
Fixes: nodejs#52173
Refs: https://github.com/joyeecheung/test-module-condition
Refs: nodejs#52697
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
joyeecheung added a commit to joyeecheung/node that referenced this pull request Feb 10, 2025
This patch implements a "module-sync" exports condition
for packages to supply a sycnrhonous ES module to the
Node.js module loader, no matter it's being required
or imported. This is similar to the "module" condition
that bundlers have been using to support `require(esm)`
in Node.js, and allows dual-package authors to opt into
ESM-first only newer versions of Node.js that supports
require(esm) while avoiding the dual-package hazard.

```json
{
  "type": "module",
  "exports": {
    "node": {
      // On new version of Node.js, both require() and import get
      // the ESM version
      "module-sync": "./index.js",
      // On older version of Node.js, where "module" and
      // require(esm) are not supported, use the transpiled CJS version
      // to avoid dual-package hazard. Library authors can decide
      // to drop support for older versions of Node.js when they think
      // it's time.
      "default": "./dist/index.cjs"
    },
    // On any other environment, use the ESM version.
    "default": "./index.js"
  }
}
```

We end up implementing a condition with a different name
instead of reusing "module", because existing code in the
ecosystem using the "module" condition sometimes also expect
the module resolution for these ESM files to work in CJS
style, which is supported by bundlers, but the native
Node.js loader has intentionally made ESM resolution
different from CJS resolution (e.g. forbidding `import
'./noext'` or `import './directory'`), so it would be
semver-major to implement a `"module"` condition
without implementing the forbidden ESM resolution rules.
For now, this just implments a new condition as semver-minor
so it can be backported to older LTS.

Refs: https://webpack.js.org/guides/package-exports/#target-environment-independent-packages
PR-URL: nodejs#54648
Fixes: nodejs#52173
Refs: https://github.com/joyeecheung/test-module-condition
Refs: nodejs#52697
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Feb 11, 2025
This patch implements a "module-sync" exports condition
for packages to supply a sycnrhonous ES module to the
Node.js module loader, no matter it's being required
or imported. This is similar to the "module" condition
that bundlers have been using to support `require(esm)`
in Node.js, and allows dual-package authors to opt into
ESM-first only newer versions of Node.js that supports
require(esm) while avoiding the dual-package hazard.

```json
{
  "type": "module",
  "exports": {
    "node": {
      // On new version of Node.js, both require() and import get
      // the ESM version
      "module-sync": "./index.js",
      // On older version of Node.js, where "module" and
      // require(esm) are not supported, use the transpiled CJS version
      // to avoid dual-package hazard. Library authors can decide
      // to drop support for older versions of Node.js when they think
      // it's time.
      "default": "./dist/index.cjs"
    },
    // On any other environment, use the ESM version.
    "default": "./index.js"
  }
}
```

We end up implementing a condition with a different name
instead of reusing "module", because existing code in the
ecosystem using the "module" condition sometimes also expect
the module resolution for these ESM files to work in CJS
style, which is supported by bundlers, but the native
Node.js loader has intentionally made ESM resolution
different from CJS resolution (e.g. forbidding `import
'./noext'` or `import './directory'`), so it would be
semver-major to implement a `"module"` condition
without implementing the forbidden ESM resolution rules.
For now, this just implments a new condition as semver-minor
so it can be backported to older LTS.

Refs: https://webpack.js.org/guides/package-exports/#target-environment-independent-packages
PR-URL: #54648
Backport-PR-URL: #56927
Fixes: #52173
Refs: https://github.com/joyeecheung/test-module-condition
Refs: #52697
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Mar 6, 2025
marco-ippolito added a commit that referenced this pull request Mar 6, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: TODO
marco-ippolito added a commit that referenced this pull request Mar 6, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: #57349
marco-ippolito added a commit that referenced this pull request Mar 6, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: #57349
marco-ippolito added a commit that referenced this pull request Mar 6, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: #57349
marco-ippolito pushed a commit that referenced this pull request Mar 6, 2025
marco-ippolito added a commit that referenced this pull request Mar 6, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: #57349
marco-ippolito added a commit that referenced this pull request Mar 6, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: #57349
marco-ippolito added a commit that referenced this pull request Mar 7, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: #57349
marco-ippolito added a commit that referenced this pull request Mar 13, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: #57349
mwalbeck pushed a commit to mwalbeck/docker-cyberchef that referenced this pull request Mar 22, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [node](https://github.com/nodejs/node) | stage | minor | `20.18.3-bullseye` -> `20.19.0-bullseye` |

---

### Release Notes

<details>
<summary>nodejs/node (node)</summary>

### [`v20.19.0`](https://github.com/nodejs/node/releases/tag/v20.19.0): 2025-03-13, Version 20.19.0 &#x27;Iron&#x27; (LTS), @&#8203;marco-ippolito

[Compare Source](nodejs/node@v20.18.3...v20.19.0)

##### Notable Changes

##### require(esm) is now enabled by default

Support for loading native ES modules using require() had been available on v20.x under the command line flag --experimental-require-module, and available by default on v22.x and v23.x. In this release, it is now no longer behind a flag on v20.x.

This feature has been tested on v23.x and v22.x, and we are looking for user feedback from v20.x to make more final tweaks before fully stabilizing it.
It now no longer emits a warning unless `--trace-require-module` is explicitly used.
If there happens to be any regressions caused by this feature, users can report it to the Node.js issue tracker. Meanwhile this feature can also be disabled using `--no-experimental-require-module` as a workaround.

With this feature enabled, Node.js will no longer throw `ERR_REQUIRE_ESM` if `require()` is used to load a ES module. It can, however, throw `ERR_REQUIRE_ASYNC_MODULE` if the ES module being loaded or its dependencies contain top-level `await`. When the ES module is loaded successfully by `require()`, the returned object will either be a ES module namespace object similar to what's returned by `import()`, or what gets exported as `"module.exports"` in the ES module.

Users can check `process.features.require_module` to see whether `require(esm)` is enabled in the current Node.js instance. For packages, the `"module-sync"` exports condition can be used as a way to detect `require(esm)` support in the current Node.js instance and allow both `require()` and `import` to load the same native ES module. See [the documentation](https://nodejs.org/docs/latest/api/modules.html#loading-ecmascript-modules-using-require) for more details about this feature.

Contributed by Joyee Cheung in [#&#8203;55085](nodejs/node#55085)

##### Module syntax detection is now enabled by default

Module syntax detection (the `--experimental-detect-module` flag) is now
enabled by default. Use `--no-experimental-detect-module` to disable it if
needed.

Syntax detection attempts to run ambiguous files as CommonJS, and if the module
fails to parse as CommonJS due to ES module syntax, Node.js tries again and runs
the file as an ES module.
Ambiguous files are those with a `.js` or no extension, where the nearest parent
`package.json` has no `"type"` field (either `"type": "module"` or
`"type": "commonjs"`).
Syntax detection should have no performance impact on CommonJS modules, but it
incurs a slight performance penalty for ES modules; add `"type": "module"` to
the nearest parent `package.json` file to eliminate the performance cost.
A use case unlocked by this feature is the ability to use ES module syntax in
extensionless scripts with no nearby `package.json`.

Thanks to Geoffrey Booth for making this work on [#&#8203;53619](nodejs/node#53619).

##### Other Notable Changes

-   \[[`285bb4ee14`](nodejs/node@285bb4ee14)] - **crypto**: update root certificates to NSS 3.107 (Node.js GitHub Bot) [#&#8203;56566](nodejs/node#56566)
-   \[[`73b5c16684`](nodejs/node@73b5c16684)] - **(SEMVER-MINOR)** **worker**: add postMessageToThread (Paolo Insogna) [#&#8203;53682](nodejs/node#53682)
-   \[[`de313b2336`](nodejs/node@de313b2336)] - **(SEMVER-MINOR)** **module**: only emit require(esm) warning under --trace-require-module (Joyee Cheung) [#&#8203;56194](nodejs/node#56194)
-   \[[`4fba01911d`](nodejs/node@4fba01911d)] - **(SEMVER-MINOR)** **process**: add process.features.require_module (Joyee Cheung) [#&#8203;55241](nodejs/node#55241)
-   \[[`df8a045afe`](nodejs/node@df8a045afe)] - **(SEMVER-MINOR)** **module**: implement the "module-sync" exports condition (Joyee Cheung) [#&#8203;54648](nodejs/node#54648)
-   \[[`f9dc1eaef5`](nodejs/node@f9dc1eaef5)] - **(SEMVER-MINOR)** **module**: add \__esModule to require()'d ESM (Joyee Cheung) [#&#8203;52166](nodejs/node#52166)

<details>
<summary>
Commits
</summary>

-   \[[`d84be843e3`](nodejs/node@d84be843e3)] - **benchmark**: add validateStream to styleText bench (Rafael Gonzaga) [#&#8203;56556](nodejs/node#56556)
-   \[[`d8eaf5b9b8`](nodejs/node@d8eaf5b9b8)] - **build**: fix compatibility with V8's `depot_tools` (Richard Lau) [#&#8203;57330](nodejs/node#57330)
-   \[[`1ee4bf9690`](nodejs/node@1ee4bf9690)] - **build**: test macos-13 on GitHub actions (Michaël Zasso) [#&#8203;56307](nodejs/node#56307)
-   \[[`1cc8d69882`](nodejs/node@1cc8d69882)] - **build**: build v8 with -fvisibility=hidden on macOS (Joyee Cheung) [#&#8203;56275](nodejs/node#56275)
-   \[[`52f1f7e22b`](nodejs/node@52f1f7e22b)] - **child_process**: fix parsing messages with splitted length field (Maksim Gorkov) [#&#8203;56106](nodejs/node#56106)
-   \[[`5ef3c3c996`](nodejs/node@5ef3c3c996)] - **crypto**: add missing return value check (Michael Dawson) [#&#8203;56615](nodejs/node#56615)
-   \[[`285bb4ee14`](nodejs/node@285bb4ee14)] - **crypto**: update root certificates to NSS 3.107 (Node.js GitHub Bot) [#&#8203;56566](nodejs/node#56566)
-   \[[`46ceb9dc1c`](nodejs/node@46ceb9dc1c)] - **deps**: update timezone to 2025a (Node.js GitHub Bot) [#&#8203;56876](nodejs/node#56876)
-   \[[`d4ca38fe8e`](nodejs/node@d4ca38fe8e)] - **deps**: macro ENODATA is deprecated in libc++ (Cheng) [#&#8203;56698](nodejs/node#56698)
-   \[[`15214e6508`](nodejs/node@15214e6508)] - **deps**: update simdutf to 6.0.3 (Node.js GitHub Bot) [#&#8203;56567](nodejs/node#56567)
-   \[[`1e44f5d84b`](nodejs/node@1e44f5d84b)] - **deps**: update simdutf to 5.7.2 (Node.js GitHub Bot) [#&#8203;56388](nodejs/node#56388)
-   \[[`b92ff7be38`](nodejs/node@b92ff7be38)] - **deps**: update googletest to [`7d76a23`](nodejs/node@7d76a23) (Node.js GitHub Bot) [#&#8203;56387](nodejs/node#56387)
-   \[[`e1b71a81a9`](nodejs/node@e1b71a81a9)] - **deps**: update googletest to [`e54519b`](nodejs/node@e54519b) (Node.js GitHub Bot) [#&#8203;56370](nodejs/node#56370)
-   \[[`c0d45e7f38`](nodejs/node@c0d45e7f38)] - **deps**: update simdutf to 5.7.0 (Node.js GitHub Bot) [#&#8203;56332](nodejs/node#56332)
-   \[[`d69107f5a8`](nodejs/node@d69107f5a8)] - **deps**: update icu to 76.1 (Node.js GitHub Bot) [#&#8203;55551](nodejs/node#55551)
-   \[[`5c9a397699`](nodejs/node@5c9a397699)] - **deps**: V8: backport [`9ab4059`](nodejs/node@9ab40592f697) (Lu Yahan) [#&#8203;56781](nodejs/node#56781)
-   \[[`8342233f6d`](nodejs/node@8342233f6d)] - **deps**: update corepack to 0.31.0 (Node.js GitHub Bot) [#&#8203;56795](nodejs/node#56795)
-   \[[`561493d35e`](nodejs/node@561493d35e)] - **deps,src**: simplify base64 encoding (Daniel Lemire) [#&#8203;52714](nodejs/node#52714)
-   \[[`6207b2936c`](nodejs/node@6207b2936c)] - **doc**: move anatoli to emeritus (Michael Dawson) [#&#8203;56592](nodejs/node#56592)
-   \[[`b0ab483400`](nodejs/node@b0ab483400)] - **doc**: fix styles of the expandable TOC (Antoine du Hamel) [#&#8203;56755](nodejs/node#56755)
-   \[[`53e4dc2a82`](nodejs/node@53e4dc2a82)] - **doc**: add "Skip to content" button (Antoine du Hamel) [#&#8203;56750](nodejs/node#56750)
-   \[[`33ee4645c3`](nodejs/node@33ee4645c3)] - **doc**: improve accessibility of expandable lists (Antoine du Hamel) [#&#8203;56749](nodejs/node#56749)
-   \[[`b514438418`](nodejs/node@b514438418)] - **doc**: add note regarding commit message trailers (Dario Piotrowicz) [#&#8203;56736](nodejs/node#56736)
-   \[[`627f2997e3`](nodejs/node@627f2997e3)] - **doc**: fix typo in example code for util.styleText (Robin Mehner) [#&#8203;56720](nodejs/node#56720)
-   \[[`68548dcb48`](nodejs/node@68548dcb48)] - **doc**: fix inconsistencies in `WeakSet` and `WeakMap` comparison details (Shreyans Pathak) [#&#8203;56683](nodejs/node#56683)
-   \[[`337cfb2549`](nodejs/node@337cfb2549)] - **doc**: add RafaelGSS as latest sec release stewards (Rafael Gonzaga) [#&#8203;56682](nodejs/node#56682)
-   \[[`e890c86d7b`](nodejs/node@e890c86d7b)] - **doc**: clarify cjs/esm diff in `queueMicrotask()` vs `process.nextTick()` (Dario Piotrowicz) [#&#8203;56659](nodejs/node#56659)
-   \[[`978263923f`](nodejs/node@978263923f)] - **doc**: `WeakSet` and `WeakMap` comparison details (Shreyans Pathak) [#&#8203;56648](nodejs/node#56648)
-   \[[`aba280ccd8`](nodejs/node@aba280ccd8)] - **doc**: mention prepare --security (Rafael Gonzaga) [#&#8203;56617](nodejs/node#56617)
-   \[[`0a009a527b`](nodejs/node@0a009a527b)] - **doc**: tweak info on reposts in ambassador program (Michael Dawson) [#&#8203;56589](nodejs/node#56589)
-   \[[`d2f09e2ab3`](nodejs/node@d2f09e2ab3)] - **doc**: add type stripping to ambassadors program (Marco Ippolito) [#&#8203;56598](nodejs/node#56598)
-   \[[`b0b77d7fbe`](nodejs/node@b0b77d7fbe)] - **doc**: improve internal documentation on built-in snapshot (Joyee Cheung) [#&#8203;56505](nodejs/node#56505)
-   \[[`4b3e7fee94`](nodejs/node@4b3e7fee94)] - **doc**: document CLI way to open the nodejs/bluesky PR (Antoine du Hamel) [#&#8203;56506](nodejs/node#56506)
-   \[[`03878b0384`](nodejs/node@03878b0384)] - **doc**: update gcc-version for ubuntu-lts (Kunal Kumar) [#&#8203;56553](nodejs/node#56553)
-   \[[`acbbd7c1a6`](nodejs/node@acbbd7c1a6)] - **doc**: fix parentheses in options (Tobias Nießen) [#&#8203;56563](nodejs/node#56563)
-   \[[`3fe80c30b8`](nodejs/node@3fe80c30b8)] - **doc**: include CVE to EOL lines as sec release process (Rafael Gonzaga) [#&#8203;56520](nodejs/node#56520)
-   \[[`ff8af58046`](nodejs/node@ff8af58046)] - **doc**: add esm examples to node:trace_events (Alfredo González) [#&#8203;56514](nodejs/node#56514)
-   \[[`27b9cfd135`](nodejs/node@27b9cfd135)] - **doc**: add message for Ambassadors to promote (Michael Dawson) [#&#8203;56235](nodejs/node#56235)
-   \[[`020c939da1`](nodejs/node@020c939da1)] - **doc**: allow request for TSC reviews via the GitHub UI (Antoine du Hamel) [#&#8203;56493](nodejs/node#56493)
-   \[[`1ef9c9a354`](nodejs/node@1ef9c9a354)] - **doc**: add example for piping ReadableStream (Gabriel Schulhof) [#&#8203;56415](nodejs/node#56415)
-   \[[`e675c3a7fc`](nodejs/node@e675c3a7fc)] - **doc**: expand description of `parseArg`'s `default` (Kevin Gibbons) [#&#8203;54431](nodejs/node#54431)
-   \[[`bc756da876`](nodejs/node@bc756da876)] - **doc**: use `<ul>` instead of `<ol>` in `SECURITY.md` (Antoine du Hamel) [#&#8203;56346](nodejs/node#56346)
-   \[[`ad59c82a49`](nodejs/node@ad59c82a49)] - **doc**: clarify that WASM is trusted (Matteo Collina) [#&#8203;56345](nodejs/node#56345)
-   \[[`8e76cc69e5`](nodejs/node@8e76cc69e5)] - **doc**: move dual package shipping docs to separate repo (Joyee Cheung) [#&#8203;55444](nodejs/node#55444)
-   \[[`9fda8e29cd`](nodejs/node@9fda8e29cd)] - **doc**: mark `--env-file-if-exists` flag as experimental (Juan José) [#&#8203;56893](nodejs/node#56893)
-   \[[`9e975f1a7d`](nodejs/node@9e975f1a7d)] - **doc**: fix link and history of `SourceMap` sections (Antoine du Hamel) [#&#8203;57098](nodejs/node#57098)
-   \[[`64ce95b8fc`](nodejs/node@64ce95b8fc)] - **doc**: update `require(ESM)` history and stability status (Antoine du Hamel) [#&#8203;55199](nodejs/node#55199)
-   \[[`697a39248b`](nodejs/node@697a39248b)] - **doc**: fix history of `process.features` (Antoine du Hamel) [#&#8203;54897](nodejs/node#54897)
-   \[[`7c38e503a3`](nodejs/node@7c38e503a3)] - **doc**: add documentation for process.features (Marco Ippolito) [#&#8203;54897](nodejs/node#54897)
-   \[[`c85b386a39`](nodejs/node@c85b386a39)] - **esm**: fix jsdoc type refs to `ModuleJobBase` in esm/loader (Jacob Smith) [#&#8203;56499](nodejs/node#56499)
-   \[[`4813a6a66c`](nodejs/node@4813a6a66c)] - **esm**: throw `ERR_REQUIRE_ESM` instead of `ERR_INTERNAL_ASSERTION` (Antoine du Hamel) [#&#8203;54868](nodejs/node#54868)
-   \[[`0d327c8e47`](nodejs/node@0d327c8e47)] - **esm**: refactor `get_format` (Antoine du Hamel) [#&#8203;53872](nodejs/node#53872)
-   \[[`e87db6c9bc`](nodejs/node@e87db6c9bc)] - **events**: add hasEventListener util for validate (Sunghoon) [#&#8203;55230](nodejs/node#55230)
-   \[[`674b932f33`](nodejs/node@674b932f33)] - **http**: don't emit error after destroy (Robert Nagy) [#&#8203;55457](nodejs/node#55457)
-   \[[`4c24ef8f71`](nodejs/node@4c24ef8f71)] - **http2**: omit server name when HTTP2 host is IP address (islandryu) [#&#8203;56530](nodejs/node#56530)
-   \[[`533afe8124`](nodejs/node@533afe8124)] - **lib**: reduce amount of caught URL errors (Yagiz Nizipli) [#&#8203;52658](nodejs/node#52658)
-   \[[`34221a1d6e`](nodejs/node@34221a1d6e)] - **lib**: allow CJS source map cache to be reclaimed (Chengzhong Wu) [#&#8203;51711](nodejs/node#51711)
-   \[[`f13589f1f9`](nodejs/node@f13589f1f9)] - **lib,src**: iterate module requests of a module wrap in JS (Chengzhong Wu) [#&#8203;52058](nodejs/node#52058)
-   \[[`6afee9ea43`](nodejs/node@6afee9ea43)] - **meta**: move one or more collaborators to emeritus (Node.js GitHub Bot) [#&#8203;56580](nodejs/node#56580)
-   \[[`85bb738739`](nodejs/node@85bb738739)] - **meta**: add codeowners of security release document (Rafael Gonzaga) [#&#8203;56521](nodejs/node#56521)
-   \[[`48f9ca0992`](nodejs/node@48f9ca0992)] - **meta**: move one or more collaborators to emeritus (Node.js GitHub Bot) [#&#8203;56342](nodejs/node#56342)
-   \[[`4d724121b4`](nodejs/node@4d724121b4)] - **meta**: move MoLow to TSC regular member (Moshe Atlow) [#&#8203;56276](nodejs/node#56276)
-   \[[`5e2dab7868`](nodejs/node@5e2dab7868)] - **module**: fix bad `require.resolve` with option paths for `.` and `..` (Dario Piotrowicz) [#&#8203;56735](nodejs/node#56735)
-   \[[`f507c05060`](nodejs/node@f507c05060)] - **module**: simplify --inspect-brk handling (Joyee Cheung) [#&#8203;55679](nodejs/node#55679)
-   \[[`ed2d373e5a`](nodejs/node@ed2d373e5a)] - **module**: disable require(esm) for policy and network import (Joyee Cheung) [#&#8203;56927](nodejs/node#56927)
-   \[[`de313b2336`](nodejs/node@de313b2336)] - **(SEMVER-MINOR)** **module**: only emit require(esm) warning under --trace-require-module (Joyee Cheung) [#&#8203;56194](nodejs/node#56194)
-   \[[`3d89e6b6fa`](nodejs/node@3d89e6b6fa)] - **module**: mark evaluation rejection in require(esm) as handled (Joyee Cheung) [#&#8203;56122](nodejs/node#56122)
-   \[[`e01dd4bd4f`](nodejs/node@e01dd4bd4f)] - **module**: do not warn when require(esm) comes from node_modules (Joyee Cheung) [#&#8203;55960](nodejs/node#55960)
-   \[[`011e6e0032`](nodejs/node@011e6e0032)] - **module**: fix error thrown from require(esm) hitting TLA repeatedly (Joyee Cheung) [#&#8203;55520](nodejs/node#55520)
-   \[[`fdf50289c6`](nodejs/node@fdf50289c6)] - **module**: trim off internal stack frames for require(esm) warnings (Joyee Cheung) [#&#8203;55496](nodejs/node#55496)
-   \[[`8d33f78ca5`](nodejs/node@8d33f78ca5)] - **module**: allow ESM that failed to be required to be re-imported (Joyee Cheung) [#&#8203;55502](nodejs/node#55502)
-   \[[`8192dd6cf3`](nodejs/node@8192dd6cf3)] - **module**: include module information in require(esm) warning (Joyee Cheung) [#&#8203;55397](nodejs/node#55397)
-   \[[`1db210a0ec`](nodejs/node@1db210a0ec)] - **module**: check --experimental-require-module separately from detection (Joyee Cheung) [#&#8203;55250](nodejs/node#55250)
-   \[[`cf8701c866`](nodejs/node@cf8701c866)] - **module**: use kNodeModulesRE to detect node_modules (Joyee Cheung) [#&#8203;55243](nodejs/node#55243)
-   \[[`dc66632261`](nodejs/node@dc66632261)] - **module**: support 'module.exports' interop export in require(esm) (Guy Bedford) [#&#8203;54563](nodejs/node#54563)
-   \[[`1ac1dda9a4`](nodejs/node@1ac1dda9a4)] - **(SEMVER-MINOR)** **module**: unflag --experimental-require-module (Joyee Cheung) [#&#8203;55085](nodejs/node#55085)
-   \[[`683c93f45f`](nodejs/node@683c93f45f)] - **module**: refator ESM loader for adding future synchronous hooks (Joyee Cheung) [#&#8203;54769](nodejs/node#54769)
-   \[[`df8a045afe`](nodejs/node@df8a045afe)] - **(SEMVER-MINOR)** **module**: implement the "module-sync" exports condition (Joyee Cheung) [#&#8203;54648](nodejs/node#54648)
-   \[[`249d82b686`](nodejs/node@249d82b686)] - **module**: report unfinished TLA in ambiguous modules (Antoine du Hamel) [#&#8203;54980](nodejs/node#54980)
-   \[[`1925d729f9`](nodejs/node@1925d729f9)] - **module**: remove bogus assertion in CJS entrypoint handling with --import (Joyee Cheung) [#&#8203;54592](nodejs/node#54592)
-   \[[`d1331fccb2`](nodejs/node@d1331fccb2)] - **module**: do not warn for typeless package.json when there isn't one (Joyee Cheung) [#&#8203;54045](nodejs/node#54045)
-   \[[`9916458b44`](nodejs/node@9916458b44)] - **(SEMVER-MINOR)** **module**: unflag detect-module (Geoffrey Booth) [#&#8203;53619](nodejs/node#53619)
-   \[[`f9dc1eaef5`](nodejs/node@f9dc1eaef5)] - **(SEMVER-MINOR)** **module**: add \__esModule to require()'d ESM (Joyee Cheung) [#&#8203;52166](nodejs/node#52166)
-   \[[`b86f575504`](nodejs/node@b86f575504)] - **module**: do not set CJS variables for Worker eval (Antoine du Hamel) [#&#8203;53050](nodejs/node#53050)
-   \[[`30ed93db12`](nodejs/node@30ed93db12)] - **module**: cache synchronous module jobs before linking (Joyee Cheung) [#&#8203;52868](nodejs/node#52868)
-   \[[`a03faf289d`](nodejs/node@a03faf289d)] - **module**: support ESM detection in the CJS loader (Joyee Cheung) [#&#8203;52047](nodejs/node#52047)
-   \[[`b07ad39bda`](nodejs/node@b07ad39bda)] - **module**: detect ESM syntax by trying to recompile as SourceTextModule (Joyee Cheung) [#&#8203;52413](nodejs/node#52413)
-   \[[`132a5c190f`](nodejs/node@132a5c190f)] - **module**: eliminate performance cost of detection for cjs entry (Geoffrey Booth) [#&#8203;52093](nodejs/node#52093)
-   \[[`55a57a189f`](nodejs/node@55a57a189f)] - **node-api**: remove deprecated attribute from napi_module_register (Vladimir Morozov) [#&#8203;56162](nodejs/node#56162)
-   \[[`4fba01911d`](nodejs/node@4fba01911d)] - **(SEMVER-MINOR)** **process**: add process.features.require_module (Joyee Cheung) [#&#8203;55241](nodejs/node#55241)
-   \[[`c0fad18ac0`](nodejs/node@c0fad18ac0)] - **src**: add nullptr handling from X509\_STORE_new() (Burkov Egor) [#&#8203;56700](nodejs/node#56700)
-   \[[`5b88d48cbb`](nodejs/node@5b88d48cbb)] - **src**: add default value for RSACipherConfig mode field (Burkov Egor) [#&#8203;56701](nodejs/node#56701)
-   \[[`e3b69e57a6`](nodejs/node@e3b69e57a6)] - **src**: fix build with GCC 15 (tjuhaszrh) [#&#8203;56740](nodejs/node#56740)
-   \[[`a7c1d8c0e8`](nodejs/node@a7c1d8c0e8)] - **src**: initialize FSReqWrapSync in path that uses it (Michaël Zasso) [#&#8203;56613](nodejs/node#56613)
-   \[[`c06ac66356`](nodejs/node@c06ac66356)] - **src**: fix undefined script name in error source (Chengzhong Wu) [#&#8203;56502](nodejs/node#56502)
-   \[[`500f3ccc66`](nodejs/node@500f3ccc66)] - **src**: lock the thread properly in snapshot builder (Joyee Cheung) [#&#8203;56327](nodejs/node#56327)
-   \[[`cf25a5edeb`](nodejs/node@cf25a5edeb)] - **src**: drain platform tasks before creating startup snapshot (Chengzhong Wu) [#&#8203;56403](nodejs/node#56403)
-   \[[`8af1b53bb8`](nodejs/node@8af1b53bb8)] - **src**: safely remove the last line from dotenv (Shima Ryuhei) [#&#8203;55982](nodejs/node#55982)
-   \[[`bb57e909aa`](nodejs/node@bb57e909aa)] - **src**: remove `base64` from `process.versions` (Richard Lau) [#&#8203;53442](nodejs/node#53442)
-   \[[`b8c89a693e`](nodejs/node@b8c89a693e)] - **src**: add `--env-file-if-exists` flag (Bosco Domingo) [#&#8203;53060](nodejs/node#53060)
-   \[[`9097de073a`](nodejs/node@9097de073a)] - **src**: don't match after `--` in `Dotenv::GetPathFromArgs` (Aviv Keller) [#&#8203;54237](nodejs/node#54237)
-   \[[`ececd225b6`](nodejs/node@ececd225b6)] - **src**: implement IsInsideNodeModules() in C++ (Joyee Cheung) [#&#8203;55286](nodejs/node#55286)
-   \[[`18593b7d3e`](nodejs/node@18593b7d3e)] - **src**: refactor embedded entrypoint loading (Joyee Cheung) [#&#8203;53573](nodejs/node#53573)
-   \[[`d7aefc0524`](nodejs/node@d7aefc0524)] - **stream**: fix typo in ReadableStreamBYOBReader.readIntoRequests (Mattias Buelens) [#&#8203;56560](nodejs/node#56560)
-   \[[`fe5f7bcd47`](nodejs/node@fe5f7bcd47)] - **stream**: validate undefined sizeAlgorithm in WritableStream (Jason Zhang) [#&#8203;56067](nodejs/node#56067)
-   \[[`12744c1fd4`](nodejs/node@12744c1fd4)] - **test**: reduce number of written chunks (Luigi Pinca) [#&#8203;56757](nodejs/node#56757)
-   \[[`e121d7d62c`](nodejs/node@e121d7d62c)] - **test**: fix invalid common.mustSucceed() usage (Luigi Pinca) [#&#8203;56756](nodejs/node#56756)
-   \[[`11b82de7ed`](nodejs/node@11b82de7ed)] - **test**: use strict mode in global setters test (Rich Trott) [#&#8203;56742](nodejs/node#56742)
-   \[[`f9d6e35c5e`](nodejs/node@f9d6e35c5e)] - **test**: cleanup and simplify test-crypto-aes-wrap (James M Snell) [#&#8203;56748](nodejs/node#56748)
-   \[[`792ce98699`](nodejs/node@792ce98699)] - **test**: do not use common.isMainThread (Luigi Pinca) [#&#8203;56768](nodejs/node#56768)
-   \[[`4f0cf475e0`](nodejs/node@4f0cf475e0)] - **test**: add test that uses multibyte for path and resolves modules (yamachu) [#&#8203;56696](nodejs/node#56696)
-   \[[`3bc8d273c2`](nodejs/node@3bc8d273c2)] - **test**: add missing test for env file (Jonas) [#&#8203;56642](nodejs/node#56642)
-   \[[`ad39367712`](nodejs/node@ad39367712)] - **test**: enforce strict mode in test-zlib-const (Rich Trott) [#&#8203;56689](nodejs/node#56689)
-   \[[`ca79914137`](nodejs/node@ca79914137)] - **test**: test-stream-compose.js doesn't need internals (Meghan Denny) [#&#8203;56619](nodejs/node#56619)
-   \[[`08bde67101`](nodejs/node@08bde67101)] - **test**: add maxCount and gcOptions to gcUntil() (Joyee Cheung) [#&#8203;56522](nodejs/node#56522)
-   \[[`40a0f6f6e3`](nodejs/node@40a0f6f6e3)] - **test**: mark test-worker-prof as flaky on smartos (Joyee Cheung) [#&#8203;56583](nodejs/node#56583)
-   \[[`d17bf2f62a`](nodejs/node@d17bf2f62a)] - **test**: update test-child-process-bad-stdio to use node:test (Colin Ihrig) [#&#8203;56562](nodejs/node#56562)
-   \[[`5660b99b43`](nodejs/node@5660b99b43)] - **test**: disable openssl 3.4.0 incompatible tests (Jelle van der Waa) [#&#8203;56160](nodejs/node#56160)
-   \[[`861c99f351`](nodejs/node@861c99f351)] - **test**: make test-crypto-hash compatible with OpenSSL > 3.4.0 (Jelle van der Waa) [#&#8203;56160](nodejs/node#56160)
-   \[[`597a39b5f9`](nodejs/node@597a39b5f9)] - **test**: update error code in tls-psk-circuit for for OpenSSL 3.4 (sebastianas) [#&#8203;56420](nodejs/node#56420)
-   \[[`721e9e1217`](nodejs/node@721e9e1217)] - **test**: add initial test426 coverage (Chengzhong Wu) [#&#8203;56436](nodejs/node#56436)
-   \[[`cfe5380c44`](nodejs/node@cfe5380c44)] - **test**: update test-set-http-max-http-headers to use node:test (Colin Ihrig) [#&#8203;56439](nodejs/node#56439)
-   \[[`51ff71a87a`](nodejs/node@51ff71a87a)] - **test**: update test-child-process-windows-hide to use node:test (Colin Ihrig) [#&#8203;56437](nodejs/node#56437)
-   \[[`d6aca0cd89`](nodejs/node@d6aca0cd89)] - **test**: increase spin for eventloop test on s390 (Michael Dawson) [#&#8203;56228](nodejs/node#56228)
-   \[[`82461af6ec`](nodejs/node@82461af6ec)] - **test**: migrate message eval tests from Python to JS (Yiyun Lei) [#&#8203;50482](nodejs/node#50482)
-   \[[`5083bbb2bb`](nodejs/node@5083bbb2bb)] - **test**: remove async-hooks/test-writewrap flaky designation (Luigi Pinca) [#&#8203;56048](nodejs/node#56048)
-   \[[`b4b26e973d`](nodejs/node@b4b26e973d)] - **test**: deflake test-esm-loader-hooks-inspect-brk (Luigi Pinca) [#&#8203;56050](nodejs/node#56050)
-   \[[`182be26b8a`](nodejs/node@182be26b8a)] - **test**: update WPT for url to [`67880a4`](nodejs/node@67880a4) (Node.js GitHub Bot) [#&#8203;55999](nodejs/node#55999)
-   \[[`e67a84902f`](nodejs/node@e67a84902f)] - **test_runner**: remove unused errors (Pietro Marchini) [#&#8203;56607](nodejs/node#56607)
-   \[[`4274c6a015`](nodejs/node@4274c6a015)] - **test_runner**: run single test file benchmark (Pietro Marchini) [#&#8203;56479](nodejs/node#56479)
-   \[[`e57004458b`](nodejs/node@e57004458b)] - **tools**: update doc to new version (Node.js GitHub Bot) [#&#8203;56259](nodejs/node#56259)
-   \[[`e039f2b571`](nodejs/node@e039f2b571)] - **tools**: do not throw on missing `create-release-proposal.sh` (Antoine du Hamel) [#&#8203;56704](nodejs/node#56704)
-   \[[`9a1e314498`](nodejs/node@9a1e314498)] - **tools**: fix tools-deps-update (Daniel Lemire) [#&#8203;56684](nodejs/node#56684)
-   \[[`d6469b5287`](nodejs/node@d6469b5287)] - **tools**: do not throw on missing `create-release-proposal.sh` (Antoine du Hamel) [#&#8203;56695](nodejs/node#56695)
-   \[[`e162476fdc`](nodejs/node@e162476fdc)] - **tools**: fix permissions in `lint-release-proposal` workflow (Antoine du Hamel) [#&#8203;56614](nodejs/node#56614)
-   \[[`914b4675c8`](nodejs/node@914b4675c8)] - **tools**: edit `create-release-proposal` workflow (Antoine du Hamel) [#&#8203;56540](nodejs/node#56540)
-   \[[`4ff9aa7235`](nodejs/node@4ff9aa7235)] - **tools**: validate commit list as part of `lint-release-commit` (Antoine du Hamel) [#&#8203;56291](nodejs/node#56291)
-   \[[`589d0ae8ea`](nodejs/node@589d0ae8ea)] - **tools**: fix loong64 build failed (Xiao-Tao) [#&#8203;56466](nodejs/node#56466)
-   \[[`bc8c39bff8`](nodejs/node@bc8c39bff8)] - **tools**: disable unneeded rule ignoring in Python linting (Rich Trott) [#&#8203;56429](nodejs/node#56429)
-   \[[`3b130002bb`](nodejs/node@3b130002bb)] - **tools**: add release line label when opening release proposal (Antoine du Hamel) [#&#8203;56317](nodejs/node#56317)
-   \[[`73b5c16684`](nodejs/node@73b5c16684)] - **(SEMVER-MINOR)** **worker**: add postMessageToThread (Paolo Insogna) [#&#8203;53682](nodejs/node#53682)

</details>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOTEuNCIsInVwZGF0ZWRJblZlciI6IjM5LjIwNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.walbeck.it/mwalbeck/docker-cyberchef/pulls/375
Co-authored-by: renovate-bot <[email protected]>
Co-committed-by: renovate-bot <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Apr 1, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: #57349
RafaelGSS pushed a commit that referenced this pull request Apr 1, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: #57349
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: #57349
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
Notable changes:

crypto:
  * update root certificates to NSS 3.107 (Node.js GitHub Bot) #56566
module:
  * (SEMVER-MINOR) only emit require(esm) warning under --trace-require-module (Joyee Cheung) #56194
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
  * (SEMVER-MINOR) implement the "module-sync" exports condition (Joyee Cheung) #54648
  * (SEMVER-MINOR) unflag detect-module (Geoffrey Booth) #53619
  * (SEMVER-MINOR) add __esModule to require()'d ESM (Joyee Cheung) #52166
process:
  * (SEMVER-MINOR) add process.features.require_module (Joyee Cheung) #55241
worker:
  * (SEMVER-MINOR) add postMessageToThread (Paolo Insogna) #53682

PR-URL: #57349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-open-v20.x Indicate that the PR has an open backport esm Issues and PRs related to the ECMAScript Modules implementation. module Issues and PRs related to the module subsystem. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

module: increased surface for hazards with require(esm) experimental flag
10 participants