Commit Graph

7509 Commits

Author SHA1 Message Date
marco-ippolito
2246cd9735 2024-03-06, Version 21.7.0 (Current)
Notable changes:

build:
  * (SEMVER-MINOR) build opt to set local location of headers (Michael Dawson) https://github.com/nodejs/node/pull/51525
crypto:
  * (SEMVER-MINOR) implement crypto.hash() (Joyee Cheung) https://github.com/nodejs/node/pull/51044
  * update root certificates to NSS 3.98 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/51794
doc:
  * add zcbenz to collaborators (Cheng Zhao) https://github.com/nodejs/node/pull/51812
  * add lemire to collaborators (Daniel Lemire) https://github.com/nodejs/node/pull/51572
http2:
  * (SEMVER-MINOR) add h2 compat support for appendHeader (Tim Perry) https://github.com/nodejs/node/pull/51412
  * (SEMVER-MINOR) add server handshake utility (snek) https://github.com/nodejs/node/pull/51172
  * (SEMVER-MINOR) receive customsettings (Marten Richter) https://github.com/nodejs/node/pull/51323
lib:
  * (SEMVER-MINOR) move encodingsMap to internal/util (Joyee Cheung) https://github.com/nodejs/node/pull/51044
sea:
  * (SEMVER-MINOR) support sea.getRawAsset() (Joyee Cheung) https://github.com/nodejs/node/pull/50960
  * (SEMVER-MINOR) support embedding assets (Joyee Cheung) https://github.com/nodejs/node/pull/50960
src:
  * (SEMVER-MINOR) print string content better in BlobDeserializer (Joyee Cheung) https://github.com/nodejs/node/pull/50960
  * (SEMVER-MINOR) support multi-line values for .env file (IlyasShabi) https://github.com/nodejs/node/pull/51289
  * (SEMVER-MINOR) add `process.loadEnvFile` and `util.parseEnv` (Yagiz Nizipli) https://github.com/nodejs/node/pull/51476
  * (SEMVER-MINOR) do not coerce dotenv paths (Tobias Nießen) https://github.com/nodejs/node/pull/51425
stream:
  * (SEMVER-MINOR) implement `min` option for `ReadableStreamBYOBReader.read` (Mattias Buelens) https://github.com/nodejs/node/pull/50888
util:
  * (SEMVER-MINOR) add styleText API to text formatting (Rafael Gonzaga) https://github.com/nodejs/node/pull/51850
vm:
  * (SEMVER-MINOR) support using the default loader to handle dynamic import() (Joyee Cheung) https://github.com/nodejs/node/pull/51244

PR-URL: https://github.com/nodejs/node/pull/51932
2024-03-06 15:35:16 -03:00
Marco Ippolito
edd6190836
doc: deprecate hmac public constructor
PR-URL: https://github.com/nodejs/node/pull/51881
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Adrian Estrada <edsadr@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-03-06 16:00:43 +00:00
Joyee Cheung
d96606d9aa
doc: add stability index to crypto.hash()
PR-URL: https://github.com/nodejs/node/pull/51978
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-03-05 20:12:28 +00:00
Marco Ippolito
a0c466810a
doc: deprecate fs.Stats public constructor
PR-URL: https://github.com/nodejs/node/pull/51879
Refs: https://github.com/nodejs/node/pull/51681
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2024-03-05 13:49:36 +00:00
Moshe Atlow
151d365ad1
fs: expose glob and globSync
PR-URL: https://github.com/nodejs/node/pull/51912
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-03-03 23:15:35 +00:00
Joyee Cheung
7f2d61f82a
v8: implement v8.queryObjects() for memory leak regression testing
This is similar to the `queryObjects()` console API provided by the
Chromium DevTools console. It can be used to search for objects that
have the matching constructor on its prototype chain in the entire
heap, which can be useful for memory leak regression tests. To avoid
surprising results, users should avoid using this API on constructors
whose implementation they don't control, or on constructors that can
be invoked by other parties in the application.

To avoid accidental leaks, this API does not return raw references to
the objects found. By default, it returns the count of the objects
found. If `options.format` is `'summary'`, it returns an array
containing brief string representations for each object. The visibility
provided in this API is similar to what the heap snapshot provides,
while users can save the cost of serialization and parsing and directly
filer the target objects during the search.

We have been using this API internally for the test suite, which
has been more stable than any other leak regression testing
strategies in the CI. With a public implementation we can now
use the public API instead.

PR-URL: https://github.com/nodejs/node/pull/51927
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-03-02 22:11:30 +00:00
Deokjin Kim
9930f114a0
doc: fix actual result of example is different in events
Refs: https://github.com/nodejs/node/pull/50428
PR-URL: https://github.com/nodejs/node/pull/51925
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
2024-03-02 15:35:37 +00:00
Jacob Smith
2e2a848c58
doc,module: clarify hook chain execution sequence
PR-URL: https://github.com/nodejs/node/pull/51884
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2024-03-02 14:33:25 +00:00
Antoine du Hamel
14293814a7
doc: clarify Corepack threat model
PR-URL: https://github.com/nodejs/node/pull/51917
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-03-01 23:02:41 +00:00
Ethan Arrowood
009665fb56
report: add --report-exclude-network option
New option `--report-exclude-network`, also available as
`report.excludeNetwork`, enables the user to exclude
networking interfaces in their diagnostic report.
On some systems, this can cause the report to take minutes
to generate so this option can be used to optimize that.

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

PR-URL: https://github.com/nodejs/node/pull/51645

Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2024-03-01 21:50:04 +00:00
Michał Drobniak
00dc6d9d97
test_runner: improve --test-name-pattern to allow matching single test
Try to match a test by name prefixed with all its ancestors
to ensure uniqueness of the name

Fixes: https://github.com/nodejs/node/issues/46728
PR-URL: https://github.com/nodejs/node/pull/51577
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-03-01 12:58:11 +00:00
Moshe Atlow
aac5ad901d
test_runner: add test:complete event to reflect execution order
PR-URL: https://github.com/nodejs/node/pull/51909
Fixes: https://github.com/nodejs/node/issues/51907
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-03-01 10:08:09 +00:00
Anna Henningsen
40565e90b4
lib: account for cwd access from snapshot serialization cb
Functions registered with `addSerializeCallback()` can access and call
`process.cwd()`. b7d836e2c7 accounted for the fact that it is
necessary to reset the cwd cache after the snapshot builder script has
run, but did not account for possible accesses from serialization
callbacks. To properly account for these, add a deserialization
callback as well.

As a related drive-by fix, also mention the execution order of
callbacks in the documentation.

Refs: https://github.com/nodejs/node/pull/49684
PR-URL: https://github.com/nodejs/node/pull/51901
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-02-29 20:55:00 +00:00
JounQin
2f01f02ac6
doc: remove redundant backquote which breaks sentence
PR-URL: https://github.com/nodejs/node/pull/51904
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
2024-02-28 10:52:11 +00:00
Shrujal Shah
7824a79eba
doc: update guide link for Event Loop
PR-URL: https://github.com/nodejs/node/pull/51874
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-02-27 13:29:59 +00:00
Joyee Cheung
4c46439fe9 crypto: implement crypto.hash()
This patch introduces a helper crypto.hash() that computes
a digest from the input at one shot. This can be 1.2-1.6x faster
than the object-based createHash() for smaller inputs (<= 5MB)
that are readily available (not streamed) and incur less memory
overhead since no intermediate objects will be created.

PR-URL: https://github.com/nodejs/node/pull/51044
Refs: https://github.com/nodejs/performance/issues/136
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
2024-02-27 13:27:19 +01:00
Ameet Kaustav
123dc51c6c
doc: change ExperimentalWarnings to ExperimentalWarning
PR-URL: https://github.com/nodejs/node/pull/51741
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
2024-02-26 13:14:36 +00:00
Rafael Gonzaga
455644582d
util: add styleText API to text formatting
Co-Authored-By: Hemanth HM <hemanth.hm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/51850
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Adrian Estrada <edsadr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
2024-02-26 09:55:57 +00:00
Tobias Nießen
57f9298090 doc,crypto: further clarify RSA_PKCS1_PADDING support
PR-URL: https://github.com/nodejs/node/pull/51799
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-02-20 10:23:54 -05:00
Filip Skokan
fe2299089d
doc,crypto: add changelog and note about disabled RSA_PKCS1_PADDING
PR-URL: https://github.com/nodejs/node/pull/51782
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-02-18 15:04:19 +00:00
Joyee Cheung
ec3040f721
sea: update stability index
The design is relatively stable now and it's more suitable to
describe it as being "in active developement".

PR-URL: https://github.com/nodejs/node/pull/51774
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
2024-02-17 18:03:26 +00:00
Antoine du Hamel
10c6596f6d
doc: fix globals.md introduction
Splitting the introduction sentence in two paragraphs so it's
clearer the list of variables only apply to the second sentence.

PR-URL: https://github.com/nodejs/node/pull/51742
Reviewed-By: Jithil P Ponnan <jithil@outlook.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-02-15 08:30:44 +00:00
Tobias Nießen
6d14352c51 src,deps: disable setuid() etc if io_uring enabled
Within Node.js, attempt to determine if libuv is using io_uring. If it
is, disable process.setuid() and other user identity setters.

We cannot fully prevent users from changing the process's user identity,
but this should still prevent some accidental, dangerous scenarios.

PR-URL: https://github.com/nodejs-private/node-private/pull/528
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
CVE-ID: CVE-2024-22017
2024-02-14 14:27:34 -03:00
Tobias Nießen
42e659cb9d deps: disable io_uring support in libuv by default
setuid() does not affect libuv's internal io_uring operations if
initialized before the call to setuid(). This potentially allows the
process to perform privileged operations despite presumably having
dropped such privileges through a call to setuid(). Similar concerns
apply to other functions that modify the process's user identity.

This commit changes libuv's io_uring behavior from opt-out (through
UV_USE_IO_URING=0) to opt-in (through UV_USE_IO_URING=1) until we figure
out a better long-term solution.

PR-URL: https://github.com/nodejs-private/node-private/pull/528
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
CVE-ID: CVE-2024-22017
2024-02-14 14:27:34 -03:00
RafaelGSS
834ae3785b test,doc: clarify wildcard usage
Follow-up: https://github.com/nodejs/node/pull/51209
PR-URL: https://github.com/nodejs-private/node-private/pull/517
Fixes: https://hackerone.com/bugs?subject=nodejs&report_id=2257156
CVE-ID: CVE-2024-21890
2024-02-14 14:27:34 -03:00
RafaelGSS
b43171c6f6 2024-02-14, Version 21.6.2 (Current)
This is a security release.

Notable changes:

crypto:
  * disable PKCS#1 padding for privateDecrypt (Michael Dawson) https://github.com/nodejs-private/node-private/pull/525
deps:
  * upgrade libuv to 1.48.0 (Santiago Gimeno) https://github.com/nodejs/node/pull/51698
  * disable io_uring support in libuv by default (Tobias Nießen) https://github.com/nodejs-private/node-private/pull/528
fs:
  * protect against modified Buffer internals in possiblyTransformPath (Tobias Nießen) https://github.com/nodejs-private/node-private/pull/497
http:
  * add maximum chunk extension size (Paolo Insogna) https://github.com/nodejs-private/node-private/pull/518
lib:
  * update undici to v5.28.3 (Matteo Collina) https://github.com/nodejs-private/node-private/pull/538
  * use cache fs internals against path traversal (RafaelGSS) https://github.com/nodejs-private/node-private/pull/516
src:
  * fix HasOnly(capability) in node::credentials (Tobias Nießen) https://github.com/nodejs-private/node-private/pull/505
src,deps:
  * disable setuid() etc if io_uring enabled (Tobias Nießen) https://github.com/nodejs-private/node-private/pull/528
test,doc:
  * clarify wildcard usage (RafaelGSS) https://github.com/nodejs-private/node-private/pull/517
zlib:
  * pause stream if outgoing buffer is full (Matteo Collina) https://github.com/nodejs-private/node-private/pull/540

PR-URL: https://github.com/nodejs-private/node-private/pull/543
2024-02-14 14:12:25 -03:00
marco-ippolito
5405aa5b90 2024-02-14, Version 20.11.1 'Iron' (LTS)
This is a security release.

Notable changes:

crypto:
  * disable PKCS#1 padding for privateDecrypt (Michael Dawson) https://github.com/nodejs-private/node-private/pull/525
deps:
  * upgrade libuv to 1.48.0 (Santiago Gimeno) https://github.com/nodejs/node/pull/51699
  * update archs files for openssl-3.0.13+quic1 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/51614
  * upgrade openssl sources to quictls/openssl-3.0.13+quic1 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/51614
  * disable io\_uring support in libuv by default (Tobias Nießen) https://github.com/nodejs-private/node-private/pull/529
  * fix GHSA-f74f-cvh7-c6q6/CVE-2024-24806 (Santiago Gimeno) https://github.com/nodejs/node/pull/51737
fs:
  * protect against modified Buffer internals in possiblyTransformPath (Tobias Nießen) https://github.com/nodejs-private/node-private/pull/49
http:
  * add maximum chunk extension size (Paolo Insogna) https://github.com/nodejs-private/node-private/pull/519
lib:
  * update undici to v5.28.3 (Matteo Collina) https://github.com/nodejs-private/node-private/pull/539
  * use cache fs internals against path traversal (RafaelGSS) https://github.com/nodejs-private/node-private/pull/516
src:
  * fix HasOnly(capability) in node::credentials (Tobias Nießen) https://github.com/nodejs-private/node-private/pull/505
src,deps:
  * disable setuid() etc if io\_uring enabled (Tobias Nießen) https://github.com/nodejs-private/node-private/pull/529
test,doc:
  * clarify wildcard usage (RafaelGSS) https://github.com/nodejs-private/node-private/pull/517
zlib:
  * pause stream if outgoing buffer is full (Matteo Collina) https://github.com/nodejs-private/node-private/pull/541

PR-URL: https://github.com/nodejs-private/node-private/pull/544
2024-02-14 14:10:22 -03:00
marco-ippolito
2a5a150772 2024-02-14, Version 18.19.1 'Hydrogen' (LTS)
This is a security release.

Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/50805
  * disable PKCS#1 padding for privateDecrypt (Michael Dawson) https://github.com/nodejs-private/node-private/pull/525
deps:
  * upgrade npm to 10.2.4 (npm team) https://github.com/nodejs/node/pull/50751
  * update archs files for openssl-3.0.13+quic1 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/51614
  * upgrade openssl sources to quictls/openssl-3.0.13+quic1 (Node.js GitHub Bot) ://github.com/nodejs/node/pull/51614
  * fix GHSA-f74f-cvh7-c6q6/CVE-2024-24806 (Santiago Gimeno) https://github.com/nodejs/node/pull/51614
http:
  * add maximum chunk extension size (Paolo Insogna) https://github.com/nodejs-private/node-private/pull/520
lib:
  * update undici to v5.28.3 (Matteo Collina) https://github.com/nodejs-private/node-private/pull/536
src:
  * fix HasOnly(capability) in node::credentials (Tobias Nießen) https://github.com/nodejs-private/node-private/pull/505
test:
  * skip test-child-process-stdio-reuse-readable-stdio on Windows (Joyee Cheung) https://github.com/nodejs/node/pull/49621
tools:
  * add macOS notarization verification step (Ulises Gascón) https://github.com/nodejs/node/pull/50833
  * use macOS keychain to notarize the releases (Ulises Gascón) https://github.com/nodejs/node/pull/50715
  * remove unused file (Ulises Gascon) https://github.com/nodejs/node/pull/50622
  * add macOS notarization stapler (Ulises Gascón) https://github.com/nodejs/node/pull/50625
  * improve macOS notarization process output readability (Ulises Gascón) https://github.com/nodejs/node/pull/50389
  * remove unused `version` function (Ulises Gascón) https://github.com/nodejs/node/pull/50390
win,tools:
  * upgrade Windows signing to smctl (Stefan Stojanovic) https://github.com/nodejs/node/pull/50956
zlib:
  * pause stream if outgoing buffer is full (Matteo Collina) https://github.com/nodejs-private/node-private/pull/542

PR-URL: https://github.com/nodejs-private/node-private/pull/545
2024-02-14 14:05:41 -03:00
Dmitry Semigradsky
bf39716735
doc: updates for better json generating
PR-URL: https://github.com/nodejs/node/pull/51592
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2024-02-13 21:37:42 +00:00
Aras Abbasi
c975384264
lib: enable WebSocket by default
PR-URL: https://github.com/nodejs/node/pull/51594
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2024-02-04 14:03:39 +00:00
Gabriel Schulhof
5acd42ed9e
doc: fix uncaught exception example
PR-URL: https://github.com/nodejs/node/pull/51638
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
2024-02-03 17:36:37 +00:00
Ognjen Jevremović
9aa211edf5
doc: clarify execution of after hook on test suite completion
The `after` hook now explicitly mentions that it is executed once after
all the tests in a test suite have completed, regardless of whether the
tests passed or failed. This ensures that cleanup tasks or actions
specified in the after hook are guaranteed to run.

Refs: https://github.com/nodejs/node/issues/50901
PR-URL: https://github.com/nodejs/node/pull/51523
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-02-03 06:24:22 +00:00
Joyee Cheung
c307ad7686
sea: support sea.getRawAsset()
This patch adds support for `sea.getRawAsset()` which is
similar to `sea.getAsset()` but returns the raw asset
in an array buffer without copying. Users should avoid
writing to the returned array buffer. If the injected
section is not marked as writable or not aligned,
writing to the raw asset is likely to result in a crash.

PR-URL: https://github.com/nodejs/node/pull/50960
Refs: https://github.com/nodejs/single-executable/issues/68
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2024-02-02 15:25:34 +01:00
Joyee Cheung
ce8f085d26
sea: support embedding assets
With this patch:

Users can now include assets by adding a key-path dictionary
to the configuration as the `assets` field. At build time, Node.js
would read the assets from the specified paths and bundle them into
the preparation blob. In the generated executable, users can retrieve
the assets using the `sea.getAsset()` and `sea.getAssetAsBlob()` API.

```json
{
  "main": "/path/to/bundled/script.js",
  "output": "/path/to/write/the/generated/blob.blob",
  "assets": {
    "a.jpg": "/path/to/a.jpg",
    "b.txt": "/path/to/b.txt"
  }
}
```

The single-executable application can access the assets as follows:

```cjs
const { getAsset } = require('node:sea');
// Returns a copy of the data in an ArrayBuffer
const image = getAsset('a.jpg');
// Returns a string decoded from the asset as UTF8.
const text = getAsset('b.txt', 'utf8');
// Returns a Blob containing the asset.
const blob = getAssetAsBlob('a.jpg');
```

Drive-by: update the  documentation to include a section dedicated
to the injected main script and refer to it as "injected main
script" instead of "injected module" because it's a script, not
a module.

PR-URL: https://github.com/nodejs/node/pull/50960
Refs: https://github.com/nodejs/single-executable/issues/68
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2024-02-02 15:25:34 +01:00
Joyee Cheung
ad0bcb9c02
vm: support using the default loader to handle dynamic import()
This patch adds support for using
`vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER` as
`importModuleDynamically` in all APIs that take the option
except `vm.SourceTextModule`. This allows users to have a shortcut
to support dynamic import() in the compiled code without missing
the compilation cache if they don't need customization of the
loading process. We emit an experimental warning when the
`import()` is actually handled by the default loader through
this option instead of requiring `--experimental-vm-modules`.

In addition this refactors the documentation for
`importModuleDynamically` and adds a dedicated section for it
with examples.

`vm.SourceTextModule` is not supported in this patch because
it needs additional refactoring to handle `initializeImportMeta`,
which can be done in a follow-up.

PR-URL: https://github.com/nodejs/node/pull/51244
Fixes: https://github.com/nodejs/node/issues/51154
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-02-01 11:45:42 +00:00
Antoine du Hamel
3fbe1579ce
esm: improve error when calling import.meta.resolve from data: URL
PR-URL: https://github.com/nodejs/node/pull/49516
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-01-31 23:22:18 +01:00
IlyasShabi
8b2836611e
src: support multi-line values for .env file
PR-URL: https://github.com/nodejs/node/pull/51289
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2024-01-31 13:09:13 +00:00
Duncan Chiu
0f461aad4c
doc: fix dns.lookup and dnsPromises.lookup description
PR-URL: https://github.com/nodejs/node/pull/51517
Fixes: https://github.com/nodejs/node/issues/51482
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-01-30 02:20:39 +01:00
Tobias Nießen
f3fcad2804
doc: note that path.normalize deviates from POSIX
PR-URL: https://github.com/nodejs/node/pull/51513
Refs: https://github.com/nodejs/node/issues/51345
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-01-29 15:45:38 +00:00
Yagiz Nizipli
0056147a87
src: add process.loadEnvFile and util.parseEnv
PR-URL: https://github.com/nodejs/node/pull/51476
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-01-23 18:46:26 +00:00
Kenrick
9a25438a62
doc: fix historical experimental fetch flag
PR-URL: https://github.com/nodejs/node/pull/51506
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-01-20 02:01:31 +00:00
Rafael Gonzaga
e1d3ad4224
doc: fix type of connectionAttempt parameter
PR-URL: https://github.com/nodejs/node/pull/51490
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2024-01-19 16:12:16 +00:00
Ian Kerins
eb4432c12c
doc: remove reference to resolved child_process v8 issue
The linked v8 issue is closed. The NodeJS half of that issue has also
been resolved. While there still may be issues related to
child_process spawn performance, they are not related to this v8 issue.

Refs: https://bugs.chromium.org/p/v8/issues/detail?id=7381
Refs: https://github.com/nodejs/node/pull/48523
Refs: https://github.com/nodejs/performance/issues/138
PR-URL: https://github.com/nodejs/node/pull/51467
Reviewed-By: Keyhan Vakil <kvakil@sylph.kvakil.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-01-18 18:48:45 +00:00
Chengzhong Wu
7cdebc5cb5
doc: add notes on inspector breakpoints
Setting breakpoints with a same-thread inspector session should be
avoided because the program being attached and paused is exactly the
debugger itself. A worker thread inspector session or a debugger
program should be used if breakpoints are needed.

PR-URL: https://github.com/nodejs/node/pull/51417
Fixes: https://github.com/nodejs/node/issues/51397
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-01-18 06:30:33 +00:00
RafaelGSS
e133e5115a 2024-01-15, Version 21.6.0 (Current)
Notable changes:

doc:
  * (SEMVER-MINOR) add documentation for --build-snapshot-config (Anna Henningsen) https://github.com/nodejs/node/pull/50453
lib,src,permission:
  * (SEMVER-MINOR) port path.resolve to C++ (Rafael Gonzaga) https://github.com/nodejs/node/pull/50758
net:
  * (SEMVER-MINOR) add connection attempt events (Paolo Insogna) https://github.com/nodejs/node/pull/51045
src:
  * (SEMVER-MINOR) support configurable snapshot (Joyee Cheung) https://github.com/nodejs/node/pull/50453
src,permission:
  * (SEMVER-MINOR) add --allow-addon flag (Rafael Gonzaga) https://github.com/nodejs/node/pull/51183
timers:
  * (SEMVER-MINOR) export timers.promises (Marco Ippolito) https://github.com/nodejs/node/pull/51246

PR-URL: https://github.com/nodejs/node/pull/51342
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
2024-01-15 11:50:31 -03:00
Marco Ippolito
7496bc4d64
doc: mark isWebAssemblyCompiledModule eol
PR-URL: https://github.com/nodejs/node/pull/51442
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-01-14 12:13:28 +00:00
u9g
ee5cfcb5f7
doc: fix spelling mistake
PR-URL: https://github.com/nodejs/node/pull/51454
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-01-14 09:21:42 +00:00
Tim Perry
c25878d370
http2: add h2 compat support for appendHeader
PR-URL: https://github.com/nodejs/node/pull/51412
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-01-12 16:09:57 +00:00
snek
c50524a9fc
http2: add server handshake utility
PR-URL: https://github.com/nodejs/node/pull/51172
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-01-12 16:09:48 +00:00
Ulises Gascón
2d74e776ca
2024-01-09, Version 20.11.0 'Iron' (LTS)
Notable changes:

crypto:
  * update root certificates to NSS 3.95 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/50805
doc:
  * add MrJithil to collaborators (Jithil P Ponnan) https://github.com/nodejs/node/pull/50666
  * add Ethan-Arrowood as a collaborator (Ethan Arrowood) https://github.com/nodejs/node/pull/50393
esm:
  * (SEMVER-MINOR) add import.meta.dirname and import.meta.filename (James Sumners) https://github.com/nodejs/node/pull/48740
fs:
  * add c++ fast path for writeFileSync utf8 (CanadaHonk) https://github.com/nodejs/node/pull/49884
module:
  * (SEMVER-MINOR) remove useCustomLoadersIfPresent flag (Chengzhong Wu) https://github.com/nodejs/node/pull/48655
  * (SEMVER-MINOR) bootstrap module loaders in shadow realm (Chengzhong Wu) https://github.com/nodejs/node/pull/48655
src:
  * (SEMVER-MINOR) add `--disable-warning` option (Ethan Arrowood) https://github.com/nodejs/node/pull/50661
  * (SEMVER-MINOR) create per isolate proxy env template (Chengzhong Wu) https://github.com/nodejs/node/pull/48655
  * (SEMVER-MINOR) make process binding data weak (Chengzhong Wu) https://github.com/nodejs/node/pull/48655
stream:
  * use Array for Readable buffer (Robert Nagy) https://github.com/nodejs/node/pull/50341
  * optimize creation (Robert Nagy) https://github.com/nodejs/node/pull/50337
test_runner:
  * (SEMVER-MINOR) adds built in lcov reporter (Phil Nash) https://github.com/nodejs/node/pull/50018
  * (SEMVER-MINOR) add Date to the supported mock APIs (Lucas Santos) https://github.com/nodejs/node/pull/48638
test_runner, cli:
  * (SEMVER-MINOR) add --test-timeout flag (Shubham Pandey) https://github.com/nodejs/node/pull/50443

PR-URL: https://github.com/nodejs/node/pull/51124
2024-01-09 20:47:16 +00:00