Skip to content

Releases: nodejs/node

2024-10-29, Version 22.11.0 'Jod' (LTS), @richardlau

29 Oct 15:11
v22.11.0
4e0f277
Compare
Choose a tag to compare

Notable Changes

This release marks the transition of Node.js 22.x into Long Term Support (LTS)
with the codename 'Jod'. The 22.x release line now moves into "Active LTS"
and will remain so until October 2025. After that time, it will move into
"Maintenance" until end of life in April 2027.

Other than updating metadata, such as the process.release object, to reflect
that the release is LTS, no further changes from Node.js 22.10.0 are included.

OpenSSL 3.x

Official binaries for Node.js 22.x currently include OpenSSL 3.0.x (more
specifically, the quictls OpenSSL fork).
OpenSSL 3.0.x is the currently designated long term support version that is
scheduled to be supported until 7th September 2026, which is within the expected
lifetime of Node.js 22.x. We are expecting upstream OpenSSL to announce a
successor long term support version prior to that date and since OpenSSL now
follows a semantic versioning-like versioning scheme we expect to be able to
update to the next long term supported version of OpenSSL during the lifetime of
Node.js 22.x.

2024-10-24, Version 23.1.0 (Current), @aduh95

24 Oct 21:30
v23.1.0
17fae65
Compare
Choose a tag to compare

Notable Changes

Buffer now work with resizable ArrayBuffer

When a Buffer is created using a resizable ArrayBuffer, the Buffer length
will now correctly change as the underlying ArrayBuffer size is changed.

const ab = new ArrayBuffer(10, { maxByteLength: 20 });
const buffer = Buffer.from(ab);
console.log(buffer.byteLength); 10
ab.resize(15);
console.log(buffer.byteLength); 15
ab.resize(5);
console.log(buffer.byteLength); 5

Contributed by James M Snell in #55377.

MockTimers test runner API is now stable

MockTimers, introduced in April 2023, has just reached stable status. This
API provides comprehensive support for mocking Date and all major timers in
Node.js, including setTimeout, setInterval, and setImmediate, both from
the node:timers, node:timers/promises modules and global objects. After
months of refinement, developers can now fully rely on MockTimers for testing
time-based operations with confidence, ensuring better control over asynchronous
behavior in their Node.js applications.

Example usage with initial Date object as time set:

import { mock } from 'node:test';
mock.timers.enable({ apis: ['Date'], now: new Date('1970-01-01') });

Contributed by Erick Wendel in #55398.

JSON modules and import attributes are now stable

The two proposals reached stage 4 of the TC39 process, at the October 2024
meeting. The Node.js implementation already matches exactly the semantics
required by the proposals.

Contributed by Nicolò Ribaudo by #55333.

Other Notable Changes

  • [4ba31b7f20] - (SEMVER-MINOR) assert: make assertion_error use Myers diff algorithm (Giovanni Bucci) #54862
  • [dcbc5fbe65] - (SEMVER-MINOR) lib: add UV_UDP_REUSEPORT for udp (theanarkh) #55403
  • [ec867ac7ce] - (SEMVER-MINOR) net: add UV_TCP_REUSEPORT for tcp (theanarkh) #55408

Commits

  • [4ba31b7f20] - (SEMVER-MINOR) assert: make assertion_error use Myers diff algorithm (Giovanni Bucci) #54862
  • [fe667bea28] - assert: fix deepEqual always return true on URL (Xuguang Mei) #50853
  • [aca03d9083] - benchmark: add --runs support to run.js (Rafael Gonzaga) #55158
  • [c5abf50692] - benchmark: adjust byte size for buffer-copy (Rafael Gonzaga) #55295
  • [d3618b2334] - benchmark: adjust config for deepEqual object (Rafael Gonzaga) #55254
  • [c05582da3d] - (SEMVER-MINOR) buffer: make Buffer work with resizable ArrayBuffer (James M Snell) #55377
  • [194bb0fca5] - build: fix GN build for cares/uv deps (Cheng) #55477
  • [8eb5359592] - build: fix uninstall script for AIX 7.1 (Cloorc) #55438
  • [32f7d5ad1c] - build: conditionally compile bundled sqlite (Richard Lau) #55409
  • [2147e496e7] - build: tidy up cares.gyp (Richard Lau) #55445
  • [2beae50c77] - build: synchronize list of c-ares source files (Richard Lau) #55445
  • [f48d30eb9f] - build: fix path concatenation (Mohammed Keyvanzadeh) #55387
  • [d42522eec5] - build: fix make errors that occur in Makefile (minkyu_kim) #55287
  • [52da293471] - cli: add --heap-prof flag available to NODE_OPTIONS (Juan José) #54259
  • [adead26815] - crypto: include openssl/rand.h explicitly (Shelley Vohr) #55425
  • [df2f1adf9e] - deps: V8: cherry-pick f915fa4c9f41 (Chengzhong Wu) #55484
  • [bfc10a975f] - deps: update googletest to df1544b (Node.js GitHub Bot) #55465
  • [45ef1809bd] - deps: update c-ares to v1.34.2 (Node.js GitHub Bot) #55463
  • [c2b5ebfeca] - deps: update ada to 2.9.1 (Node.js GitHub Bot) #54679
  • [903863cafa] - deps: update simdutf to 5.6.0 (Node.js GitHub Bot) #55379
  • [008fb5f7f4] - deps: patch V8 to 12.9.202.28 (Node.js GitHub Bot) #55371
  • [8b282228ae] - deps: update c-ares to v1.34.1 (Node.js GitHub Bot) #55369
  • [54d55f2337] - Revert "deps: disable io_uring support in libuv by default" (Santiago Gimeno) #55114
  • [bfb3c621c4] - deps: update libuv to 1.49.1 (Santiago Gimeno) #55114
  • [055d2b8919] - deps: update amaro to 0.1.9 (Node.js GitHub Bot) #55348
  • [c028d21b44] - diagnostics_channel: fix unsubscribe during publish (simon-id) #55116
  • [b4b6ddb777] - dns: honor the order option (Luigi Pinca) #55392
  • [37352cef7f] - doc: changed the command used to verify SHASUMS256 (adriancuadrado) #55420
  • [66bcf4c065] - doc: move dual package shipping docs to separate repo (Joyee Cheung) #55444
  • [04b41bda03] - doc: add note about stdio streams in child_process (Ederin (Ed) Igharoro) #55322
  • [689d3a3e41] - doc: add isBigIntObject to documentation (leviscar) #55450
  • [784c825a27] - doc: remove outdated remarks about highWaterMark in fs (Ian Kerins) #55462
  • [1ec25e8573] - doc: move Danielle Adams key to old gpg keys (RafaelGSS) #55399
  • [7d5bb097eb] - doc: move Bryan English key to old gpg keys (RafaelGSS) #55399
  • [2967471f67] - doc: move Beth Griggs keys to old gpg keys (RafaelGSS) #55399
  • [0be3a7505f] - doc: add changelog for mocktimers (Erick Wendel) #55398
  • [e15f779794] - doc: spell out condition restrictions (Jan Martin) #55187
  • [c3f2216a7d] - doc: add instructions for WinGet build (Hüseyin Açacak) #55356
  • [bdc2c3bb94] - doc: add missing return values in buffer docs (Karl Horky) #55273
  • [41f68f59af] - doc: fix ambasador markdown list (Rafael Gonzaga) #55361
  • [bbd5318729] - esm: add a fallback when importer in not a file (Antoine du Hamel) #55471
  • [[`22d7777...
Read more

2024-10-16, Version 23.0.0 (Current), @RafaelGSS

16 Oct 15:42
v23.0.0
Compare
Choose a tag to compare

We’re excited to announce the release of Node.js 23! Key highlights include:

  • Enabling require(esm) by default for Node.js applications
  • Removing support for Windows 32-bit systems
  • Stabilizing the node --run command
  • Enhancements to the test runner, including glob pattern support for coverage files

Node.js 23 will replace Node.js 22 as the ‘Current’ release line when Node.js 22 enters long-term support (LTS) later this month.
According to the release schedule, Node.js 23 will remain the ‘Current’ release for the next six months, until April 2025.

Other Notable Changes

  • [7ad0cc3e57] - (SEMVER-MAJOR) build: remove support for 32-bit Windows (Michaël Zasso) #53184
  • [83eb4f2855] - (SEMVER-MINOR) deps: V8: cherry-pick cd10ad7cdbe5 (Joyee Cheung) #52535
  • [b8493a5789] - doc: add abmusse to collaborators (Abdirahim Musse) #55086
  • [7fab6e8885] - (SEMVER-MAJOR) doc: use gcc 12 on AIX for Node.js >=23 (Richard Lau) #54338
  • [d473606040] - (SEMVER-MINOR) lib: propagate aborted state to dependent signals before firing events (jazelly) #54826
  • [06206af181] - (SEMVER-MINOR) module: unflag --experimental-require-module (Joyee Cheung) #55085
  • [0b9249e335] - (SEMVER-MINOR) module: implement the "module-sync" exports condition (Joyee Cheung) #54648
  • [92a25abca9] - (SEMVER-MINOR) path: add matchGlob method (Aviv Keller) #52881
  • [12dd4c7575] - src: mark node --run as stable (Yagiz Nizipli) #53763
  • [4174b73153] - test: support glob matching coverage files (Aviv Keller) #53553

Semver-Major Commits

  • [764b13d75c] - (SEMVER-MAJOR) assert,util: change WeakMap and WeakSet comparison handling (Cristian Barlutiu) #53495
  • [3800d60c66] - (SEMVER-MAJOR) buffer: throw when writing beyond buffer" (Robert Nagy) #54588
  • [17fd32790a] - (SEMVER-MAJOR) buffer: make File cloneable (Matthew Aitken) #47613
  • [f68d7d2acc] - (SEMVER-MAJOR) build: reset embedder string to "-node.0" (Michaël Zasso) #54536
  • [9d0748c5df] - (SEMVER-MAJOR) build: disable ICF for mksnapshot (Leszek Swirski) #54077
  • [b7bcf3e121] - (SEMVER-MAJOR) build: include v8-sandbox.h header in distribution (Michaël Zasso) #54077
  • [1dfa3b8255] - (SEMVER-MAJOR) build: reset embedder string to "-node.0" (Michaël Zasso) #54077
  • [046343ea9d] - (SEMVER-MAJOR) build: warn for GCC versions earlier than 12.2 (Michaël Zasso) #54081
  • [a5decd4c8d] - (SEMVER-MAJOR) build: drop experimental support for Windows <10 (Michaël Zasso) #54079
  • [7ad0cc3e57] - (SEMVER-MAJOR) build: remove support for 32-bit Windows (Michaël Zasso) #53184
  • [c7e42092f3] - (SEMVER-MAJOR) build: compile with C++20 support (Michaël Zasso) #45427
  • [e2b7e41e23] - (SEMVER-MAJOR) child_process: remove unused internal event (Rich Trott) #53793
  • [4f1fe8a015] - (SEMVER-MAJOR) cli: remove deprecated V8 flag (Omer Katz) #54761
  • [8f37492b65] - (SEMVER-MAJOR) cli: move --trace-atomics-wait to eol (Marco Ippolito) #52747
  • [f7e73cd1f2] - (SEMVER-MAJOR) cli: remove --no-experimental-global-customevent flag (Daeyeon Jeong) #52723
  • [311504125f] - (SEMVER-MAJOR) cli: remove --no-experimental-fetch flag (Filip Skokan) #52611
  • [a30ae50860] - (SEMVER-MAJOR) cli: remove --no-experimental-global-webcrypto flag (Filip Skokan) #52564
  • [afe56aa58b] - (SEMVER-MAJOR) crypto: runtime deprecate crypto.fips (Yagiz Nizipli) #55019
  • [33a6d1fe3a] - (SEMVER-MAJOR) crypto: remove ERR_CRYPTO_SCRYPT_INVALID_PARAMETER (Tobias Nießen) #53305
  • [ff826069a8] - (SEMVER-MAJOR) crypto: move DEP0182 to runtime deprecation (Tobias Nießen) #52552
  • [6e150f9527] - (SEMVER-MAJOR) deps: V8: cherry-pick 97199f686e2f (Michaël Zasso) #54536
  • [1e16779fa1] - (SEMVER-MAJOR) deps: V8: cherry-pick 01a47f3ffff2 (Michaël Zasso) #54536
  • [762a440e68] - (SEMVER-MAJOR) deps: patch V8 to support older Clang versions (Michaël Zasso) #54536
  • [95f2213eed] - (SEMVER-MAJOR) deps: always define V8_NODISCARD as no-op (Michaël Zasso) #54536
  • [09d997f181] - (SEMVER-MAJOR) deps: fix FP16 bitcasts.h (Stefan Stojanovic) #54536
  • [1866363854] - (SEMVER-MAJOR) deps: patch V8 to support compilation with MSVC (StefanStojanovic) #54536
  • [6f4f22f84c] - (SEMVER-MAJOR) deps: patch V8 to avoid duplicated zlib symbol (Michaël Zasso) #54536
  • [dfff61475e] - (SEMVER-MAJOR) deps: disable V8 concurrent sparkplug compilation (Michaël Zasso) #54536
  • [69ad89f8eb] - (SEMVER-MAJOR) deps: always define V8_EXPORT_PRIVATE as no-op (Michaël Zasso) #54536
  • [5ab3140dfb] - (SEMVER-MAJOR) deps: update V8 to 12.9.202.18 (Michaël Zasso) #54536
  • [fba06eb34a] - (SEMVER-MAJOR) deps: remove bogus V8 DCHECK (Michaël Zasso) #54077
  • [5355603fb5] - (SEMVER-MAJOR) deps: V8: cherry-pick 00e9eeb3fb2c (Michaël Zasso) #54077
  • [bcc1e2716c] - (SEMVER-MAJOR) deps: V8: cherry-pick b1397772c70c (Michaël Zasso) #54077
  • [415bc750a5] - (SEMVER-MAJOR) deps: V8: cherry-pick 35888fee7bba (Joyee Cheung) #54077
  • [28f3e5c9d1] - (SEMVER-MAJOR) deps: always define V8_NODISCARD as no-op (Michaël Zasso) #54077
  • [a41c381cde] - (SEMVER-MAJOR) deps: fix FP16 bitcasts.h (Stefan Stojanovic) [#54077](https://github.com/nod...
Read more

2024-10-16, Version 22.10.0 (Current), @aduh95

16 Oct 22:49
v22.10.0
afe4bc6
Compare
Choose a tag to compare

Notable Changes

New "module-sync" exports condition

This release introduces a "module-sync" exports condition that's enabled when
require(esm) is enabled, so packages can supply a synchronous ES module to the
Node.js module loader, no matter if 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 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 ended 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
breaking to implement a "module" condition without implementing the forbidden
ESM resolution rules. For now, this just implements a new condition as
semver-minor so it can be backported to older LTS.

Contributed by Joyee Cheung in #54648.

node --run is now stable

This CLI flag runs a specified command from a package.json's "scripts" object.

For the following package.json:

{
  "scripts": {
    "test": "node --test-reporter junit --test ./test"
  }
}

You can run node --run test and that would start the test suite.

Contributed by Yagiz Nizipli in #53763.

Other notable changes

  • [f0b441230a] - (SEMVER-MINOR) crypto: add KeyObject.prototype.toCryptoKey (Filip Skokan) #55262
  • [349d2ed07b] - (SEMVER-MINOR) crypto: add Date fields for validTo and validFrom (Andrew Moon) #54159
  • [bebc95ed58] - doc: add abmusse to collaborators (Abdirahim Musse) #55086
  • [914db60159] - (SEMVER-MINOR) http2: expose nghttp2_option_set_stream_reset_rate_limit as an option (Maël Nison) #54875
  • [f7c3b03759] - (SEMVER-MINOR) lib: propagate aborted state to dependent signals before firing events (jazelly) #54826
  • [32261fc98a] - (SEMVER-MINOR) module: support loading entrypoint as url (RedYetiDev) #54933
  • [06957ff355] - (SEMVER-MINOR) module: implement flushCompileCache() (Joyee Cheung) #54971
  • [2dcf70c347] - (SEMVER-MINOR) module: throw when invalid argument is passed to enableCompileCache() (Joyee Cheung) #54971
  • [f9b19d7c44] - (SEMVER-MINOR) module: write compile cache to temporary file and then rename it (Joyee Cheung) #54971
  • [e95163b170] - (SEMVER-MINOR) process: add process.features.require_module (Joyee Cheung) #55241
  • [4050f68e5d] - (SEMVER-MINOR) process: add process.features.typescript (Aviv Keller) #54295
  • [86f7cb802d] - (SEMVER-MINOR) test_runner: support custom arguments in run() (Aviv Keller) #55126
  • [b62f2f8259] - (SEMVER-MINOR) test_runner: add 'test:summary' event (Colin Ihrig) #54851
  • [d7c708aec5] - (SEMVER-MINOR) test_runner: add support for coverage via run() (Chemi Atlow) #53937
  • [5fda4a1498] - (SEMVER-MINOR) worker: add markAsUncloneable api (Jason Zhang) #55234

Commits

  • [e3619510c8] - assert: show the diff when deep comparing data with a custom message (Giovanni) #54759
  • [39c7a9e70c] - benchmark: adjust config for deepEqual object (Rafael Gonzaga) #55254
  • [263526d5d0] - benchmark: rewrite detect-esm-syntax benchmark (Joyee Cheung) #55238
  • [cd0795fb00] - benchmark: add no-warnings to process.has bench (Rafael Gonzaga) #55159
  • [4352d9cc31] - benchmark: create benchmark for typescript (Marco Ippolito) #54904
  • [452bc9b48d] - benchmark: add webstorage benchmark (jakecastelli) #55040
  • [d4d5ba3a9b] - benchmark: include ascii to fs/readfile (Rafael Gonzaga) #54988
  • [23b628db65] - benchmark: add dotenv benchmark (Aviv Keller) #54278
  • [b1ebb0d8ca] - buffer: coerce extrema to int in blob.slice (Antoine du Hamel) #55141
  • [3a6e72483f] - buffer: extract Blob's .arrayBuffer() & webidl changes (Matthew Aitken) #53372
  • [d109f1c4ff] - buffer: use simdutf convert_latin1_to_utf8_safe (Robert Nagy) #54798
  • [77f8a3f9c2] - ...
Read more

2024-10-03, Version 20.18.0 'Iron' (LTS), @targos

03 Oct 18:00
v20.18.0
7eebd17
Compare
Choose a tag to compare

Notable Changes

Experimental Network Inspection Support in Node.js

This update introduces the initial support for network inspection in Node.js.
Currently, this is an experimental feature, so you need to enable it using the --experimental-network-inspection flag.
With this feature enabled, you can inspect network activities occurring within a JavaScript application.

To use network inspection, start your Node.js application with the following command:

$ node --inspect-wait --experimental-network-inspection index.js

Please note that the network inspection capabilities are in active development.
We are actively working on enhancing this feature and will continue to expand its functionality in future updates.

Contributed by Kohei Ueno in #53593 and #54246

Exposes X509_V_FLAG_PARTIAL_CHAIN to tls.createSecureContext

This releases introduces a new option to the API tls.createSecureContext. From
now on, tls.createSecureContext({ allowPartialTrustChain: true }) can be used
to treat intermediate (non-self-signed) certificates in the trust CA certificate
list as trusted.

Contributed by Anna Henningsen in #54790

New option for vm.createContext() to create a context with a freezable globalThis

Node.js implements a flavor of vm.createContext() and friends that creates a context without contextifying its global
object when vm.constants.DONT_CONTEXTIFY is used. This is suitable when users want to freeze the context
(impossible when the global is contextified i.e. has interceptors installed) or speed up the global access if they
don't need the interceptor behavior.

Contributed by Joyee Cheung in #54394

Deprecations

  • [64aa31f6e5] - repl: doc-deprecate instantiating node:repl classes without new (Aviv Keller) #54842
  • [4c52ee3d7f] - zlib: deprecate instantiating classes without new (Yagiz Nizipli) #54708

Other Notable Changes

  • [b80da2f964] - buffer: optimize createFromString (Robert Nagy) #54324
  • [02b36cbd2d] - (SEMVER-MINOR) lib: add EventSource Client (Aras Abbasi) #51575
  • [879546a9bf] - (SEMVER-MINOR) src,lib: add performance.uvMetricsInfo (Rafael Gonzaga) #54413
  • [f789f4c92d] - (SEMVER-MINOR) test_runner: support module mocking (Colin Ihrig) #52848
  • [4eb0749b6c] - (SEMVER-MINOR) url: implement parse method for safer URL parsing (Ali Hassan) #52280

Commits

  • [013c48f0e9] - benchmark: --no-warnings to avoid DEP/ExpWarn log (Rafael Gonzaga) #54928
  • [194fc113ac] - benchmark: add buffer.isAscii benchmark (RafaelGSS) #54740
  • [7410d51cb9] - benchmark: add buffer.isUtf8 bench (RafaelGSS) #54740
  • [2393f21e8a] - benchmark: add access async version to bench (Rafael Gonzaga) #54747
  • [b8779721f0] - benchmark: enhance dc publish benchmark (Rafael Gonzaga) #54745
  • [4078aa83ff] - benchmark: add match and doesNotMatch bench (RafaelGSS) #54734
  • [66acab9976] - benchmark: add rejects and doesNotReject bench (RafaelGSS) #54734
  • [6db777fb3a] - benchmark: add throws and doesNotThrow bench (RafaelGSS) #54734
  • [8f101560ce] - benchmark: add strictEqual and notStrictEqual bench (RafaelGSS) #54734
  • [2c9e4c936e] - benchmark: adds groups to better separate benchmarks (Giovanni Bucci) #54393
  • [671c3ac633] - benchmark: fix benchmark for file path and URL conversion (Early Riser) #54190
  • [8c8708cb5b] - benchmark: use assert.ok searchparams (Rafael Gonzaga) #54334
  • [8b71fa79e2] - benchmark: add stream.compose benchmark (jakecastelli) #54308
  • [93ee36e3a0] - benchmark: rename count to n (Rafael Gonzaga) #54271
  • [f2971b6f0b] - benchmark: change assert() to assert.ok() (Rafael Gonzaga) #54254
  • [f48f2c212c] - benchmark: support --help in CLI (Aviv Keller) #53358
  • [0309b0520b] - benchmark: remove force option as force defaults to true (Yelim Koo) #54203
  • [b6e8305b2d] - benchmark: use assert.ok instead of assert (Rafael Gonzaga) #54176
  • [90c660d26a] - benchmark: add require-esm benchmark (Joyee Cheung) #52166
  • [1b8584b52e] - benchmark,doc: add CPU scaling governor to perf (Rafael Gonzaga) #54723
  • [0b9161b330] - benchmark,doc: mention bar.R to the list of scripts (Rafael Gonzaga) #54722
  • [84bf93b7ea] - buffer: allow invalid encoding in from (Robert Nagy) #54533
  • [d04246a0d7] - buffer: optimize byteLength for common encodings (Robert Nagy) #54342
  • [f36831f694] - buffer: optimize createFromString (Robert Nagy) #54324
  • [f5f40c8088] - buffer: optimize for common encodings (Robert Nagy) #54319
  • [76c37703be] - buffer: add JSDoc to blob bytes method (Roberto Simonini) #54117
  • [3012d31404] - buffer: use faster integer argument check (Robert Nagy) #54089
  • [3505782801] - buffer: make indexOf(byte) faster (Tobias Nießen) #53455
  • [d285fc1f68] - build: upgrade clang-format to v18 (Aviv Keller) #53957
  • [d288ec3b0a] - build: fix conflicting V8 object print flags (Daeyeon Jeong) #54785
  • [e862eecac9] - build: do not build with code cache for core coverage collection (Joyee Cheung) #54633
  • [f7a606eb96] - build: turn off -Wrestrict (Richard Lau) #54737
  • [71ca2665e4] - build: reclaim disk space on macOS GHA runner (jakecastelli) #54658
  • [82d8051c39] - build: don't clean obj.target directory if it doesn't exist (Joyee Cheung) #54337
  • [[6e550b1f26](ht...
Read more

2024-09-17, Version 22.9.0 (Current), @RafaelGSS

17 Sep 21:07
v22.9.0
Compare
Choose a tag to compare

New API to retrieve execution Stack Trace

A new API getCallSite has been introduced to the util module. This API allows users
to retrieve the stacktrace of the current execution. Example:

const util = require('node:util');

function exampleFunction() {
  const callSites = util.getCallSite();

  console.log('Call Sites:');
  callSites.forEach((callSite, index) => {
    console.log(`CallSite ${index + 1}:`);
    console.log(`Function Name: ${callSite.functionName}`);
    console.log(`Script Name: ${callSite.scriptName}`);
    console.log(`Line Number: ${callSite.lineNumber}`);
    console.log(`Column Number: ${callSite.column}`);
  });
  // CallSite 1:
  // Function Name: exampleFunction
  // Script Name: /home/example.js
  // Line Number: 5
  // Column Number: 26

  // CallSite 2:
  // Function Name: anotherFunction
  // Script Name: /home/example.js
  // Line Number: 22
  // Column Number: 3

  // ...
}

// A function to simulate another stack layer
function anotherFunction() {
  exampleFunction();
}

anotherFunction();

Thanks to Rafael Gonzaga for making this work on #54380.

Disable V8 Maglev

We have seen several crashes/unexpected JS behaviors with maglev on v22
(which ships V8 v12.4). The bugs lie in the codegen so it would be difficult for
users to work around them or even figure out where the bugs are coming from.
Some bugs are fixed in the upstream while some others probably remain.

As v22 will get stuck with V8 v12.4 as LTS, it will be increasingly difficult to
backport patches for them even if the bugs are fixed. So disable it by default
on v22 to reduce the churn and troubles for users.

Thanks to Joyee Cheung for making this work on #54384

Exposes X509_V_FLAG_PARTIAL_CHAIN to tls.createSecureContext

This releases introduces a new option to the API tls.createSecureContext. For
now on users can use tls.createSecureContext({ allowPartialTrustChain: true })
to treat intermediate (non-self-signed) certificates in the trust CA certificate
list as trusted.

Thanks to Anna Henningsen for making this work on #54790

Other Notable Changes

  • [5c9599af5a] - src: create handle scope in FastInternalModuleStat (Joyee Cheung) #54384
  • [e2307d87e8] - (SEMVER-MINOR) stream: relocate the status checking code in the onwritecomplete (YoonSoo_Shin) #54032

Deprecations

  • [8433032948] - repl: doc-deprecate instantiating node:repl classes without new (Aviv Keller) #54842
  • [8c4c85cf31] - zlib: deprecate instantiating classes without new (Yagiz Nizipli) #54708

Commits

Read more

2024-09-03, Version 22.8.0 (Current), @RafaelGSS

03 Sep 13:46
v22.8.0
Compare
Choose a tag to compare

New JS API for compile cache

This release adds a new API module.enableCompileCache() that can be used to enable on-disk code caching of all modules loaded after this API is called.
Previously this could only be enabled by the NODE_COMPILE_CACHE environment variable, so it could only set by end-users.
This API allows tooling and library authors to enable caching of their own code.
This is a built-in alternative to the v8-compile-cache/v8-compile-cache-lib packages,
but have better performance and supports ESM.

Thanks to Joyee Cheung for working on this.

New option for vm.createContext() to create a context with a freezable globalThis

Node.js implements a flavor of vm.createContext() and friends that creates a context without contextifying its global
object when vm.constants.DONT_CONTEXTIFY is used. This is suitable when users want to freeze the context
(impossible when the global is contextified i.e. has interceptors installed) or speed up the global access if they
don't need the interceptor behavior.

Thanks to Joyee Cheung for working on this.

Support for coverage thresholds

Node.js now supports requiring code coverage to meet a specific threshold before the process exits successfully.
To use this feature, you need to enable the --experimental-test-coverage flag.

You can set thresholds for the following types of coverage:

  • Branch coverage: Use --test-coverage-branches=<threshold>
  • Function coverage: Use --test-coverage-functions=<threshold>
  • Line coverage: Use --test-coverage-lines=<threshold>

<threshold> should be an integer between 0 and 100. If an invalid value is provided, a TypeError will be thrown.

If the code coverage fails to meet the specified thresholds for any category, the process will exit with code 1.

For instance, to enforce a minimum of 80% line coverage and 60% branch coverage, you can run:

$ node --experimental-test-coverage --test-coverage-lines=80 --test-coverage-branches=60 example.js

Thanks Aviv Keller for working on this.

Other Notable Changes

  • [1f2cc2fa47] - (SEMVER-MINOR) src,lib: add performance.uvMetricsInfo (Rafael Gonzaga) #54413
  • [1e01bdc0d0] - (SEMVER-MINOR) net: exclude ipv6 loopback addresses from server.listen (Giovanni Bucci) #54264
  • [97fa075c2e] - (SEMVER-MINOR) test_runner: support running tests in process (Colin Ihrig) #53927
  • [858b583c88] - (SEMVER-MINOR) test_runner: defer inheriting hooks until run() (Colin Ihrig) #53927

Commits

  • [94985df9d6] - benchmark: fix benchmark for file path and URL conversion (Early Riser) #54190
  • [ac178b094b] - buffer: truncate instead of throw when writing beyond buffer (Robert Nagy) #54524
  • [afd8c1eb4f] - buffer: allow invalid encoding in from (Robert Nagy) #54533
  • [6f0cf35cd3] - build: reclaim disk space on macOS GHA runner (jakecastelli) #54658
  • [467ac3aec4] - build: don't clean obj.target directory if it doesn't exist (Joyee Cheung) #54337
  • [71fdf961df] - build: update required python version to 3.8 (Aviv Keller) #54358
  • [73604cf1c5] - deps: update nghttp2 to 1.63.0 (Node.js GitHub Bot) #54589
  • [b00c087285] - deps: V8: cherry-pick e74d0f437fcd (Joyee Cheung) #54279
  • [33a6b3c7a9] - deps: backport ICU-22787 to fix ClangCL on Windows (Stefan Stojanovic) #54502
  • [fe56949cbb] - deps: update c-ares to v1.33.1 (Node.js GitHub Bot) #54549
  • [290f6ce619] - deps: update amaro to 0.1.8 (Node.js GitHub Bot) #54520
  • [b5843568b4] - deps: update amaro to 0.1.7 (Node.js GitHub Bot) #54473
  • [9c709209b4] - deps: update undici to 6.19.8 (Node.js GitHub Bot) #54456
  • [a5ce24181b] - deps: sqlite: fix Windows compilation (Colin Ihrig) #54433
  • [3caf29ea88] - deps: update sqlite to 3.46.1 (Node.js GitHub Bot) #54433
  • [68758d4b08] - doc: add support me link for anonrig (Yagiz Nizipli) #54611
  • [f5c5529266] - doc: add alert on REPL from TCP socket (Rafael Gonzaga) #54594
  • [bf824483cd] - doc: fix typo in styleText description (Rafael Gonzaga) #54616
  • [825d933fd4] - doc: add getHeapStatistics() property descriptions (Benji Marinacci) #54584
  • [80e5150160] - doc: fix module compile cache description (沈鸿飞) #54625
  • [7fd033fe56] - doc: run license-builder (github-actions[bot]) #54562
  • [c499913732] - doc: fix information about including coverage files (Aviv Keller) #54527
  • [c3dc83befc] - doc: support collaborators - talk amplification (Michael Dawson) #54508
  • [fc57beaad3] - doc: add note about shasum generation failure (Marco Ippolito) #54487
  • [1800a58f49] - doc: update websocket flag description to reflect stable API status (Yelim Koo) #54482
  • [61affd77a7] - doc: fix capitalization in module.md (shallow-beach) #54488
  • [25419915c7] - doc: add esm examples to node:https (Alfredo González) #54399
  • [83b5efeb54] - doc: reserve ABI 130 for Electron 33 (Calvin) #54383
  • [6ccbd32ae8] - doc, meta: add missing , to BUILDING.md (Aviv Keller) #54409
  • [fc08a9b0cd] - fs: refactor handleTimestampsAndMode to remove redundant call (HEESEUNG) #54369
  • [4a664b5fcb] - lib: respect terminal capabilities on styleText (Rafael Gonzaga) #54389
  • [a9ce2b6a28] - lib: fix emit warning for debuglog.time when disabled (Vinicius Lourenço) #54275
  • [b5a23c9783] - meta: remind users to use a supported version in bug reports (Aviv Keller) #54481
  • [0d7171d8e9] - meta: add more labels to dep-updaters (Aviv Keller) #54454
  • [c4996c189f] - meta: run coverage-windows when vcbuild.bat updated (Aviv Keller) #54412
  • [3cf645768e] - module: use amaro default transform values (Marco Ippolito) #54517
  • [336496b90e] - module: add sourceURL magic comment hint...
Read more

2024-08-22, Version 22.7.0 (Current), @RafaelGSS

22 Aug 14:18
v22.7.0
Compare
Choose a tag to compare

Experimental transform types support

With the new flag --experimental-transform-types it is possible to enable the
transformation of TypeScript-only syntax into JavaScript code.

This feature allows Node.js to support TypeScript syntax such as Enum and namespace.

Thanks to Marco Ippolito for making this work on #54283.

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 #53619.

Performance Improvements to Buffer

Performance of Node.js Buffers have been optimized through multiple PR's with significant
improvements to the Buffer.copy and Buffer.write methods. These are used throughout
the codebase and should give a nice boost across the board.

Thanks to Robert Nagy for making this work on #54311,
#54324, and #54087.

Other Notable Changes

  • [911de7dd6d] - (SEMVER-MINOR) inspector: support Network.loadingFailed event (Kohei Ueno) #54246
  • [9ee4b16bd8] - (SEMVER-MINOR) lib: rewrite AsyncLocalStorage without async_hooks (Stephen Belanger) #48528

Commits

Read more

2024-08-21, Version 20.17.0 'Iron' (LTS), @marco-ippolito

21 Aug 16:32
v20.17.0
efbec04
Compare
Choose a tag to compare

module: support require()ing synchronous ESM graphs

This release adds require() support for synchronous ESM graphs under
the flag --experimental-require-module.

If --experimental-require-module is enabled, and the ECMAScript
module being loaded by require() meets the following requirements:

  • Explicitly marked as an ES module with a "type": "module" field in the closest package.json or a .mjs extension.
  • Fully synchronous (contains no top-level await).

require() will load the requested module as an ES Module, and return
the module name space object. In this case it is similar to dynamic
import() but is run synchronously and returns the name space object
directly.

Contributed by Joyee Cheung in #51977

path: add matchesGlob method

Glob patterns can now be tested against individual paths via the path.matchesGlob(path, pattern) method.

Contributed by Aviv Keller in #52881

stream: expose DuplexPair API

The function duplexPair returns an array with two items,
each being a Duplex stream connected to the other side:

const [ sideA, sideB ] = duplexPair();

Whatever is written to one stream is made readable on the other. It provides
behavior analogous to a network connection, where the data written by the client
becomes readable by the server, and vice-versa.

Contributed by Austin Wright in #34111

Other Notable Changes

  • [8e64c02b19] - (SEMVER-MINOR) http: add diagnostics channel http.client.request.error (Kohei Ueno) #54054
  • [ae30674991] - meta: add jake to collaborators (jakecastelli) #54004
  • [4a3ecbfc9b] - (SEMVER-MINOR) stream: implement min option for ReadableStreamBYOBReader.read (Mattias Buelens) #50888

Commits

Read more

2024-08-06, Version 22.6.0 (Current), @RafaelGSS

06 Aug 18:04
v22.6.0
Compare
Choose a tag to compare

Experimental TypeScript support via strip types

Node.js introduces the --experimental-strip-types flag for initial TypeScript support.
This feature strips type annotations from .ts files, allowing them to run
without transforming TypeScript-specific syntax. Current limitations include:

  • Supports only inline type annotations, not features like enums or namespaces.
  • Requires explicit file extensions in import and require statements.
  • Enforces the use of the type keyword for type imports to avoid runtime errors.
  • Disabled for TypeScript in node_modules by default.

Thanks Marco Ippolito for working on this.

Experimental Network Inspection Support in Node.js

This update introduces the initial support for network inspection in Node.js.
Currently, this is an experimental feature, so you need to enable it using the --experimental-network-inspection flag.
With this feature enabled, you can inspect network activities occurring within a JavaScript application.

To use network inspection, start your Node.js application with the following command:

$ node --inspect-wait --experimental-network-inspection index.js

Please note that the network inspection capabilities are in active development.
We are actively working on enhancing this feature and will continue to expand its functionality in future updates.

Thanks Kohei Ueno for working on this.

Other Notable Changes

  • [15a94e67b1] - lib,src: drop --experimental-network-imports (Rafael Gonzaga) #53822
  • [68e444d2d8] - (SEMVER-MINOR) http: add diagnostics channel http.client.request.error (Kohei Ueno) #54054
  • [2d982d3dee] - (SEMVER-MINOR) deps: V8: backport 7857eb34db42 (Stephen Belanger) #53997
  • [15816bd0dd] - (SEMVER-MINOR) stream: expose DuplexPair API (Austin Wright) #34111
  • [893c864542] - (SEMVER-MINOR) test_runner: fix support watch with run(), add globPatterns option (Matteo Collina) #53866
  • [048d421ad1] - meta: add jake to collaborators (jakecastelli) #54004
  • [6ad6e01bf3] - (SEMVER-MINOR) test_runner: refactor snapshots to get file from context (Colin Ihrig) #53853
  • [698e44f8e7] - (SEMVER-MINOR) test_runner: add context.filePath (Colin Ihrig) #53853

Commits

  • [063f46dc2a] - assert: use isError instead of instanceof in innerOk (Pietro Marchini) #53980
  • [10bea42f81] - build: update gcovr to 7.2 and codecov config (Benjamin E. Coe) #54019
  • [7c417c6cf4] - build: avoid compiling with VS v17.10 (Hüseyin Açacak) #53863
  • [ee97c045b4] - build: ensure v8_pointer_compression_sandbox is enabled on 64bit (Shelley Vohr) #53884
  • [bfbed0afd5] - build: fix conflict gyp configs (Chengzhong Wu) #53605
  • [0f1fe63e32] - build: trigger coverage ci when updating codecov (Yagiz Nizipli) #53929
  • [ad62b945f0] - build: update codecov coverage build count (Yagiz Nizipli) #53929
  • [3c40868fd3] - build: disable test-asan workflow (Michaël Zasso) #53844
  • [2a62d6ca57] - build, tools: drop leading / from r2dir (Richard Lau) #53951
  • [9c7b009f47] - build,tools: simplify upload of shasum signatures (Michaël Zasso) #53892
  • [057bd44f9f] - child_process: fix incomplete prototype pollution hardening (Liran Tal) #53781
  • [66f7c595c7] - cli: document --inspect port 0 behavior (Aviv Keller) #53782
  • [fad3e74b47] - console: fix issues with frozen intrinsics (Vinicius Lourenço) #54070
  • [e685ecd7ae] - deps: update corepack to 0.29.3 (Node.js GitHub Bot) #54072
  • [e5f7250e6d] - deps: update amaro to 0.0.6 (Node.js GitHub Bot) #54199
  • [2c1e9082e8] - deps: update amaro to 0.0.5 (Node.js GitHub Bot) #54199
  • [2d982d3dee] - (SEMVER-MINOR) deps: V8: backport 7857eb34db42 (Stephen Belanger) #53997
  • [1061898462] - deps: update c-ares to v1.32.3 (Node.js GitHub Bot) #54020
  • [f4a7ac5e18] - deps: V8: cherry-pick 35888fee7bba (Joyee Cheung) #53728
  • [1176310226] - deps: add gn build files for ncrypto (Cheng) #53940
  • [7a1d5a4f84] - deps: update c-ares to v1.32.2 (Node.js GitHub Bot) #53865
  • [66f6a2aec9] - deps: V8: cherry-pick 9812cb486e2b (Michaël Zasso) #53966
  • [8e66a18ef0] - deps: start working on ncrypto dep (James M Snell) #53803
  • [c114082b12] - deps: fix include_dirs of nbytes (Cheng) #53862
  • [b7315281be] - doc: move numCPUs require to top of file in cluster CJS example (Alfredo González) #53932
  • [8e7c30c2a4] - doc: update security-release process to automated one (Rafael Gonzaga) #53877
  • [52a4206be2] - doc: fix typo in technical-priorities.md (YoonSoo_Shin) #54094
  • [30e18a04a3] - doc: fix typo in diagnostic tooling support tiers document (Taejin Kim) #54058
  • [58aebfd31e] - doc: move GeoffreyBooth to TSC regular member (Geoffrey Booth) #54047
  • [c1634c7213] - doc: correct typescript stdin support (Marco Ippolito) #54036
  • [64812d5c22] - doc: fix typo in recognizing-contributors (Marco Ippolito) #53990
  • [6b35994b6f] - doc: fix documentation for --run (Aviv Keller) #53976
  • [04d203a233] - doc: update boxstarter README (Aviv Keller) #53785
  • [86fa46db1c] - doc: add info about prefix-only modules to module.builtinModules (Grigory) #53954
  • [defdc3c568] - doc: remove scroll-behavior: smooth; (Cloyd Lau) #53942
    *...
Read more