Rafael Gonzaga
478ca18fd7
doc: update to semver-minor releases by default
...
PR-URL: https://github.com/nodejs/node/pull/49175
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Ruy Adorno <ruyadorno@google.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-08-17 19:23:25 +00:00
Tobias Nießen
c4bbf0a094
doc: fix wording in napi_async_init
...
Refs: https://github.com/nodejs/node/pull/32930
PR-URL: https://github.com/nodejs/node/pull/49180
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Michael Dawson <midawson@redhat.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-08-17 19:05:44 +00:00
Carlos Espa
413c16e490
src,permission: add multiple allow-fs-* flags
...
Support for a single comma separates list for allow-fs-* flags is
removed. Instead now multiple flags can be passed to allow multiple
paths.
Fixes: https://github.com/nodejs/security-wg/issues/1039
PR-URL: https://github.com/nodejs/node/pull/49047
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2023-08-17 18:39:04 +00:00
Yagiz Nizipli
769823e57c
src: add built-in .env file support
...
PR-URL: https://github.com/nodejs/node/pull/48890
Refs: https://github.com/orgs/nodejs/discussions/44975
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
2023-08-17 14:08:05 +00:00
翠 / green
6bb400f8ec
lib: add api to detect whether source-maps are enabled
...
Add `process.sourceMapsEnabled` to detect
whether source-maps are enabled.
Fixes: https://github.com/nodejs/node/issues/46304
PR-URL: https://github.com/nodejs/node/pull/46391
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2023-08-17 08:42:12 +00:00
Node.js GitHub Bot
c9b1d6c84b
deps: update simdutf to 3.2.17
...
PR-URL: https://github.com/nodejs/node/pull/49019
Fixes: https://github.com/nodejs/node/issues/48995
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
2023-08-16 20:42:47 +02:00
Jungku Lee
9a2e6bca4f
doc: add print results for examples in WebStreams
...
PR-URL: https://github.com/nodejs/node/pull/49143
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-08-15 16:41:14 +00:00
Node.js GitHub Bot
802c52fb8b
deps: update googletest to 7e33b6a
...
PR-URL: https://github.com/nodejs/node/pull/49034
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
2023-08-15 07:02:41 +02:00
Deokjin Kim
4b486e5e28
doc: fix Type notation in webstreams
...
Replace `type` with `Type: {Promise}`. Plus, fix incorrect
verb(`creates` -> `returns`) in description.
PR-URL: https://github.com/nodejs/node/pull/49121
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2023-08-14 22:40:02 +00:00
Node.js GitHub Bot
8aff50413a
deps: update zlib to 1.2.13.1-motley-526382e
...
PR-URL: https://github.com/nodejs/node/pull/49033
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
2023-08-14 19:48:56 +02:00
Antoine du Hamel
52b3007f89
doc: fix name of the flag in initialize() docs
...
PR-URL: https://github.com/nodejs/node/pull/49158
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2023-08-14 11:42:30 +00:00
Rafael Gonzaga
de4553f3d1
doc: make the NODE_VERSION_IS_RELEASE revert clear
...
PR-URL: https://github.com/nodejs/node/pull/49114
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-08-13 22:48:34 +00:00
Guy Bedford
ee8b7f1f18
esm: unflag import.meta.resolve
...
PR-URL: https://github.com/nodejs/node/pull/49028
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
2023-08-13 05:42:25 +00:00
Antoine du Hamel
3d20582c0f
module: make CJS load from ESM loader
...
PR-URL: https://github.com/nodejs/node/pull/47999
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
2023-08-13 04:23:05 +00:00
Node.js GitHub Bot
8358ce4486
deps: update undici to 5.23.0
...
PR-URL: https://github.com/nodejs/node/pull/49021
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2023-08-12 18:28:48 +00:00
Tobias Nießen
e117f16e09
doc: update process.binding deprecation text
...
As part of the recent security release, 4aa0eff7 updated the
documentation but bd7443ad did not.
PR-URL: https://github.com/nodejs/node/pull/49086
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-08-11 19:13:59 +00:00
Rafael Gonzaga
c00dfc8e33
doc: update with latest security release
...
PR-URL: https://github.com/nodejs/node/pull/49085
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-08-11 18:46:57 +00:00
cjihrig
4e61c22699
test_runner: expose location of tests
...
This commit adds each test's line and column number to the reporter
output. This will aid in debugging test suite failures when error
stacks are not helpful, test suites are large, or tests have the
same name. This data is also exposed on the spec reporter.
This commit also replaces the filename that was previously being
reported, with the filename where the test actually exists. These
are normally correct, but could be wrong if tests were run from
a file other than the user's entrypoint.
PR-URL: https://github.com/nodejs/node/pull/48975
Fixes: https://github.com/nodejs/node/issues/48457
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-08-11 09:12:49 -04:00
Rich Trott
f1b3ade948
doc: add missing period
...
PR-URL: https://github.com/nodejs/node/pull/49094
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2023-08-10 15:37:10 +00:00
btea
48c613e5a7
doc: add ESM examples in http.md
...
PR-URL: https://github.com/nodejs/node/pull/47763
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-08-10 14:44:32 +02:00
Tobias Nießen
4aa0eff787
policy: disable process.binding() when enabled
...
process.binding() can be used to trivially bypass restrictions imposed
through a policy. Since the function is deprecated already, simply
replace it with a stub when a policy is being enabled.
Fixes: https://hackerone.com/bugs?report_id=1946470
PR-URL: https://github.com/nodejs-private/node-private/pull/397
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
CVE-ID: CVE-2023-32559
2023-08-09 14:29:06 -03:00
RafaelGSS
ae25da20fa
2023-08-09, Version 20.5.1 (Current)
...
This is a security release.
Notable changes:
* CVE-2023-32002: Policies can be bypassed via Module.\_load (High)
* CVE-2023-32558: process.binding() can bypass the permission model through path traversal (High)
* CVE-2023-32004: Permission model can be bypassed by specifying a path traversal sequence in a Buffer (High)
* CVE-2023-32006: Policies can be bypassed by module.constructor.createRequire (Medium)
* CVE-2023-32559: Policies can be bypassed via process.binding (Medium)
* CVE-2023-32005: fs.statfs can bypass the permission model (Low)
* CVE-2023-32003: fs.mkdtemp() and fs.mkdtempSync() can bypass the permission model (Low)
* OpenSSL Security Releases
* https://mta.openssl.org/pipermail/openssl-announce/2023-July/000264.html
* https://mta.openssl.org/pipermail/openssl-announce/2023-July/000265.html
* https://mta.openssl.org/pipermail/openssl-announce/2023-July/000267.html
PR-URL: https://github.com/nodejs-private/node-private/pull/465
2023-08-09 14:24:18 -03:00
RafaelGSS
6d46d986a4
2023-08-09, Version 18.17.1 'Hydrogen' (LTS)
...
Notable changes:
Following CVEs are fixed in this release:
* CVE-2023-32002: Policies can be bypassed via Module._load (High)
* CVE-2023-32006: Policies can be bypassed by module.constructor.createRequire (Medium)
* CVE-2023-32559: Policies can be bypassed via process.binding (Medium)
* OpenSSL Security Releases
* https://mta.openssl.org/pipermail/openssl-announce/2023-July/000264.html
* https://mta.openssl.org/pipermail/openssl-announce/2023-July/000265.html
* https://mta.openssl.org/pipermail/openssl-announce/2023-July/000267.html
PR-URL: https://github.com/nodejs-private/node-private/pull/463
2023-08-09 14:02:22 -03:00
RafaelGSS
eed21991fb
2023-08-09, Version 16.20.2 'Gallium' (LTS)
...
This is a security release.
Notable changes:
Following CVEs are fixed in this release:
* CVE-2023-32002: Policies can be bypassed via Module._load (High)
* CVE-2023-32006: Policies can be bypassed by module.constructor.createRequire (Medium)
* CVE-2023-32559: Policies can be bypassed via process.binding (Medium)
* OpenSSL Security Releases
* https://mta.openssl.org/pipermail/openssl-announce/2023-July/000264.html
* https://mta.openssl.org/pipermail/openssl-announce/2023-July/000265.html
* https://mta.openssl.org/pipermail/openssl-announce/2023-July/000267.html
PR-URL: https://github.com/nodejs-private/node-private/pull/458
2023-08-09 13:36:10 -03:00
Ray
6432060c7c
doc: detailed description of keystrokes Ctrl-Y and Meta-Y
...
PR-URL: https://github.com/nodejs/node/pull/43529
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-08-08 19:51:43 +00:00
Phil Nash
1cfd61b632
doc: add "type" to test runner event details
...
In version 20.0.0 (and backported to 19.9.0 and 18.7.0) the test runner
started reporting on whether a test was a suite. This was exposed to
reporters in the `details` object of a `test:pass` or `test:fail` event
but this hasn't been documented. This adds the `type` property to both
event's `details` object.
PR-URL: https://github.com/nodejs/node/pull/49014
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2023-08-08 18:43:42 +00:00
David Sanders
718fc0d011
doc: reserve 118 for Electron 27
...
Signed-off-by: David Sanders <dsanders11@ucsbalum.com >
PR-URL: https://github.com/nodejs/node/pull/49023
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <rlau@redhat.com >
2023-08-08 18:36:13 +00:00
Daeyeon Jeong
d150316a8e
doc: clarify use of process.env in worker threads on Windows
...
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/49008
Fixes: https://github.com/nodejs/node/issues/48955
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2023-08-05 15:26:19 +00:00
Rafael Gonzaga
107600923d
doc: remove v14 mention
...
PR-URL: https://github.com/nodejs/node/pull/49005
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-08-05 13:30:58 +00:00
Izaak Schroeder
6ad8318373
esm: add initialize hook, integrate with register
...
Follows @giltayar's proposed API:
> `register` can pass any data it wants to the loader, which will be
passed to the exported `initialize` function of the loader.
Additionally, if the user of `register` wants to communicate with the
loader, it can just create a `MessageChannel` and pass the port to the
loader as data.
The `register` API is now:
```ts
interface Options {
parentUrl?: string;
data?: any;
transferList?: any[];
}
function register(loader: string, parentUrl?: string): any;
function register(loader: string, options?: Options): any;
```
This API is backwards compatible with the old one (new arguments are
optional and at the end) and allows for passing data into the new
`initialize` hook. If this hook returns data it is passed back to
`register`:
```ts
function initialize(data: any): Promise<any>;
```
**NOTE**: Currently there is no mechanism for a loader to exchange
ownership of something back to the caller.
Refs: https://github.com/nodejs/loaders/issues/147
PR-URL: https://github.com/nodejs/node/pull/48842
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2023-08-03 05:10:59 +00:00
Rafael Gonzaga
fb47afc335
doc: drop github actions check in sec release process
...
PR-URL: https://github.com/nodejs/node/pull/48978
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2023-08-02 13:14:28 +00:00
Node.js GitHub Bot
1fea67cbed
deps: update googletest to c875c4e
...
PR-URL: https://github.com/nodejs/node/pull/48964
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2023-08-01 00:30:05 +00:00
Matteo Bianchi
8f0f17e1e3
doc: improved joinDuplicateHeaders definition
...
PR-URL: https://github.com/nodejs/node/pull/48859
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-07-28 10:47:29 +00:00
Deokjin Kim
761f5681c8
doc: fix second parameter name of events.addAbortListener
...
Second parameter name is described as `listener`(not resource)
in below line.
PR-URL: https://github.com/nodejs/node/pull/48922
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2023-07-27 15:10:48 +00:00
Chemi Atlow
857774029c
doc: add new reporter events to custom reporter examples
...
Fixes: https://github.com/nodejs/node/issues/48894
PR-URL: https://github.com/nodejs/node/pull/48903
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-07-26 13:15:24 +00:00
LiviaMedeiros
6bef80a50b
fs: make mkdtemp accept buffers and URL
...
PR-URL: https://github.com/nodejs/node/pull/48828
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2023-07-26 19:32:31 +08:00
Darshan Sen
6cd678965f
sea: add support for V8 bytecode-only caching
...
Refs: https://github.com/nodejs/single-executable/issues/73
Signed-off-by: Darshan Sen <raisinten@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/48191
Fixes: https://github.com/nodejs/single-executable/issues/73
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2023-07-26 10:10:35 +00:00
Node.js GitHub Bot
c8c1f8a295
deps: update ada to 2.6.0
...
PR-URL: https://github.com/nodejs/node/pull/48896
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
2023-07-25 19:33:01 +00:00
Ardi_Nugraha
71165e111a
doc: change duration to duration_ms on test documentation
...
PR-URL: https://github.com/nodejs/node/pull/48892
Fixes: https://github.com/nodejs/node/issues/48887
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2023-07-25 13:34:16 +00:00
Guido Penta
36c72c8b2f
doc: improve requireHostHeader
...
PR-URL: https://github.com/nodejs/node/pull/48860
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-07-25 07:19:44 +00:00
Michael Dawson
5cbf73ec9c
doc: add ver of 18.x where Node-api 9 is supported
...
Signed-off-by: Michael Dawson <mdawson@devrus.com >
PR-URL: https://github.com/nodejs/node/pull/48876
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2023-07-24 19:44:26 +00:00
Ethan Arrowood
6c08b1fc02
test_runner: fix test_runner test:fail event type
...
PR-URL: https://github.com/nodejs/node/pull/48854
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2023-07-22 16:02:40 +00:00
Joyee Cheung
ac34e7561a
src: support snapshot in single executable applications
...
This patch adds snapshot support to single executable applications.
To build a snapshot from the main script when preparing the
blob that will be injected into the single executable application,
add `"useSnapshot": true` to the configuration passed to
`--experimental-sea-config`. For example:
```
{
"main": "snapshot.js",
"output": "sea-prep.blob",
"useSnapshot": true
}
```
The main script used to build the snapshot must invoke
`v8.startupSnapshot.setDeserializeMainFunction()` to configure the
entry point. The generated startup snapshot would be part of the
preparation blob and get injected into the final executable.
When the single executable application is launched, instead of running
the `main` script from scratch, Node.js would instead deserialize the
snapshot to get to the state initialized during build-time directly.
PR-URL: https://github.com/nodejs/node/pull/46824
Refs: https://github.com/nodejs/single-executable/discussions/57
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
2023-07-20 22:57:00 +00:00
Juan José Arboleda
d5761a4f8e
2023-07-18, Version 20.5.0 (Current)
...
Notable changes:
doc:
* add atlowChemi to collaborators (atlowChemi) https://github.com/nodejs/node/pull/48757
events:
* (SEMVER-MINOR) allow safely adding listener to abortSignal (Chemi Atlow) https://github.com/nodejs/node/pull/48596
fs:
* add a fast-path for readFileSync utf-8 (Yagiz Nizipli) https://github.com/nodejs/node/pull/48658
test_runner:
* (SEMVER-MINOR) add shards support (Raz Luvaton) https://github.com/nodejs/node/pull/48639
PR-URL: https://github.com/nodejs/node/pull/48761
2023-07-20 16:28:46 -05:00
Node.js GitHub Bot
01c8576a24
deps: update zlib to 1.2.13.1-motley-61dc0bd
...
PR-URL: https://github.com/nodejs/node/pull/48788
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
2023-07-20 20:00:23 +00:00
Izaak Schroeder
a2fc4a383e
esm: unflag Module.register and allow nested loader import()
...
Major functional changes:
- Allow `import()` to work within loaders that require other loaders,
- Unflag the use of `Module.register`.
A new interface `Customizations` has been created in order to unify
`ModuleLoader` (previously `DefaultModuleLoader`), `Hooks` and
`CustomizedModuleLoader` all of which now implement it:
```ts
interface LoadResult {
format: ModuleFormat;
source: ModuleSource;
}
interface ResolveResult {
format: string;
url: URL['href'];
}
interface Customizations {
allowImportMetaResolve: boolean;
load(url: string, context: object): Promise<LoadResult>
resolve(
originalSpecifier:
string, parentURL: string,
importAssertions: Record<string, string>
): Promise<ResolveResult>
resolveSync(
originalSpecifier:
string, parentURL: string,
importAssertions: Record<string, string>
) ResolveResult;
register(specifier: string, parentUrl: string): any;
forceLoadHooks(): void;
importMetaInitialize(meta, context, loader): void;
}
```
The `ModuleLoader` class now has `setCustomizations` which takes an
object of this shape and delegates its responsibilities to this object
if present.
Note that two properties `allowImportMetaResolve` and `resolveSync`
exist now as a mechanism for `import.meta.resolve` – since `Hooks`
does not implement `resolveSync` other loaders cannot use
`import.meta.resolve`; `allowImportMetaResolve` is a way of checking
for that case instead of invoking `resolveSync` and erroring.
Fixes https://github.com/nodejs/node/issues/48515
Closes https://github.com/nodejs/node/pull/48439
PR-URL: https://github.com/nodejs/node/pull/48559
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com >
2023-07-19 10:33:47 +00:00
Michael Dawson
38cc538453
doc: refactor node-api support matrix
...
- refactor table so that it does not grow for
every new version of Node.js
- refer to latest version of table as the canonical
reference
- add info for Node-API v9
Refs: https://github.com/nodejs/node/issues/48277
Signed-off-by: Michael Dawson <mdawson@devrus.com >
PR-URL: https://github.com/nodejs/node/pull/48774
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-07-19 00:06:45 +00:00
Deokjin Kim
77ea1732a1
doc: declare path on example of async_hooks.executionAsyncId()
...
Example is not runnable because `path` is used, but it's not
declared.
PR-URL: https://github.com/nodejs/node/pull/48556
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2023-07-18 20:00:50 +00:00
Danielle Adams
51513b23e8
2023-07-18, Version 18.17.0 'Hydrogen' (LTS)
...
Notable changes:
Ada 2.0
Node.js v18.17.0 comes with the latest version of the URL parser, Ada. This
update brings significant performance improvements to URL parsing, including
enhancements to the url.domainToASCII and url.domainToUnicode functions
in node:url.
Ada 2.0 has been integrated into the Node.js codebase, ensuring that all
parts of the application can benefit from the improved performance. Additionally,
Ada 2.0 features a significant performance boost over its predecessor, Ada 1.0.4,
while also eliminating the need for the ICU requirement for URL hostname parsing.
Contributed by Yagiz Nizipli and Daniel Lemire in https://github.com/nodejs/node/pull/47339
Web Crypto API
Web Crypto API functions' arguments are now coerced and validated as per
their WebIDL definitions like in other Web Crypto API implementations. This
further improves interoperability with other implementations of Web Crypto API.
Contributed by Filip Skokan in https://github.com/nodejs/node/pull/46067
crypto:
* update root certificates to NSS 3.89 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/47659
dns:
* (SEMVER-MINOR) expose getDefaultResultOrder (btea) https://github.com/nodejs/node/pull/46973
doc:
* add ovflowd to collaborators (Claudio Wunder) https://github.com/nodejs/node/pull/47844
* add KhafraDev to collaborators (Matthew Aitken) https://github.com/nodejs/node/pull/47510
* events:
* (SEMVER-MINOR) add getMaxListeners method (Matthew Aitken) https://github.com/nodejs/node/pull/47039
fs:
* (SEMVER-MINOR) add support for mode flag to specify the copy behavior (Tetsuharu Ohzeki) https://github.com/nodejs/node/pull/47084
* (SEMVER-MINOR) add recursive option to readdir and opendir (Ethan Arrowood) https://github.com/nodejs/node/pull/41439
* (SEMVER-MINOR) add support for mode flag to specify the copy behavior (Tetsuharu Ohzeki) https://github.com/nodejs/node/pull/47084
* (SEMVER-MINOR) implement byob mode for readableWebStream() (Debadree Chatterjee) https://github.com/nodejs/node/pull/46933
http:
* (SEMVER-MINOR) prevent writing to the body when not allowed by HTTP spec (Gerrard Lindsay) https://github.com/nodejs/node/pull/47732
* (SEMVER-MINOR) remove internal error in assignSocket (Matteo Collina) https://github.com/nodejs/node/pull/47723
* (SEMVER-MINOR) add highWaterMark opt in http.createServer (HinataKah0) https://github.com/nodejs/node/pull/47405
lib:
* (SEMVER-MINOR) add webstreams to Duplex.from() (Debadree Chatterjee) https://github.com/nodejs/node/pull/46190
* (SEMVER-MINOR) implement AbortSignal.any() (Chemi Atlow) https://github.com/nodejs/node/pull/47821
module:
* change default resolver to not throw on unknown scheme (Gil Tayar) https://github.com/nodejs/node/pull/47824
node-api:
* (SEMVER-MINOR) define version 9 (Chengzhong Wu) https://github.com/nodejs/node/pull/48151
* (SEMVER-MINOR) deprecate napi_module_register (Vladimir Morozov) https://github.com/nodejs/node/pull/46319
stream:
* (SEMVER-MINOR) preserve object mode in compose (Raz Luvaton) https://github.com/nodejs/node/pull/47413
* (SEMVER-MINOR) add setter & getter for default highWaterMark (#46929 ) (Robert Nagy) https://github.com/nodejs/node/pull/46929
test:
* unflake test-vm-timeout-escape-nexttick (Santiago Gimeno) https://github.com/nodejs/node/pull/48078
test_runner:
* (SEMVER-MINOR) add shorthands to `test` (Chemi Atlow) https://github.com/nodejs/node/pull/47909
* (SEMVER-MINOR) support combining coverage reports (Colin Ihrig) https://github.com/nodejs/node/pull/47686
* (SEMVER-MINOR) execute before hook on test (Chemi Atlow) https://github.com/nodejs/node/pull/47586
* (SEMVER-MINOR) expose reporter for use in run api (Chemi Atlow) https://github.com/nodejs/node/pull/47238
tools:
* update LICENSE and license-builder.sh (Santiago Gimeno) https://github.com/nodejs/node/pull/48078
url:
* (SEMVER-MINOR) implement URL.canParse (Matthew Aitken) https://github.com/nodejs/node/pull/47179
wasi:
* (SEMVER-MINOR) no longer require flag to enable wasi (Michael Dawson) https://github.com/nodejs/node/pull/47286
PR-URL: https://github.com/nodejs/node/pull/48694
2023-07-18 15:37:22 -04:00
Debadree Chatterjee
b361ad72ce
stream: implement ReadableStream.from
...
Fixes: https://github.com/nodejs/node/issues/48389
PR-URL: https://github.com/nodejs/node/pull/48395
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-07-18 09:50:22 +00:00