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) https://github.com/nodejs/node/pull41019
  * (SEMVER-MINOR) add numericSeparator to util.inspect (Ruben Bridgewater) #41003
  * (SEMVER-MINOR) always visualize cause property in errors during inspection (Ruben Bridgewater) https://github.com/nodejs/node/pull41002
* 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 6, 2022
1 parent 1de552c commit 5a6bc1a
Show file tree
Hide file tree
Showing 20 changed files with 505 additions and 48 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ release.
</tr>
<tr>
<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
2 changes: 1 addition & 1 deletion doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ the section on [promise execution tracking][].
### `async_hooks.asyncWrapProviders`
<!-- YAML
added: REPLACEME
added: v16.14.0
-->
* Returns: A map of provider types to the corresponding numeric id.
Expand Down
2 changes: 1 addition & 1 deletion doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ controller.abort();
added: v0.5.0
changes:
- version:
- REPLACEME
- 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
2 changes: 1 addition & 1 deletion doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -2573,7 +2573,7 @@ The SHA-256 fingerprint of this certificate.
### `x509.fingerprint512`

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

* Type: {string}
Expand Down
2 changes: 1 addition & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3008,7 +3008,7 @@ it was an aborted or graceful destroy.

<!-- YAML
changes:
- version: REPLACEME
- version: v16.14.0
pr-url: https://github.com/nodejs/node/pull/40860
description: Documentation-only deprecation.
-->
Expand Down
2 changes: 1 addition & 1 deletion doc/api/diagnostics_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ added:
- v15.1.0
- v14.17.0
changes:
- version: REPLACEME
- version: v16.14.0
pr-url: https://github.com/nodejs/node/pull/40433
description: Added return value. Added to channels without subscribers.
-->
Expand Down
6 changes: 3 additions & 3 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ An attempt was made to construct an object using a non-public constructor.
### `ERR_IMPORT_ASSERTION_TYPE_FAILED`

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

> Stability: 1 - Experimental
Expand Down Expand Up @@ -650,7 +650,7 @@ won't apply to `require` calls; those still follow [CommonJS][] rules.
<!-- YAML
changes:
- version: REPLACEME
- version: v16.14.0
pr-url: https://github.com/nodejs/node/pull/40250
description: Add support for import assertions.
-->
Expand Down
8 changes: 4 additions & 4 deletions doc/api/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ added:
- v13.4.0
- v12.16.0
changes:
- version: REPLACEME
- version: v16.14.0
pr-url: https://github.com/nodejs/node/pull/41267
description: No longer experimental.
-->
Expand Down Expand Up @@ -1028,7 +1028,7 @@ added:
- v13.4.0
- v12.16.0
changes:
- version: REPLACEME
- version: v16.14.0
pr-url: https://github.com/nodejs/node/pull/41267
description: No longer experimental.
-->
Expand All @@ -1044,7 +1044,7 @@ added:
- v13.4.0
- v12.16.0
changes:
- version: REPLACEME
- version: v16.14.0
pr-url: https://github.com/nodejs/node/pull/41267
description: No longer experimental.
-->
Expand Down Expand Up @@ -1172,7 +1172,7 @@ setMaxListeners(5, target, emitter);
## Class: `events.EventEmitterAsyncResource extends EventEmitter`

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

Integrates `EventEmitter` with {AsyncResource} for `EventEmitter`s that
Expand Down
8 changes: 4 additions & 4 deletions doc/api/globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ added:
- v15.0.0
- v14.17.0
changes:
- version: REPLACEME
- version: v16.14.0
pr-url: https://github.com/nodejs/node/pull/40807
description: Added the new optional reason argument.
-->
Expand Down Expand Up @@ -88,7 +88,7 @@ added:
- v15.12.0
- v14.17.0
changes:
- version: REPLACEME
- version: v16.14.0
pr-url: https://github.com/nodejs/node/pull/40807
description: Added the new optional reason argument.
-->
Expand All @@ -101,7 +101,7 @@ Returns a new already aborted `AbortSignal`.
#### Static method: `AbortSignal.timeout(delay)`

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

* Type: {any}
Expand Down
4 changes: 2 additions & 2 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ This API throws a JavaScript `RangeError` with the text provided.
#### `node_api_throw_syntax_error`

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

````c
Expand Down Expand Up @@ -1298,7 +1298,7 @@ This API returns a JavaScript `RangeError` with the text provided.
#### `node_api_create_syntax_error`
<!-- YAML
added: REPLACEME
added: v16.14.0
-->
```c
Expand Down
16 changes: 8 additions & 8 deletions doc/api/perf_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ added: v11.10.0
### `histogram.count`

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

* {Map}
Expand Down Expand Up @@ -1062,7 +1062,7 @@ added: v15.9.0
### `histogram.add(other)`

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

* `other` {RecordableHistogram}
Expand Down
2 changes: 1 addition & 1 deletion doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ previous setting of `process.exitCode`.
## `process.getActiveResourcesInfo()`
<!-- YAML
added: REPLACEME
added: v16.14.0
-->
> Stability: 1 - Experimental
Expand Down
8 changes: 4 additions & 4 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,7 @@ showBoth();
### `readable.map(fn[, options])`

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

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

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

> Stability: 1 - Experimental
Expand Down
4 changes: 2 additions & 2 deletions doc/api/timers.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ const interval = 100;
### `timersPromises.scheduler.wait(delay[, options])`

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

> Stability: 1 - Experimental
Expand Down Expand Up @@ -503,7 +503,7 @@ await scheduler.wait(1000); // Wait one second before continuing
### `timersPromises.scheduler.yield()`

<!-- YAML
added: REPLACEME
added: v16.14.0
-->

> Stability: 1 - Experimental
Expand Down
2 changes: 1 addition & 1 deletion doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ certificate.

<!-- YAML
changes:
- version: REPLACEME
- version: v16.14.0
pr-url: https://github.com/nodejs/node/pull/39809
description: Add fingerprint512.
- version: v11.4.0
Expand Down
4 changes: 2 additions & 2 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ stream.write('With ES6');
<!-- YAML
added: v0.3.0
changes:
- version: REPLACEME
- version: v16.14.0
pr-url: https://github.com/nodejs/node/pull/41003
description: The `numericSeparator` option is supported now.
- version:
Expand Down Expand Up @@ -875,7 +875,7 @@ ignored, if not supported.
<!-- YAML
added: v0.1.97
changes:
- version: REPLACEME
- version: v16.14.0
pr-url: https://github.com/nodejs/node/pull/41019
description: The inspect argument is added for more interoperability.
-->
Expand Down
Loading

0 comments on commit 5a6bc1a

Please sign in to comment.