Commit Graph
47209 Commits
Author SHA1 Message Date
Yagiz Nizipli db094ded54 src: avoid copying source string in TextEncoder.encode
`EncodeUtf8String`, which backs `TextEncoder.prototype.encode()`, copied
the entire source string out of the V8 heap into a `MaybeStackBuffer`
(via `WriteOneByteV2`/`WriteV2`) before encoding, allocating on the heap
for strings larger than the stack buffer. `EncodeInto` already avoids
this by reading the flat content directly through
`v8::String::ValueView`.

Read the flat content via `ValueView` instead. Because `ValueView` holds
a `DisallowGarbageCollection` scope, the backing store cannot be
allocated while it is alive, so the view is used in two short scopes:
one to validate and compute the exact UTF-8 length, and one to encode
directly into the backing store after allocation. Flattening is cached
on the string, so re-acquiring the view is cheap. The rare unpaired
surrogate path still copies into a mutable buffer for in-place
`to_well_formed_utf16`.

benchmark/util/text-encoder.js (op=encode, n=1e6, 12 runs each):

                       len=256  len=1024  len=8192
  ascii                 +14.1%    +23.5%    +43.9%
  one-byte (latin1)     +14.4%    +22.2%    +12.3%
  two-byte (utf-16)     +16.7%    +20.4%    +15.5%

len=32 uses the unchanged small-string path (~noise). The untouched
encodeInto path stayed flat (-2.0%..+0.5%) across all configurations.

Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: https://github.com/nodejs/node/pull/63897
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-22 17:18:16 +00:00
sangwook 546b5967f9 test_runner: add timestamp to JUnit reporter testsuites
Emit the standard JUnit timestamp (ISO 8601) on <testsuite> elements,
which the reporter was omitting. The suite start time is reconstructed
as end-minus-duration, because the runner reports a suite's test:start
lazily (when its first subtest reports), which would otherwise record a
time close to the suite's end.

Fixes: https://github.com/nodejs/node/issues/64028
Signed-off-by: sangwook <rewq5991@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64029
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Jacob Smith <jacob@frende.me>
2026-06-22 15:42:03 +00:00
Jahanzaib iqbal 4d3198c664 doc: fix keepAliveTimeout default in http.createServer options
PR #62782 updated the keepAliveTimeout default from 5s to 65s and
correctly updated server.keepAliveTimeout (line 2006), but the
http.createServer() options table at line 3775 was not updated.

Fix the remaining reference to reflect the current default of 65000ms.

Signed-off-by: Jahanzaib iqbal <jahanzaib@gsoftconsulting.com>
PR-URL: https://github.com/nodejs/node/pull/63974
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-06-22 09:48:46 +00:00
Trivikram Kamat a0263feb16 stream: observe abort while awaiting pipeTo source
Use the abort-aware iterator wrapper in the no-transform pipeTo()
path so a pending source read does not block AbortSignal handling.

Fixes: https://github.com/nodejs/node/issues/64014

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: https://github.com/nodejs/node/pull/64015
Fixes: https://github.com/nodejs/node/issues/64014
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-22 07:47:40 +00:00
Trivikram Kamat 0dbb5df1fe stream: respect iter consumer abort signals
Delegate broadcast.push() and share.pull() calls with per-consumer
AbortSignals through pull(), so pending next() calls reject when the
signal aborts.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: https://github.com/nodejs/node/pull/63997
Fixes: https://github.com/nodejs/node/issues/63302
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-22 07:47:25 +00:00
Anthony GreenandClaude Opus 4.8 e9a9065c74 deps: libffi: cherry-pick 9ca53a19833d
Original commit message:

    powerpc: fix aix/darwin closure build errors

    unbuildable: the PPC_LD_* jump-table indexes (defined in ffi_powerpc.h,
    which this file cannot include) were missing, and the closure helper
    functions still declared an ffi_type* return type inconsistent with the
    PPC_LD_* constants they now return.

    Define the PPC_LD_* constants locally and change the closure helper
    return types to int.

    Fixes #987

    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Refs: https://github.com/libffi/libffi/commit/9ca53a19833dabaf80b73763638ab988bdbc42cc
PR-URL: https://github.com/nodejs/node/pull/64040
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-06-22 08:56:05 +02:00
Node.js GitHub Bot d9707af728 deps: update libffi to 3.6.0
PR-URL: https://github.com/nodejs/node/pull/64040
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-06-22 08:55:29 +02:00
Trivikram Kamat 1f806f2214 debugger: lazily wait for initial break output
Wait for the initial pause render before completing debugger REPL
startup, but only when the initial pause is actually observed during
startup initialization.

Creating the wait promise before Runtime.runIfWaitingForDebugger() can
hang when the debug target exits or disconnects without producing an
initial pause event. It also assumes the inspector object always has
parsed CLI options, which is not true for tests that use a minimal mock
inspector.

Create the initial-render wait lazily from the Debugger.paused handler
while startup initialization is active. This preserves prompt ordering
for normal initial breaks without blocking startup when no initial pause
render occurs.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: https://github.com/nodejs/node/pull/63969
Refs: https://github.com/nodejs/node/actions/runs/27582782593/job/81546582775
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-06-22 05:55:33 +00:00
Marco ac6ee057fb watch: print name of changed file that triggers restart
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63781
Fixes: https://github.com/nodejs/node/issues/63767
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-06-22 05:55:19 +00:00
Louie Llaneta 519294e4c8 doc: update gcc toolchains to gcc-13 and g++-13
since the prerequisites are `gcc` and `g++` >= `13.2`

Signed-off-by: louiellan <louie.lou.llaneta@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64018
Refs: https://github.com/nodejs/node/pull/62555
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-06-22 02:35:53 +00:00
Matteo Collina ca406b2b9a stream: fix Writable.toWeb() desiredSize for non-object-mode
Writable.toWeb() used a plain { highWaterMark } as the queuing
strategy for non-object-mode streams, which meant no size function
was provided. The WritableStream defaulted to counting each chunk
as size 1, so desiredSize was incorrect (e.g., a 3-byte Uint8Array
was counted as size 1 instead of 3).

Add a size() function to the strategy that mirrors how the Node.js
stream computes chunk length: byteLength for typed arrays, length
for strings/buffers, falling back to 1.

Fixes: https://github.com/nodejs/node/issues/56269
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/62986
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-06-21 21:56:57 +00:00
Matteo Collina 2c4356cedf domain: port to AsyncLocalStorage
Port the domain module from createHook (async_hooks) to
AsyncLocalStorage using the AsyncContextFrame-based implementation.

Key changes:
- Use AsyncLocalStorage for domain context propagation instead of
  async_hooks.createHook()
- Lazy initialization that triggers AsyncContextFrame prototype swap
  on first domain use
- Use enterWith instead of ALS.run() so domain context is NOT
  automatically restored on exception - this matches the original
  domain.run() behavior where exit() only runs on success
- Add ERR_ASYNC_RESOURCE_DOMAIN_REMOVED error for AsyncResource.domain
- Update DEP0097 to End-of-Life status
- Remove tests that relied on the removed MakeCallback domain property

The domain module now uses the AsyncContextFrame version of
AsyncLocalStorage directly for proper context propagation across
async boundaries.

Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/61095
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2026-06-21 19:42:03 +00:00
dependabot[bot] 2e190332d0 tools: bump piscina from 5.1.4 to 5.2.0 in /tools/doc
Bumps [piscina](https://github.com/piscinajs/piscina) from 5.1.4 to 5.2.0.
- [Release notes](https://github.com/piscinajs/piscina/releases)
- [Changelog](https://github.com/piscinajs/piscina/blob/v5.2.0/CHANGELOG.md)
- [Commits](https://github.com/piscinajs/piscina/compare/v5.1.4...v5.2.0)

---
updated-dependencies:
- dependency-name: piscina
  dependency-version: 5.2.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/64002
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-06-21 13:01:15 +00:00
Filip Skokan b116861e88 crypto: move DEP0198 to End-of-Life
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64000
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-06-21 11:18:48 +00:00
Trivikram Kamat b734ff562f test: tolerate duplicate watch change events
Allow test-watch-file-shared-dependency to observe multiple watcher
events while still asserting that the expected owner set is reached
exactly once.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: https://github.com/nodejs/node/pull/63937
Refs: https://github.com/nodejs/node/actions/runs/27462359210/job/81178399610
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2026-06-21 08:47:04 +00:00
Kirill Saied 665daeb54c fs: do not treat EPERM as ENOTEMPTY on Windows
Fixes: https://github.com/nodejs/node/issues/56433

Signed-off-by: PickBas <sayed.kirill@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63709
Fixes: https://github.com/nodejs/node/issues/56433
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
2026-06-21 01:31:38 +00:00
Guy Bedford e3cdb14678 net: early TCP binding via synchronous net.BoundSocket
Signed-off-by: Guy Bedford <guybedford@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63951
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-06-20 14:40:48 -07:00
Tim Perry c27921ba06 quic: fix get_reader bug that dropped data on FIN
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63946
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2026-06-20 20:11:58 +00:00
Tim Perry 6d5a085079 quic: expose QUIC certificates as JS X509Certificate, not raw handles
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63191
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2026-06-20 20:11:47 +00:00
Michaël Zasso 1ee0efe199 tools: update sccache to v0.16.0
Signed-Off-By: Michaël Zasso <targos@protonmail.com>
PR-URL: https://github.com/nodejs/node/pull/63078
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-20 19:41:43 +00:00
Yagiz Nizipli 7bdd50bc0f src: omit unconvertible names in cjs_lexer::Parse
Follow-up to aa25a0a30c. When an export or re-export name cannot be
converted to a V8 string (e.g. on string allocation failure), omit that
individual name and continue instead of bailing out of the whole
preparse. A single pathological name no longer fails the module's
exports preparse; the remaining names are still returned.

Refs: https://github.com/nodejs/node/pull/63885
Refs: https://github.com/nodejs/node/issues/63323
Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: https://github.com/nodejs/node/pull/63943
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-20 19:01:51 +00:00
Filip Skokan 8c8c43882f lib: fix missing lazyDOMException import
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64033
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-06-20 20:11:08 +02:00
Filip Skokan 8ec37ebbd6 crypto: support non-byte WebCrypto lengths and cSHAKE
Add shared bit-length helpers for WebCrypto operations that accept bit
sequences whose length is not byte-aligned.

Use the helpers for cSHAKE output, ECDH-derived bits, HMAC/KMAC key
generation/import/derivation, and KMAC sign/verify output. Preserve the
requested bit length in CryptoKey algorithm metadata while storing and
exporting rounded-up byte material with unused low bits cleared.

Keep byte-multiple validation for algorithms whose specs require it.

Extend the lower-end of KMAC's key length support.

Enable cSHAKE customization and functionName parameters.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63988
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-06-20 18:42:04 +02:00
Anna Henningsen 68321eff80 src: keep global list of addon-provided cleanup hooks
A recent change, 215027c8ed, introduced flakiness into our
test suite that exposed an issue with the cleanup hook API design.

Specifically, the signatures of `AddEnvironmentCleanupHook()` and
`RemoveEnvironmentCleanupHook()` are problematic. Both functions
take `Isolate*` arguments, as addons are not generally expected
to have to care about the Node.js `Environment` as a first-class
scope provider.

However, this model made the incorrect assumption that in the
situations in which `RemoveEnvironmentCleanupHook()` would be
invoked an `Environment` would always be associated with the
current `Isolate` (via the current V8 `Context`, if there is one).

This occasionally breaks down when `RemoveEnvironmentCleanupHook()`
is called during garbage collection -- which would be an expected
use case of the functionality, but one that has not been covered
through our tests before 215027c8ed.

Since Node.js guarantees API and ABI stability within a major version,
and this is a bug that is independent from the aforementioned change,
this commit resolves it by adding global mutable state to keep track
off cleanup hooks registered through the Node.js public API.

Obviously, this solution does not represent a desirable long-term
state, and a semver-minor follow up should add an API that does not
require modifications to these data structures, likely based on
the async cleanup hook API which already solves this issue properly.

Refs: https://github.com/nodejs/node/pull/63642
Fixes: https://github.com/nodejs/node/issues/63923
Signed-off-by: Anna Henningsen <anna@addaleax.net>
PR-URL: https://github.com/nodejs/node/pull/63985
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-06-20 18:16:02 +02:00
Matteo Collina c105c73f2a test: mark test-debugger-run-after-quit-restart as flaky on macOS
Refs: https://github.com/nodejs/node/issues/64005
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64006
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-20 15:45:37 +00:00
dependabot[bot] 16a6cf8e40 tools: bump js-yaml from 4.1.1 to 4.2.0 in /tools/lint-md
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.1 to 4.2.0.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/commits)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.2.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/63948
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-06-20 15:45:28 +00:00
dependabot[bot] d09d4ca920 tools: bump js-yaml from 4.1.1 to 4.2.0 in /tools/eslint
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.1 to 4.2.0.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/commits)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.2.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
PR-URL: https://github.com/nodejs/node/pull/63947
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-06-20 15:45:20 +00:00
Yagiz Nizipli daecfc0800 child_process: pass spawn options to the binding positionally
ChildProcess.prototype.spawn() handed a single options object to the
ProcessWrap::Spawn() binding, which then read about a dozen properties
back out individually with Object::Get(). Each of those is a property
lookup across the JS/C++ boundary on every spawn.

Pass file, args, cwd, envPairs, stdio, uid and gid as positional
arguments and pack the boolean flags (detached, windowsHide,
windowsVerbatimArguments) into a single integer whose bit values are
exported from the binding as `constants`. The native side then reads
each value directly from the call arguments.

Add internal typings for the process_wrap binding (previously untyped)
describing the new positional spawn() signature and the exported
constants.

There is no observable behavior change. Spawn wall-clock time is
dominated by the operating system process-creation cost and is
unchanged; this reduces the per-spawn work done on the main thread and
clarifies the contract between the JS and C++ layers.

Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: https://github.com/nodejs/node/pull/63930
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
2026-06-20 15:45:11 +00:00
Node.js GitHub Bot 5e0969ac44 deps: update acorn to 8.17.0
PR-URL: https://github.com/nodejs/node/pull/63901
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-06-20 15:45:02 +00:00
Antoine du Hamel 393f5870ca doc: add aduh95 to last security release steward
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63981
Refs: https://github.com/nodejs-private/security-release/pull/72
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-06-20 15:05:20 +00:00
Richard Lau dcbb21e06f build: suppress compiler warnings for histogram
Synchronize compiler flags in the gyp build and unofficial gn build
of `deps/histogram`.

Signed-off-by: Richard Lau <richard.lau@ibm.com>
PR-URL: https://github.com/nodejs/node/pull/63980
Fixes: https://github.com/nodejs/node/issues/63979
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-20 15:05:11 +00:00
Matteo Collina 57a4932a9d http: avoid stream listeners on idle agent sockets
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/64004
Fixes: https://github.com/nodejs/node/issues/63989
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2026-06-20 14:58:11 +00:00
Matteo Collina fa2eaa54fb stream: reduce allocations on WHATWG streams hot paths
Pure-JavaScript optimizations to lib/internal/webstreams/* that reduce
per-chunk and per-construction allocations on hot paths without
observable behavior change.

Per-chunk: reuse promise-reaction closures per controller, add buffered
fast path for async iterator, specialize callback wrappers by arity,
and share immutable nil records for writable stream resets.

Per-construction: use queueMicrotask for non-object start results,
materialize reader/writer .closed and .ready records lazily, and remove
dead allocations.

Assisted-by: Claude Fable 5
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/63876
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2026-06-20 14:19:08 +00:00
Filip Skokan 89bf6548b7 crypto: share WebCrypto method and usage helpers
Introduce prepareSubtleMethod() and convertSubtleArgument() for the
common SubtleCrypto call prelude. Methods now reuse the same receiver
check, required-argument check, error prefix construction, argument
context selection, and WebIDL conversion path.

Introduce WebCrypto key usage helpers for common usage validation and
key pair usage splitting. Algorithm modules now define their allowed
public, private, and key generation usages once, then call the shared
helpers from generateKey() and importKey() paths.

This removes repeated function-invocation setup in webcrypto.js and
repeated key usage checks across the WebCrypto algorithm modules while
preserving the existing validation behavior.

Mark normalized-algorithm fallback branches as unreachable assertions.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63975
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-06-20 13:29:46 +00:00
Node.js GitHub Bot e3a1c12f81 tools: update nixpkgs-unstable to 49a4bd0573c376468dd7996ddb6f9fa31d8
PR-URL: https://github.com/nodejs/node/pull/63902
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-06-20 12:07:19 +00:00
Tim Perry 83002d559f quic: fix reader backpressure deadlock on idle connections
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63950
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2026-06-20 10:30:41 +00:00
Matteo Collina 07fb744b99 stream: handle setEncoding after buffered data
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/63973
Refs: https://github.com/nodejs/node/pull/63570
Refs: https://github.com/nodejs/undici/issues/5002
Reviewed-By: Jithil P Ponnan <jithil@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-06-20 09:35:34 +00:00
Aviv Keller 81e93dff3b build, doc: generate node.1 with doc-kit
Signed-off-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/62044
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-06-20 08:21:10 +00:00
Daijiro Wachi 1258a19b68 doc: fix typo in util.md
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63961
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-06-20 16:14:30 +09:00
Daijiro Wachi 9fa6e8a516 stream: fix Utf8Stream stall after full write of multi-byte data
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63964
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-06-20 16:12:16 +09:00
Filip Skokan a40bb49bfb src: guard OpenSSL compression header include
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64009
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2026-06-20 07:09:40 +00:00
Chengzhong Wu a17d2b8fe3 inspector: fix inspector.close() documented behavior
The `inspector.close()` forcefully terminates all active connections,
allowing the process to exit cleanly, without waiting for the devtool
client to disconnect.

Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/63837
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-06-20 04:04:20 +00:00
Trivikram Kamat d1eaaf60c3 stream: keep overlapping broadcast reads pending
Broadcast consumers may receive overlapping next() calls on the same
iterator. Queue those reads so chunks satisfy them in call order.

A single written chunk should resolve the earliest pending next();
later next() calls remain pending until more data is written or the
broadcast completes.

Fixes: https://github.com/nodejs/node/issues/63499

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: openai:gpt-5.5
PR-URL: https://github.com/nodejs/node/pull/63500
Fixes: https://github.com/nodejs/node/issues/63499
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-06-20 04:04:08 +00:00
Filip Skokan da516920fc crypto,https,tls: runtime-deprecate OpenSSL engine-based APIs (DEP0183)
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63966
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-06-19 18:03:51 +02:00
Tim Perry e52ec44229 tls: add certificateCompression option
This changes enables compression within OpenSSL *without* enabling
record compression, so this only affects compression of certificates
delivered within the TLS handshake. This certificate compression remains
disabled by default for now, but becomes available via the new
certificateCompression option in TLS context APIs.

Enabling this shrinks handshakes significantly, and also reduces
fingerprintability of Node.js client handshakes, as these are enabled in
all modern browsers by default.

Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62217
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-06-19 16:07:24 +02:00
Tim Perry 39964a0d65 deps: update OpenSSL build config to support compression
Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62217
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-06-19 16:07:00 +02:00
Tobias Nießen 21310cbcc5 crypto,tls: do not ignore BN_get_word error
This changes `BignumPointer::GetWord` such that it does not hide errors
from the caller. In the context of RSA keys within X.509 certificates,
we should eventually compute the public exponent correctly regardless of
its size. This patch, however, is designed to be a minimal change that
prevents callers from using erroneous return values of `BN_get_word`.

Signed-off-by: Tobias Nießen <tniessen@tnie.de>
PR-URL: https://github.com/nodejs/node/pull/63895
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-06-19 12:30:40 +00:00
Tim Perry 2315bd38df build: add QUIC CI job for PRs matching QUIC related paths
This notable includes stream/iter (since they're closely related and
rapidly evolving together) and ngtcp2, nghttp3 & openssl deps.

Based on test-linux.yml, the main differences are simplifications: PRs
only, filtered to specific paths, just one build (ARM only), no unusual
characters test.

Signed-off-by: Tim Perry <pimterry@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63875
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2026-06-19 12:30:27 +00:00
Antoine du Hamel a4f9858ada tools: update the llhttp updater script
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63819
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2026-06-19 09:27:01 +00:00
Joyee Cheung 61e70cc2be test,debugger: add test for type stripping in debugger probe mode
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63748
Refs: https://github.com/nodejs/node/issues/63646
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
2026-06-19 09:26:48 +00:00