Skip to content

Commit

Permalink
2022-08-16, Version 18.8.0 (Current)
Browse files Browse the repository at this point in the history
Notable changes:

bootstrap: implement run-time user-land snapshots via --build-snapshot
and --snapshot-blob

This patch introduces `--build-snapshot` and `--snapshot-blob` options
for creating and using user land snapshots.

To generate a snapshot using snapshot.js as an entry point and write
the snapshot blob to snapshot.blob:

```bash
echo "globalThis.foo = 'I am from the snapshot'" > snapshot.js
node --snapshot-blob snapshot.blob --build-snapshot snapshot.js
```

To restore application state from snapshot.blob, with index.js as the
entry point script for the deserialized application:

```bash
echo "console.log(globalThis.foo)" > index.js
node --snapshot-blob snapshot.blob index.js
```

Users can also use the `v8.startupSnapshot` API to specify an entry
point at snapshot building time, thus avoiding the need of an additional
entry script at deserialization time:

```bash
echo "require('v8').startupSnapshot.setDeserializeMainFunction(() => console.log('I am from the snapshot'))" > snapshot.js
node --snapshot-blob snapshot.blob --build-snapshot snapshot.js
node --snapshot-blob snapshot.blob
```

Contributed by Joyee Cheung in #38905

Other notable changes:

* crypto:
  * (SEMVER-MINOR) allow zero-length IKM in HKDF and in webcrypto PBKDF2
  (Filip Skokan) #44201
  * (SEMVER-MINOR) allow zero-length secret KeyObject (Filip Skokan) #44201
* doc:
  * add MoLow to collaborators (Moshe Atlow) #44214
  * add ErickWendel to collaborators (Erick Wendel) #44088
* http:
  * (SEMVER-MINOR) make idle http parser count configurable (theanarkh) #43974
* net:
  * (SEMVER-MINOR) add local family (theanarkh) #43975
* src:
  * (SEMVER-MINOR) add detailed embedder process initialization API (Anna
  Henningsen) #44121
  * (SEMVER-MINOR) print source map error source on demand (Chengzhong
  Wu) #43875
* tls:
  * (SEMVER-MINOR) pass a valid socket on `tlsClientError` (Daeyeon
  Jeong) #44021
* worker:
  * deprecate `--trace-atomics-wait` (Keyhan Vakil) #44093
  • Loading branch information
danielleadams committed Aug 16, 2022
1 parent 96c3373 commit db0b9b6
Show file tree
Hide file tree
Showing 10 changed files with 235 additions and 27 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.7.0">18.7.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V18.md#18.8.0">18.8.0</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.7.0">18.7.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.6.0">18.6.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.5.0">18.5.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V18.md#18.4.0">18.4.0</a><br/>
Expand Down
6 changes: 3 additions & 3 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const callsfunc = tracker.calls(func);
### `tracker.getCalls(fn)`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

* `fn` {Function}.
Expand Down Expand Up @@ -439,7 +439,7 @@ tracker.report();
### `tracker.reset([fn])`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

* `fn` {Function} a tracked function to reset.
Expand Down Expand Up @@ -2092,7 +2092,7 @@ argument gets considered.
## `assert.snapshot(value, name)`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

> Stability: 1 - Experimental
Expand Down
8 changes: 4 additions & 4 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ If this flag is passed, the behavior can still be set to not abort through
### `--build-snapshot`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

> Stability: 1 - Experimental
Expand Down Expand Up @@ -1158,7 +1158,7 @@ The value given must be a power of two.
### `--snapshot-blob=path`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

> Stability: 1 - Experimental
Expand Down Expand Up @@ -1303,7 +1303,7 @@ for TLSv1.2, which is not as secure as TLSv1.3.

<!-- YAML
added: v14.3.0
deprecated: REPLACEME
deprecated: v18.8.0
-->

> Stability: 0 - Deprecated
Expand Down Expand Up @@ -1464,7 +1464,7 @@ loading phase, it will always raise it as an uncaught exception.
### `--update-assert-snapshot`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

Force updating snapshot files for [`assert.snapshot()`][]
Expand Down
6 changes: 3 additions & 3 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -3533,7 +3533,7 @@ and it will be impossible to extract the private key from the returned object.
<!-- YAML
added: v11.6.0
changes:
- version: REPLACEME
- version: v18.8.0
pr-url: https://github.com/nodejs/node/pull/44201
description: The key can now be zero-length.
- version: v15.0.0
Expand Down Expand Up @@ -4203,7 +4203,7 @@ web-compatible code use [`crypto.webcrypto.getRandomValues()`][] instead.
<!-- YAML
added: v15.0.0
changes:
- version: REPLACEME
- version: v18.8.0
pr-url: https://github.com/nodejs/node/pull/44201
description: The input keying material can now be zero-length.
- version: v18.0.0
Expand Down Expand Up @@ -4266,7 +4266,7 @@ hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => {
<!-- YAML
added: v15.0.0
changes:
- version: REPLACEME
- version: v18.8.0
pr-url: https://github.com/nodejs/node/pull/44201
description: The input keying material can now be zero-length.
-->
Expand Down
2 changes: 1 addition & 1 deletion doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3173,7 +3173,7 @@ strings (e.g., '1') are deprecated as parameter in [`process.exit()`][].

<!-- YAML
changes:
- version: REPLACEME
- version: v18.8.0
pr-url: https://github.com/nodejs/node/pull/44093
description: Documentation-only deprecation.
-->
Expand Down
2 changes: 1 addition & 1 deletion doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -3618,7 +3618,7 @@ try {
## `http.setMaxIdleHTTPParsers`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

* {number}
Expand Down
2 changes: 1 addition & 1 deletion doc/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ The numeric representation of the local port. For example, `80` or `21`.
### `socket.localFamily`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

* {string}
Expand Down
20 changes: 10 additions & 10 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ internally.
<!-- YAML
added: v18.0.0
changes:
- version: REPLACEME
- version: v18.8.0
pr-url: https://github.com/nodejs/node/pull/43554
description: Add a `signal` option.
- version: v18.7.0
Expand Down Expand Up @@ -449,7 +449,7 @@ same as [`it([name], { todo: true }[, fn])`][it options].
### `before([, fn][, options])`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

* `fn` {Function|AsyncFunction} The hook function.
Expand Down Expand Up @@ -477,7 +477,7 @@ describe('tests', async () => {
### `after([, fn][, options])`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

* `fn` {Function|AsyncFunction} The hook function.
Expand Down Expand Up @@ -505,7 +505,7 @@ describe('tests', async () => {
### `beforeEach([, fn][, options])`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

* `fn` {Function|AsyncFunction} The hook function.
Expand Down Expand Up @@ -534,7 +534,7 @@ describe('tests', async () => {
### `afterEach([, fn][, options])`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

* `fn` {Function|AsyncFunction} The hook function.
Expand Down Expand Up @@ -573,7 +573,7 @@ exposed as part of the API.
### `context.beforeEach([, fn][, options])`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

* `fn` {Function|AsyncFunction} The hook function. The first argument
Expand Down Expand Up @@ -605,7 +605,7 @@ test('top level test', async (t) => {
### `context.afterEach([, fn][, options])`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

* `fn` {Function|AsyncFunction} The hook function. The first argument
Expand Down Expand Up @@ -655,7 +655,7 @@ test('top level test', (t) => {
### `context.name`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

The name of the test.
Expand Down Expand Up @@ -743,7 +743,7 @@ test('top level test', (t) => {
<!-- YAML
added: v18.0.0
changes:
- version: REPLACEME
- version: v18.8.0
pr-url: https://github.com/nodejs/node/pull/43554
description: Add a `signal` option.
- version: v18.7.0
Expand Down Expand Up @@ -806,7 +806,7 @@ exposed as part of the API.
### `context.name`

<!-- YAML
added: REPLACEME
added: v18.8.0
-->

The name of the suite.
Expand Down
Loading

0 comments on commit db0b9b6

Please sign in to comment.