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:
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:
echo "console.log(globalThis.foo)" > index.js
node --snapshot-blob snapshot.blob index.js
# => I am from the snapshot
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:
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
# => I am from the snapshot
Contributed by Joyee Cheung in #38905
Other notable changes
- crypto:
- deps:
- upgrade npm to 8.18.0 (npm team) #44263 – Adds a new
npm query
command
- upgrade npm to 8.18.0 (npm team) #44263 – Adds a new
- doc:
- http:
- (SEMVER-MINOR) make idle http parser count configurable (theanarkh) #43974
- net:
- (SEMVER-MINOR) add local family (theanarkh) #43975
- src:
- (SEMVER-MINOR) print source map error source on demand (Chengzhong Wu) #43875
- tls:
- (SEMVER-MINOR) pass a valid socket on
tlsClientError
(Daeyeon Jeong) #44021
- (SEMVER-MINOR) pass a valid socket on