Shelley Vohr
d345662d50
crypto: include openssl/rand.h explicitly
...
PR-URL: https://github.com/nodejs/node/pull/55425
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:42:44 -05:00
Yagiz Nizipli
bde374ee6a
src: remove icu based ToASCII and ToUnicode
...
PR-URL: https://github.com/nodejs/node/pull/55156
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com >
Reviewed-By: Daniel Lemire <daniel@lemire.me >
Reviewed-By: Richard Lau <rlau@redhat.com >
2024-11-27 01:42:44 -05:00
Rafael Gonzaga
cac58564a1
benchmark: add --runs support to run.js
...
PR-URL: https://github.com/nodejs/node/pull/55158
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
2024-11-27 01:42:43 -05:00
jazelly and Antoine du Hamel
5357338b8e
fs: use wstring on Windows paths
...
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/55171
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2024-11-27 01:42:43 -05:00
Aviv Keller
0e873c3031
test: update console wpt
...
PR-URL: https://github.com/nodejs/node/pull/55192
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
2024-11-27 01:42:43 -05:00
RafaelGSS
07c2fb2045
doc: move Danielle Adams key to old gpg keys
...
Refs: https://github.com/nodejs/Release/issues/1041
PR-URL: https://github.com/nodejs/node/pull/55399
Refs: https://github.com/nodejs/Release/issues/1036
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com >
Reviewed-By: Ruy Adorno <ruy@vlt.sh >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:42:43 -05:00
RafaelGSS
41b045170d
doc: move Bryan English key to old gpg keys
...
Refs: https://github.com/nodejs/Release/issues/1040
PR-URL: https://github.com/nodejs/node/pull/55399
Refs: https://github.com/nodejs/Release/issues/1036
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com >
Reviewed-By: Ruy Adorno <ruy@vlt.sh >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:42:43 -05:00
RafaelGSS
13724dcc20
doc: move Beth Griggs keys to old gpg keys
...
Refs: https://github.com/nodejs/Release/issues/1042
PR-URL: https://github.com/nodejs/node/pull/55399
Refs: https://github.com/nodejs/Release/issues/1036
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com >
Reviewed-By: Ruy Adorno <ruy@vlt.sh >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:42:43 -05:00
Filip Skokan
07fc40d823
meta: assign CODEOWNERS for /deps/ncrypto/*
...
PR-URL: https://github.com/nodejs/node/pull/55426
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2024-11-27 01:37:58 -05:00
Rafael Gonzaga
139e8f1579
meta: change color to blue notify review-wanted
...
The current colour seems something went wrong when in fact
it's just someone asking for a review.
PR-URL: https://github.com/nodejs/node/pull/55423
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
2024-11-27 01:37:54 -05:00
theanarkh
4f89059f63
lib: add flag to drop connection when running in cluster mode
...
PR-URL: https://github.com/nodejs/node/pull/54927
Refs: https://github.com/nodejs/node/issues/54882
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-11-27 01:37:54 -05:00
Luigi Pinca
832300533b
test: remove duplicate tests
...
`test/parallel/test-dns-default-verbatim-false.js` is a duplicate of
`test/parallel/test-dns-default-order-ipv4.js` and
`test/parallel/test-dns-default-verbatim-true.js` is a duplicate of
`test/parallel/test-dns-default-order-verbatim.js`.
PR-URL: https://github.com/nodejs/node/pull/55393
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com >
2024-11-27 01:37:53 -05:00
Luigi Pinca
ef6707eb9b
dns: honor the order option
...
Fixes: https://github.com/nodejs/node/issues/55391
PR-URL: https://github.com/nodejs/node/pull/55392
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Feng Yu <F3n67u@outlook.com >
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com >
2024-11-27 01:37:53 -05:00
Mohammed Keyvanzadeh
8daa8a62f8
build: fix path concatenation
...
- The `Path` class does not support concatenation with the `+`
operator, so use the `/` operator instead.
- When concatenating paths, if the operand is an absolute path the
previous path is ignored, so change `/include` to `include`.
PR-URL: https://github.com/nodejs/node/pull/55387
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:37:52 -05:00
Jan Martin
0230fb1ead
doc: spell out condition restrictions
...
PR-URL: https://github.com/nodejs/node/pull/55187
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-11-27 01:37:52 -05:00
Erick Wendel
f41d329e98
test_runner: add support for scheduler.wait on mock timers
...
This adds support for nodetimers.promises.scheduler.wait on Mocktimers
Refs: https://github.com/nodejs/node/pull/55244
PR-URL: https://github.com/nodejs/node/pull/55244
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2024-11-27 01:37:51 -05:00
Wei Zhu
aed758d270
esm: fix inconsistency with importAssertion in resolve hook
...
As the documentation states, the `context.importAssertion` should be
still supported and emit a warning. This is true for the `load` hook,
but not correct for context of the `resolve` hook.
This commit fixes the inconsistency.
PR-URL: https://github.com/nodejs/node/pull/55365
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-11-27 01:37:51 -05:00
Node.js GitHub Bot
a3b793defd
deps: update simdutf to 5.6.0
...
PR-URL: https://github.com/nodejs/node/pull/55379
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2024-11-27 01:23:23 -05:00
James M Snell
6023e1bdb2
buffer: make Buffer work with resizable ArrayBuffer
...
Fixes: https://github.com/nodejs/node/issues/52195
PR-URL: https://github.com/nodejs/node/pull/55377
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-11-27 01:23:23 -05:00
Nathan Baulch
a6c444291b
tools: fix typos
...
PR-URL: https://github.com/nodejs/node/pull/55061
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:23:23 -05:00
BadKey
29f7325e73
lib: test_runner#mock:timers respeced timeout_max behaviour
...
PR-URL: https://github.com/nodejs/node/pull/55375
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Claudio Wunder <cwunder@gnome.org >
2024-11-27 01:23:22 -05:00
Fedor Indutny
c3c403040a
sqlite: cache column names in stmt.all()
...
While the statement is running, it is impossible to modify the column
names and thus it is beneficial to create the host-language (JS) keys
once per all rows and reuse them for all results.
With this change the performance of `.all()` improves by around 25%
depending on the number of columns and rows in the result.
PR-URL: https://github.com/nodejs/node/pull/55373
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2024-11-27 01:23:22 -05:00
Hüseyin Açacak
66e41f044d
doc: add instructions for WinGet build
...
PR-URL: https://github.com/nodejs/node/pull/55356
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com >
2024-11-27 01:23:21 -05:00
Hüseyin Açacak
6ad23e74be
src: fix winapi_strerror error string
...
Fixes: https://github.com/nodejs/node/issues/23191
PR-URL: https://github.com/nodejs/node/pull/55207
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:23:21 -05:00
Node.js GitHub Bot
551b8f897d
deps: update c-ares to v1.34.1
...
PR-URL: https://github.com/nodejs/node/pull/55369
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
2024-11-27 01:23:20 -05:00
Edigleysson Silva (Edy)
68bcec64b8
lib: remove settled dependant signals when they are GCed
...
PR-URL: https://github.com/nodejs/node/pull/55354
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-11-27 01:23:19 -05:00
Aviv Keller
b9200c33ae
test_runner: require --enable-source-maps for sourcemap coverage
...
PR-URL: https://github.com/nodejs/node/pull/55359
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2024-11-27 01:23:19 -05:00
Rafael Gonzaga
5c3ee886fc
benchmark: adjust byte size for buffer-copy
...
PR-URL: https://github.com/nodejs/node/pull/55295
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:23:18 -05:00
simon-id
0ee6715921
diagnostics_channel: fix unsubscribe during publish
...
PR-URL: https://github.com/nodejs/node/pull/55116
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Claudio Wunder <cwunder@gnome.org >
2024-11-27 01:23:18 -05:00
Robert Nagy
4f84cdc8a2
events: optimize EventTarget.addEventListener
...
PR-URL: https://github.com/nodejs/node/pull/55312
Fixes: https://github.com/nodejs/node/issues/55311
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2024-11-27 01:23:18 -05:00
Santiago Gimeno
63bc40550b
src: remove uv__node_patch_is_using_io_uring
...
As now the `SQPOLL` ring used in the libuv io_uring implementation is
disabled by default.
Also modify `UvMightBeUsingIoUring()` to just handle the case where
`Node.js` is dynamically linked to a `libuv` version which has the
`SQPOLL` ring enabled.
PR-URL: https://github.com/nodejs/node/pull/55114
Refs: https://github.com/libuv/libuv/releases/tag/v1.49.0
Refs: https://github.com/libuv/libuv/releases/tag/v1.49.1
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:23:17 -05:00
Santiago Gimeno
26861eaf4e
Revert "deps: disable io_uring support in libuv by default"
...
This reverts commit 42e659cb9d .
PR-URL: https://github.com/nodejs/node/pull/55114
Refs: https://github.com/libuv/libuv/releases/tag/v1.49.0
Refs: https://github.com/libuv/libuv/releases/tag/v1.49.1
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:23:17 -05:00
Santiago Gimeno
41c50bc15e
deps: update libuv to 1.49.1
...
Refs: https://github.com/libuv/libuv/releases/tag/v1.49.1
PR-URL: https://github.com/nodejs/node/pull/55114
Refs: https://github.com/libuv/libuv/releases/tag/v1.49.0
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:23:16 -05:00
minkyu_kim
310a734c1b
test: update test_util.cc for coverage
...
update test_util.cc for code coverage src/util-inl.h:PopFront()
PR-URL: https://github.com/nodejs/node/pull/55291
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:23:15 -05:00
minkyu_kim
12faf0466e
build: fix make errors that occur in Makefile
...
fix make errors that occur in
coverage-clean case and coverage-test in Makefile
PR-URL: https://github.com/nodejs/node/pull/55287
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:23:15 -05:00
Karl Horky
23d89da3f1
doc: add missing return values in buffer docs
...
PR-URL: https://github.com/nodejs/node/pull/55273
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2024-11-27 01:23:15 -05:00
Rafael Gonzaga
6e7b33a0ef
doc: fix ambasador markdown list
...
PR-URL: https://github.com/nodejs/node/pull/55361
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2024-11-27 01:23:14 -05:00
Node.js GitHub Bot
26fcc04084
deps: update amaro to 0.1.9
...
PR-URL: https://github.com/nodejs/node/pull/55348
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com >
2024-11-27 01:23:07 -05:00
Aviv Keller
254badd480
test: update compression wpt
...
PR-URL: https://github.com/nodejs/node/pull/55191
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:23:07 -05:00
dependabot[bot]
c0614dc92c
meta: bump codecov/codecov-action from 4.5.0 to 4.6.0
...
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action ) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/codecov/codecov-action/releases )
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md )
- [Commits](https://github.com/codecov/codecov-action/compare/e28ff129e5465c2c0dcc6f003fc735cb6ae0c673...b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 )
---
updated-dependencies:
- dependency-name: codecov/codecov-action
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
PR-URL: https://github.com/nodejs/node/pull/55222
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:23:06 -05:00
dependabot[bot]
47b6c6748b
meta: bump github/codeql-action from 3.26.6 to 3.26.10
...
Bumps [github/codeql-action](https://github.com/github/codeql-action ) from 3.26.6 to 3.26.10.
- [Release notes](https://github.com/github/codeql-action/releases )
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md )
- [Commits](https://github.com/github/codeql-action/compare/4dd16135b69a43b6c8efb853346f8437d92d3c93...e2b3eafc8d227b0241d48be5f425d47c2d750a13 )
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
PR-URL: https://github.com/nodejs/node/pull/55221
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:15:06 -05:00
dependabot[bot]
6c836aa97e
meta: bump step-security/harden-runner from 2.9.1 to 2.10.1
...
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner ) from 2.9.1 to 2.10.1.
- [Release notes](https://github.com/step-security/harden-runner/releases )
- [Commits](https://github.com/step-security/harden-runner/compare/5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde...91182cccc01eb5e619899d80e4e971d6181294a7 )
---
updated-dependencies:
- dependency-name: step-security/harden-runner
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
PR-URL: https://github.com/nodejs/node/pull/55220
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:15:06 -05:00
Mert Can Altin
a5590083cd
node-api: add napi_create_buffer_from_arraybuffer method
...
PR-URL: https://github.com/nodejs/node/pull/54505
Fixes: https://github.com/nodejs/node/issues/54440
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Gabriel Schulhof <gabrielschulhof@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com >
2024-11-27 01:15:02 -05:00
Antoine du Hamel
d8c552a060
doc: edit onboarding guide to clarify when mailmap addition is needed
...
PR-URL: https://github.com/nodejs/node/pull/55334
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-11-27 01:15:02 -05:00
Jimmy Leung
c7f82ec978
doc: fix the return type of outgoingMessage.setHeaders()
...
The actual implementation returns `outgoingMessage` itself, but not
exactly `http.ServerResponse`.
Refs: https://github.com/nodejs/node/blob/20d8b85d3493bec944de541a896e0165dd356345/lib/_http_outgoing.js#L712-L751
PR-URL: https://github.com/nodejs/node/pull/55290
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Qingyu Deng <i@ayase-lab.com >
2024-11-27 01:15:01 -05:00
Stefan Stojanovic
a21be0294d
build,win: enable pch for clang-cl
...
Fixes: https://github.com/nodejs/node/issues/55208
PR-URL: https://github.com/nodejs/node/pull/55249
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2024-11-27 01:15:01 -05:00
Antoine du Hamel
d5e915ba5d
tools: add polyfilled option to prefer-primordials rule
...
PR-URL: https://github.com/nodejs/node/pull/55318
Backport-PR-URL: https://github.com/nodejs/node/pull/55421
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2024-11-27 00:48:28 -05:00
Joyee Cheung
cb527a925d
module: do not warn when require(esm) comes from node_modules
...
As part of the standard experimental feature graduation
policy, when we unflagged require(esm) we moved the
experimental warning to be emitted when require() is
actually used to load ESM, which previously was an error.
However, some packages in the ecosystem have already
being using try-catch to load require(esm) to e.g.
resolve optional dependency, and emitting warning from
there instead of throwing directly could break the CLI
output.
To reduce the disruption for releases, as a compromise, this
patch skips the warning if require(esm) comes from
node_modules, where users typically don't have much control
over the code. This warning will be eventually removed
when require(esm) becomes stable.
This patch was originally intended for the LTS releases,
though it seems there's appetite for it on v23.x as
well so it's re-targeted to the main branch.
PR-URL: https://github.com/nodejs/node/pull/55960
Backport-PR-URL: https://github.com/nodejs/node/pull/55217
Refs: https://github.com/nodejs/node/pull/55217
Refs: https://github.com/nodejs/node/issues/52697
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
2024-11-27 00:45:39 -05:00
Joyee Cheung
16119f206f
module: trim off internal stack frames for require(esm) warnings
...
Trim off irrelevant internal stack frames for require(esm) warnings
so it's easier to locate where the call comes from when
--trace-warnings is used.
PR-URL: https://github.com/nodejs/node/pull/55496
Backport-PR-URL: https://github.com/nodejs/node/pull/55217
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Refs: https://github.com/nodejs/node/issues/52697
2024-11-27 00:45:34 -05:00
Joyee Cheung
28b5b9a57d
module: allow ESM that failed to be required to be re-imported
...
When a ESM module cannot be loaded by require due to the presence
of TLA, its module status would be stopped at kInstantiated. In
this case, when it's imported again, we should allow it to be
evaluated asynchronously, as it's also a common pattern for users
to retry with dynamic import when require fails.
PR-URL: https://github.com/nodejs/node/pull/55502
Backport-PR-URL: https://github.com/nodejs/node/pull/55217
Fixes: https://github.com/nodejs/node/issues/55500
Refs: https://github.com/nodejs/node/issues/52697
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-11-27 00:45:27 -05:00