Skip to content

Commit

Permalink
2022-02-08, Version 16.14.0 'Gallium' (LTS)
Browse files Browse the repository at this point in the history
Notable changes:

Importing JSON modules now requires experimental import assertions
syntax

This release adds experimental support for the import assertions stage 3
proposal.

To keep Node.js ESM implementation as compatible as possible with the
HTML spec, import assertions are now required to import JSON modules
(still behind the `--experimental-json-modules` CLI flag):

```mjs
import info from './package.json' assert { type: 'json' };
```

Or use dynamic import:

```mjs
const info = await import('./package.json', {
  assert: { type: 'json' }
});
```

Contributed by Antoine du Hamel and Geoffrey Booth #40250

Other notable changes:

* async_hooks:
  * (SEMVER-MINOR) expose async_wrap providers (Rafael Gonzaga) #40760
* child_process:
  * (SEMVER-MINOR) add support for URL to `cp.fork` (Antoine du Hamel) #41225
* doc:
  * add @Mesteery to collaborators (Mestery) #41543
  * add @bnb as a collaborator (Tierney Cyren) #41100
* esm:
  * (SEMVER-MINOR) graduate capturerejections to supported (James M Snell) #41267
  * (SEMVER-MINOR) add EventEmitterAsyncResource to core (James M Snell) #41246
* events:
  * (SEMVER-MINOR) propagate weak option for kNewListener (James M Snell) #40899
* fs:
  * (SEMVER-MINOR) accept URL as argument for `fs.rm` and `fs.rmSync` (Antoine du Hamel) #41132
* lib:
  * (SEMVER-MINOR) make AbortSignal cloneable/transferable (James M Snell) #41050
  * (SEMVER-MINOR) add AbortSignal.timeout (James M Snell) #40899
  * (SEMVER-MINOR) add reason to AbortSignal (James M Snell) #40807
  * (SEMVER-MINOR) add unsubscribe method to non-active DC channels (simon-id) #40433
  * (SEMVER-MINOR) add return value for DC channel.unsubscribe (simon-id) #40433
* loader:
  * (SEMVER-MINOR) return package format from defaultResolve if known (Gabriel Bota) #40980
* perf_hooks:
  * (SEMVER-MINOR) multiple fixes for Histogram (James M Snell) #41153
* process:
  * (SEMVER-MINOR) add `getActiveResourcesInfo()` (Darshan Sen) #40813
* src:
  * (SEMVER-MINOR) add x509.fingerprint512 to crypto module (3nprob) #39809
  * (SEMVER-MINOR) add flags for controlling process behavior (Cheng Zhao) #40339
* stream:
  * (SEMVER-MINOR) add filter method to readable (Benjamin Gruenbaum) #41354
  * (SEMVER-MINOR) add isReadable helper (Robert Nagy) #41199
  * (SEMVER-MINOR) add map method to Readable (Benjamin Gruenbaum) #40815
  * deprecate thenable support (Antoine du Hamel) #40860
* util:
  * (SEMVER-MINOR) pass through the inspect function to custom inspect functions (Ruben Bridgewater) #41019
  * (SEMVER-MINOR) add numericSeparator to util.inspect (Ruben Bridgewater) #41003
  * (SEMVER-MINOR) always visualize cause property in errors during inspection (Ruben Bridgewater) #41002
* timers:
  * (SEMVER-MINOR) add experimental scheduler api (James M Snell) #40909
* v8:
  * (SEMVER-MINOR) multi-tenant promise hook api (Stephen Belanger) #39283

PR-URL: #41804
  • Loading branch information
danielleadams committed Feb 8, 2022
1 parent 08be585 commit 2455b26
Show file tree
Hide file tree
Showing 20 changed files with 593 additions and 45 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -42,7 +42,8 @@ release.
<a href="doc/changelogs/CHANGELOG_V17.md#17.0.0">17.0.0</a><br/>
</td>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V16.md#16.13.2">16.13.2</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V16.md#16.14.0">16.14.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.13.2">16.13.2</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.13.1">16.13.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.13.0">16.13.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V16.md#16.12.0">16.12.0</a><br/>
Expand Down
4 changes: 3 additions & 1 deletion doc/api/async_hooks.md
Expand Up @@ -769,7 +769,9 @@ the section on [promise execution tracking][].
### `async_hooks.asyncWrapProviders`
<!-- YAML
added: v17.2.0
added:
- v17.2.0
- v16.14.0
-->
* Returns: A map of provider types to the corresponding numeric id.
Expand Down
1 change: 1 addition & 0 deletions doc/api/child_process.md
Expand Up @@ -393,6 +393,7 @@ added: v0.5.0
changes:
- version:
- v17.4.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/41225
description: The `modulePath` parameter can be a WHATWG `URL` object using
`file:` protocol.
Expand Down
4 changes: 3 additions & 1 deletion doc/api/crypto.md
Expand Up @@ -2615,7 +2615,9 @@ The SHA-256 fingerprint of this certificate.
### `x509.fingerprint512`

<!-- YAML
added: v17.2.0
added:
- v17.2.0
- v16.14.0
-->

* Type: {string}
Expand Down
4 changes: 3 additions & 1 deletion doc/api/deprecations.md
Expand Up @@ -3016,7 +3016,9 @@ it was an aborted or graceful destroy.

<!-- YAML
changes:
- version: v17.2.0
- version:
- v17.2.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/40860
description: Documentation-only deprecation.
-->
Expand Down
1 change: 1 addition & 0 deletions doc/api/diagnostics_channel.md
Expand Up @@ -267,6 +267,7 @@ added:
changes:
- version:
- v17.1.0
- v16.14.0
- v14.19.0
pr-url: https://github.com/nodejs/node/pull/40433
description: Added return value. Added to channels without subscribers.
Expand Down
12 changes: 9 additions & 3 deletions doc/api/errors.md
Expand Up @@ -1699,7 +1699,9 @@ An attempt was made to construct an object using a non-public constructor.
### `ERR_IMPORT_ASSERTION_TYPE_FAILED`

<!-- YAML
added: v17.1.0
added:
- v17.1.0
- v16.14.0
-->

An import assertion has failed, preventing the specified module to be imported.
Expand All @@ -1709,7 +1711,9 @@ An import assertion has failed, preventing the specified module to be imported.
### `ERR_IMPORT_ASSERTION_TYPE_MISSING`

<!-- YAML
added: v17.1.0
added:
- v17.1.0
- v16.14.0
-->

An import assertion is missing, preventing the specified module to be imported.
Expand All @@ -1719,7 +1723,9 @@ An import assertion is missing, preventing the specified module to be imported.
### `ERR_IMPORT_ASSERTION_TYPE_UNSUPPORTED`

<!-- YAML
added: v17.1.0
added:
- v17.1.0
- v16.14.0
-->

An import assertion is not supported by this version of Node.js.
Expand Down
12 changes: 9 additions & 3 deletions doc/api/esm.md
Expand Up @@ -7,7 +7,9 @@
<!-- YAML
added: v8.5.0
changes:
- version: v17.1.0
- version:
- v17.1.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/40250
description: Add support for import assertions.
- version:
Expand Down Expand Up @@ -226,7 +228,9 @@ import fs from 'node:fs/promises';
## Import assertions

<!-- YAML
added: v17.1.0
added:
- v17.1.0
- v16.14.0
-->

> Stability: 1 - Experimental
Expand Down Expand Up @@ -624,7 +628,9 @@ won't apply to `require` calls; those still follow [CommonJS][] rules.
<!-- YAML
changes:
- version: v17.1.0
- version:
- v17.1.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/40250
description: Add support for import assertions.
-->
Expand Down
16 changes: 12 additions & 4 deletions doc/api/events.md
Expand Up @@ -740,7 +740,9 @@ added:
- v13.4.0
- v12.16.0
changes:
- version: v17.4.0
- version:
- v17.4.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/41267
description: No longer experimental.
-->
Expand Down Expand Up @@ -1029,7 +1031,9 @@ added:
- v13.4.0
- v12.16.0
changes:
- version: v17.4.0
- version:
- v17.4.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/41267
description: No longer experimental.
-->
Expand All @@ -1045,7 +1049,9 @@ added:
- v13.4.0
- v12.16.0
changes:
- version: v17.4.0
- version:
- v17.4.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/41267
description: No longer experimental.
-->
Expand Down Expand Up @@ -1173,7 +1179,9 @@ setMaxListeners(5, target, emitter);
## Class: `events.EventEmitterAsyncResource extends EventEmitter`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

Integrates `EventEmitter` with {AsyncResource} for `EventEmitter`s that
Expand Down
8 changes: 6 additions & 2 deletions doc/api/fs.md
Expand Up @@ -3749,7 +3749,9 @@ with options `{ recursive: true, force: true }`.
<!-- YAML
added: v14.14.0
changes:
- version: v17.3.0
- version:
- v17.3.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/41132
description: The `path` parameter can be a WHATWG `URL` object using `file:`
protocol.
Expand Down Expand Up @@ -5544,7 +5546,9 @@ with options `{ recursive: true, force: true }`.
<!-- YAML
added: v14.14.0
changes:
- version: v17.3.0
- version:
- v17.3.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/41132
description: The `path` parameter can be a WHATWG `URL` object using `file:`
protocol.
Expand Down
16 changes: 12 additions & 4 deletions doc/api/globals.md
Expand Up @@ -53,7 +53,9 @@ added:
- v15.0.0
- v14.17.0
changes:
- version: v17.2.0
- version:
- v17.2.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/40807
description: Added the new optional reason argument.
-->
Expand Down Expand Up @@ -94,7 +96,9 @@ added:
- v15.12.0
- v14.17.0
changes:
- version: v17.2.0
- version:
- v17.2.0
- v16.14.0
pr-url: https://github.com/nodejs/node/pull/40807
description: Added the new optional reason argument.
-->
Expand All @@ -107,7 +111,9 @@ Returns a new already aborted `AbortSignal`.
#### Static method: `AbortSignal.timeout(delay)`

<!-- YAML
added: v17.3.0
added:
- v17.3.0
- v16.14.0
-->

* `delay` {number} The number of milliseconds to wait before triggering
Expand Down Expand Up @@ -178,7 +184,9 @@ when the `abortController.abort()` function has been called.
#### `abortSignal.reason`

<!-- YAML
added: v17.2.0
added:
- v17.2.0
- v16.14.0
-->

* Type: {any}
Expand Down
8 changes: 6 additions & 2 deletions doc/api/n-api.md
Expand Up @@ -1182,7 +1182,9 @@ This API throws a JavaScript `RangeError` with the text provided.
#### `node_api_throw_syntax_error`

<!-- YAML
added: v17.2.0
added:
- v17.2.0
- v16.14.0
-->

````c
Expand Down Expand Up @@ -1298,7 +1300,9 @@ This API returns a JavaScript `RangeError` with the text provided.
#### `node_api_create_syntax_error`
<!-- YAML
added: v17.2.0
added:
- v17.2.0
- v16.14.0
-->
```c
Expand Down
32 changes: 24 additions & 8 deletions doc/api/perf_hooks.md
Expand Up @@ -880,7 +880,9 @@ added: v11.10.0
### `histogram.count`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

* {number}
Expand All @@ -890,7 +892,9 @@ The number of samples recorded by the histogram.
### `histogram.countBigInt`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

* {bigint}
Expand All @@ -911,7 +915,9 @@ loop delay threshold.
### `histogram.exceedsBigInt`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

* {bigint}
Expand All @@ -932,7 +938,9 @@ The maximum recorded event loop delay.
### `histogram.maxBigInt`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

* {bigint}
Expand Down Expand Up @@ -962,7 +970,9 @@ The minimum recorded event loop delay.
### `histogram.minBigInt`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

* {bigint}
Expand All @@ -983,7 +993,9 @@ Returns the value at the given percentile.
### `histogram.percentileBigInt(percentile)`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

* `percentile` {number} A percentile value in the range (0, 100).
Expand All @@ -1004,7 +1016,9 @@ Returns a `Map` object detailing the accumulated percentile distribution.
### `histogram.percentilesBigInt`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

* {Map}
Expand Down Expand Up @@ -1072,7 +1086,9 @@ added:
### `histogram.add(other)`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

* `other` {RecordableHistogram}
Expand Down
4 changes: 3 additions & 1 deletion doc/api/process.md
Expand Up @@ -1830,7 +1830,9 @@ previous setting of `process.exitCode`.
## `process.getActiveResourcesInfo()`
<!-- YAML
added: v17.3.0
added:
- v17.3.0
- v16.14.0
-->
> Stability: 1 - Experimental
Expand Down
16 changes: 12 additions & 4 deletions doc/api/stream.md
Expand Up @@ -1740,7 +1740,9 @@ showBoth();
### `readable.map(fn[, options])`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

> Stability: 1 - Experimental
Expand Down Expand Up @@ -1785,7 +1787,9 @@ for await (const result of dnsResults) {
### `readable.filter(fn[, options])`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

> Stability: 1 - Experimental
Expand Down Expand Up @@ -2754,7 +2758,9 @@ Returns whether the stream has been read from or cancelled.
### `stream.isErrored(stream)`

<!-- YAML
added: v17.3.0
added:
- v17.3.0
- v16.14.0
-->

> Stability: 1 - Experimental
Expand All @@ -2767,7 +2773,9 @@ Returns whether the stream has encountered an error.
### `stream.isReadable(stream)`

<!-- YAML
added: v17.4.0
added:
- v17.4.0
- v16.14.0
-->

> Stability: 1 - Experimental
Expand Down

0 comments on commit 2455b26

Please sign in to comment.