Skip to content

Commit

Permalink
2020-02-11, Version 12.16.0 'Erbium' (LTS)
Browse files Browse the repository at this point in the history
Notable changes:

New assert APIs

The `assert` module now provides experimental `assert.match()` and
`assert.doesNotMatch()` methods. They will validate that the first argument is a
string and matches (or does not match) the provided regular expression

This is an experimental feature.

Ruben Bridgewater [#30929](#30929).

Advanced serialization for IPC

The `child_process` and `cluster` modules now support a `serialization` option
to change the serialization mechanism used for IPC. The option can have one of
two values:

* `'json'` (default): `JSON.stringify()` and `JSON.parse()` are used. This is
  how message serialization was done before.
* `'advanced'`: The serialization API of the `v8` module is used. It is based on
  the HTML structured clone algorithm.
  and is able to serialize more built-in JavaScript object types, such as
  `BigInt`, `Map`, `Set` etc. as well as circular data structures.

Anna Henningsen [#30162](#30162).

CLI flags

The new `--trace-exit` CLI flag makes Node.js print a stack trace whenever the
Node.js environment is exited proactively (i.e. by invoking the `process.exit()`
function or pressing Ctrl+C).

legendecas [#30516](#30516).

___

The new `--trace-uncaught` CLI flag makes Node.js print a stack trace at the
time of throwing uncaught exceptions, rather than at the creation of the `Error`
object, if there is any.
This option is not enabled by default because it may affect garbage collection
behavior negatively.

Anna Henningsen [#30025](#30025).

___

The `--disallow-code-generation-from-strings` V8 CLI flag is now whitelisted in
the `NODE_OPTIONS` environment variable.

Shelley Vohr [#30094](#30094).

New crypto APIs

For DSA and ECDSA, a new signature encoding is now supported in addition to the
existing one (DER). The `verify` and `sign` methods accept a `dsaEncoding`
option, which can have one of two values:

* `'der'` (default): DER-encoded ASN.1 signature structure encoding `(r, s)`.
* `'ieee-p1363'`: Signature format `r || s` as proposed in IEEE-P1363.

Tobias Nießen [#29292](#29292).

___

A new method was added to `Hash`: `Hash.prototype.copy`. It makes it possible to
clone the internal state of a `Hash` object into a new `Hash` object, allowing
to compute the digest between updates.

Ben Noordhuis [#29910](#29910).

Dependency updates

libuv was updated to 1.34.0. This includes fixes to `uv_fs_copyfile()` and
`uv_interface_addresses()` and adds two new functions: `uv_sleep()` and
`uv_fs_mkstemp()`.

Colin Ihrig [#30783](#30783).

___

V8 was updated to 7.8.279.23. This includes performance improvements to object
destructuring, RegExp match failures and WebAssembly startup time.
The official release notes are available at https://v8.dev/blog/v8-release-78.

Michaël Zasso [#30109](#30109).

New EventEmitter APIs

The new `EventEmitter.on` static method allows to async iterate over events.

Matteo Collina [#27994](#27994).

___

It is now possible to monitor `'error'` events on an `EventEmitter` without
consuming the emitted error by installing a listener using the symbol
`EventEmitter.errorMonitor`.

Gerhard Stoebich [#30932](#30932).

___

Using `async` functions with event handlers is problematic, because it
can lead to an unhandled rejection in case of a thrown exception.

The experimental `captureRejections` option in the `EventEmitter` constructor or
the global setting change this behavior, installing a
`.then(undefined, handler)` handler on the `Promise`. This handler routes the
exception asynchronously to the `Symbol.for('nodejs.rejection')` method if there
is one, or to the `'error'` event handler if there is none.

Setting `EventEmitter.captureRejections = true` will change the default for all
new instances of `EventEmitter`.

This is an experimental feature.

Matteo Collina [#27867](#27867).

Performance Hooks are no longer experimental

The `perf_hooks` module is now considered a stable API.

legendecas [#31101](#31101).

Introduction of experimental WebAssembly System Interface (WASI) support

A new core module, `wasi`, is introduced to provide an implementation of the
[WebAssembly System Interface](https://wasi.dev/) specification.
WASI gives sandboxed WebAssembly applications access to the
underlying operating system via a collection of POSIX-like functions.

This is an experimental feature.

Colin Ihrig [#30258](#30258).

PR-URL: #31691
  • Loading branch information
MylesBorins authored and targos committed Feb 11, 2020
1 parent fc7b27e commit d20e494
Show file tree
Hide file tree
Showing 24 changed files with 771 additions and 66 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -28,7 +28,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V12.md#12.15.0">12.15.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V12.md#12.16.0">12.16.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V12.md#12.15.0">12.15.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V12.md#12.14.1">12.14.1</a><br/>
<a href="doc/changelogs/CHANGELOG_V12.md#12.14.0">12.14.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V12.md#12.13.1">12.13.1</a><br/>
Expand Down
4 changes: 2 additions & 2 deletions doc/api/assert.md
Expand Up @@ -427,7 +427,7 @@ parameter is an instance of an [`Error`][] then it will be thrown instead of the

## `assert.doesNotMatch(string, regexp[, message])`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

* `string` {string}
Expand Down Expand Up @@ -766,7 +766,7 @@ let err;

## `assert.match(string, regexp[, message])`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

* `string` {string}
Expand Down
6 changes: 3 additions & 3 deletions doc/api/child_process.md
Expand Up @@ -321,7 +321,7 @@ arbitrary command execution.**
<!-- YAML
added: v0.5.0
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30162
description: The `serialization` option is supported now.
- version: v8.0.0
Expand Down Expand Up @@ -392,7 +392,7 @@ The `shell` option available in [`child_process.spawn()`][] is not supported by
<!-- YAML
added: v0.1.90
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30162
description: The `serialization` option is supported now.
- version: v8.8.0
Expand Down Expand Up @@ -1493,7 +1493,7 @@ unavailable.

## Advanced Serialization
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

Child processes support a serialization mechanism for IPC that is based on the
Expand Down
14 changes: 7 additions & 7 deletions doc/api/cli.md
Expand Up @@ -193,7 +193,7 @@ Enable experimental diagnostic report feature.

### `--experimental-specifier-resolution=mode`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

Sets the resolution algorithm for resolving ES module specifiers. Valid options
Expand All @@ -214,7 +214,7 @@ Enable experimental ES Module support in the `vm` module.

### `--experimental-wasi-unstable-preview1`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

Enable experimental WebAssembly System Interface (WASI) support.
Expand Down Expand Up @@ -708,7 +708,7 @@ with crypto support (default).

### `--tls-keylog=file`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

Log TLS key material to a file. The key material is in NSS `SSLKEYLOGFILE`
Expand Down Expand Up @@ -796,7 +796,7 @@ Enables the collection of trace event tracing information.

### `--trace-exit`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

Prints a stack trace whenever an environment is exited proactively,
Expand All @@ -820,7 +820,7 @@ connection problems.

### `--trace-uncaught`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

Print stack traces for uncaught exceptions; usually, the stack trace associated
Expand Down Expand Up @@ -883,7 +883,7 @@ See `SSL_CERT_DIR` and `SSL_CERT_FILE`.

### `--use-largepages=mode`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

Re-map the Node.js static code to large memory pages at startup. If supported on
Expand Down Expand Up @@ -1230,7 +1230,7 @@ to an empty string (`''` or `' '`) disables persistent REPL history.

### `NODE_REPL_EXTERNAL_MODULE=file`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

Path to a Node.js module which will be loaded in place of the built-in REPL.
Expand Down
2 changes: 1 addition & 1 deletion doc/api/cluster.md
Expand Up @@ -724,7 +724,7 @@ values are `'rr'` and `'none'`.
<!-- YAML
added: v0.7.1
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30162
description: The `serialization` option is supported now.
- version: v9.5.0
Expand Down
2 changes: 1 addition & 1 deletion doc/api/crypto.md
Expand Up @@ -1043,7 +1043,7 @@ console.log(hash.digest('hex'));

### `hash.copy([options])`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

* `options` {Object} [`stream.transform` options][]
Expand Down
2 changes: 1 addition & 1 deletion doc/api/deprecations.md
Expand Up @@ -2525,7 +2525,7 @@ an officially supported API.
### DEP0136: `http` `finished`
<!-- YAML
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/28679
description: Documentation-only deprecation.
-->
Expand Down
4 changes: 2 additions & 2 deletions doc/api/dgram.md
Expand Up @@ -125,7 +125,7 @@ if (cluster.isMaster) {

### `socket.addSourceSpecificMembership(sourceAddress, groupAddress[, multicastInterface])`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->
* `sourceAddress` {string}
* `groupAddress` {string}
Expand Down Expand Up @@ -314,7 +314,7 @@ drop membership on all valid interfaces.

### `socket.dropSourceSpecificMembership(sourceAddress, groupAddress[, multicastInterface])`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

* `sourceAddress` {string}
Expand Down
2 changes: 1 addition & 1 deletion doc/api/errors.md
Expand Up @@ -1804,7 +1804,7 @@ connection.
<a id="ERR_TLS_INVALID_CONTEXT">
### ERR_TLS_INVALID_CONTEXT
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

The context must be a `SecureContext`.
Expand Down
12 changes: 6 additions & 6 deletions doc/api/events.md
Expand Up @@ -224,7 +224,7 @@ recommendation is to **not use `async` functions as `'error'` event handlers**.
<!-- YAML
added: v0.1.26
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/27867
description: Added captureRejections option.
-->
Expand Down Expand Up @@ -362,7 +362,7 @@ Its `name` property is set to `'MaxListenersExceededWarning'`.

### `EventEmitter.errorMonitor`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

This symbol shall be used to install a listener for only monitoring `'error'`
Expand Down Expand Up @@ -784,7 +784,7 @@ emitter.emit('log');

### `emitter[Symbol.for('nodejs.rejection')](err, eventName[, ...args])`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

> Stability: 1 - captureRejections is experimental.
Expand Down Expand Up @@ -866,7 +866,7 @@ run();

## events.captureRejections
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

> Stability: 1 - captureRejections is experimental.
Expand All @@ -877,7 +877,7 @@ Change the default `captureRejections` option on all new `EventEmitter` objects.

## events.captureRejectionSymbol
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

> Stability: 1 - captureRejections is experimental.
Expand All @@ -888,7 +888,7 @@ See how to write a custom [rejection handler][rejection].

## events.on(emitter, eventName)
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

* `emitter` {EventEmitter}
Expand Down
12 changes: 6 additions & 6 deletions doc/api/fs.md
Expand Up @@ -2632,7 +2632,7 @@ Functions based on `fs.open()` exhibit this behavior as well:
<!-- YAML
added: v12.12.0
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30114
description: The `bufferSize` option was introduced.
-->
Expand All @@ -2659,7 +2659,7 @@ directory and subsequent read operations.
<!-- YAML
added: v12.12.0
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30114
description: The `bufferSize` option was introduced.
-->
Expand Down Expand Up @@ -3226,7 +3226,7 @@ Synchronous rename(2). Returns `undefined`.
<!-- YAML
added: v0.0.2
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30644
description: The `maxBusyTries` option is renamed to `maxRetries`, and its
default is 0. The `emfileWait` option has been removed, and
Expand Down Expand Up @@ -3279,7 +3279,7 @@ Windows and an `ENOTDIR` error on POSIX.
<!-- YAML
added: v0.1.21
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30644
description: The `maxBusyTries` option is renamed to `maxRetries`, and its
default is 0. The `emfileWait` option has been removed, and
Expand Down Expand Up @@ -4872,7 +4872,7 @@ a colon, Node.js will open a file system stream, as described by
<!-- YAML
added: v12.12.0
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30114
description: The `bufferSize` option was introduced.
-->
Expand Down Expand Up @@ -5018,7 +5018,7 @@ upon success.
<!-- YAML
added: v10.0.0
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30644
description: The `maxBusyTries` option is renamed to `maxRetries`, and its
default is 0. The `emfileWait` option has been removed, and
Expand Down
12 changes: 6 additions & 6 deletions doc/api/http.md
Expand Up @@ -620,7 +620,7 @@ is finished.
### `request.finished`
<!-- YAML
added: v0.0.1
deprecated: REPLACEME
deprecated: v12.16.0
-->

> Stability: 0 - Deprecated. Use [`request.writableEnded`][].
Expand Down Expand Up @@ -699,7 +699,7 @@ request.removeHeader('Content-Type');
### `request.reusedSocket`

<!-- YAML
added: REPLACEME
added: v12.16.0
-->

* {boolean} Whether the request is send through a reused socket.
Expand Down Expand Up @@ -1268,7 +1268,7 @@ See [`response.socket`][].

### `response.cork()`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

See [`writable.cork()`][].
Expand Down Expand Up @@ -1300,7 +1300,7 @@ is finished.
### `response.finished`
<!-- YAML
added: v0.0.2
deprecated: REPLACEME
deprecated: v12.16.0
-->

> Stability: 0 - Deprecated. Use [`response.writableEnded`][].
Expand Down Expand Up @@ -1567,7 +1567,7 @@ status message which was sent out.

### `response.uncork()`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

See [`writable.uncork()`][].
Expand Down Expand Up @@ -1724,7 +1724,7 @@ the request body should be sent.
<!-- YAML
added: v0.1.17
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30135
description: The `readableHighWaterMark` value mirrors that of the socket.
-->
Expand Down
10 changes: 5 additions & 5 deletions doc/api/http2.md
Expand Up @@ -1948,10 +1948,10 @@ error will be thrown.
<!-- YAML
added: v8.4.0
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30534
description: Added `maxSessionRejectedStreams` option with a default of 100.
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30534
description: Added `maxSessionInvalidFrames` option with a default of 1000.
- version: v12.4.0
Expand Down Expand Up @@ -2078,10 +2078,10 @@ server.listen(80);
<!-- YAML
added: v8.4.0
changes:
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30534
description: Added `maxSessionRejectedStreams` option with a default of 100.
- version: REPLACEME
- version: v12.16.0
pr-url: https://github.com/nodejs/node/pull/30534
description: Added `maxSessionInvalidFrames` option with a default of 1000.
- version: v10.12.0
Expand Down Expand Up @@ -3092,7 +3092,7 @@ is finished.
#### `response.finished`
<!-- YAML
added: v8.4.0
deprecated: REPLACEME
deprecated: v12.16.0
-->

> Stability: 0 - Deprecated. Use [`response.writableEnded`][].
Expand Down
2 changes: 1 addition & 1 deletion doc/api/https.md
Expand Up @@ -47,7 +47,7 @@ changes:

#### Event: `'keylog'`
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

* `line` {Buffer} Line of ASCII text, in NSS `SSLKEYLOGFILE` format.
Expand Down
4 changes: 2 additions & 2 deletions doc/api/n-api.md
Expand Up @@ -3235,7 +3235,7 @@ defined in [Section 7.2.14][] of the ECMAScript Language Specification.

### napi_detach_arraybuffer
<!-- YAML
added: REPLACEME
added: v12.16.0
-->

> Stability: 1 - Experimental
Expand All @@ -3261,7 +3261,7 @@ defined in [Section 24.1.1.3][] of the ECMAScript Language Specification.
### napi_is_detached_arraybuffer
<!-- YAML
added: REPLACEME
added: v12.16.0
-->
> Stability: 1 - Experimental
Expand Down

0 comments on commit d20e494

Please sign in to comment.