Node.JSv14

new

mod
今天看到Node Current更新了14的版本,看看都有些什么东西

前置了解了一下doc中提到的semver,是一个语义化版本semantic versioning,实现版本和版本规范的解析,计算,比较,用以解决在大型项目中对依赖的版本失去控制的问题,Node.js 的包管理工具 npm 也完全基于 Semantic Versioning 来管理依赖的版本。

参考资料:semver:语义化版本规范在 Node.js 中的实现

deprecations

sermver弃用一部分功能

  • (SEMVER-MAJOR) crypto: move pbkdf2 without digest to EOL (James M Snell)
  • (SEMVER-MAJOR) fs: deprecate closing FileHandle on garbage collection (James M Snell)
  • (SEMVER-MAJOR) http: move OutboundMessage.prototype.flush to EOL (James M Snell)
  • (SEMVER-MAJOR) lib: move GLOBAL and root aliases to EOL (James M Snell)
  • (SEMVER-MAJOR) os: move tmpDir() to EOL (James M Snell)
  • (SEMVER-MAJOR) src: remove deprecated wasm type check (Clemens Backes)
  • (SEMVER-MAJOR) stream: move _writableState.buffer to EOL (James M Snell)
  • (SEMVER-MINOR) doc: deprecate process.mainModule (Antoine du HAMEL)
  • (SEMVER-MINOR) doc: deprecate process.umask() with no arguments (Colin Ihrig)

ECMAScript Modules

v13 中,需要调用 --experimental-modules 来开启 ESM module 支持, 而且还会有警告,但目前已经移除警告(还是需要手动开启)
仍在实验中,但是其已经非常完善,移除警告迈向了stable的重要一步

New V8 ArrayBuffer API

v8不再支持多个ArrayBuffer指向相同的base address

Toolchain and Compiler Upgrades

//没看懂

  • (SEMVER-MAJOR) build: update macos deployment target to 10.13 for 14.x (AshCripps) #32454
  • (SEMVER-MAJOR) doc: update cross compiler machine for Linux armv7 (Richard Lau) #32812
  • (SEMVER-MAJOR) doc: update Centos/RHEL releases use devtoolset-8 (Richard Lau) #32812
  • (SEMVER-MAJOR) doc: remove SmartOS from official binaries (Richard Lau) #32812
  • (SEMVER-MAJOR) win: block running on EOL Windows versions (João Reis) #31954

It is expected that there will be an ABI mismatch on ARM between the Node.js binary and native addons. Native addons are only broken if they interact with std::shared_ptr. This is expected to be fixed in a later version of Node.js 14.

Update to V8 8.1

Others

  • cli, report: move –report-on-fatalerror to stable (Colin Ihrig)
  • deps: upgrade to libuv 1.37.0 (Colin Ihrig)
  • fs: add fs/promises alias module