Skip to main content

Electron 16.0.0

· 8 min read

Electron 16.0.0 已经发布!它包括对 Chromium 96、V8 9.6 和 Node.js 16.9.1 的升级。请往下阅读了解更多详情!

🌐 Electron 16.0.0 has been released! It includes upgrades to Chromium 96, V8 9.6, and Node.js 16.9.1. Read below for more details!


Electron 团队很高兴宣布发布 Electron 16.0.0!你可以通过 npm 使用 npm install electron@latest 安装,或者从我们的 发布网站 下载。继续阅读以了解此版本的详细信息,并请分享你的任何反馈意见!

🌐 The Electron team is excited to announce the release of Electron 16.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. Continue reading for details about this release and please share any feedback you have!

Electron 发布节奏变更

🌐 Electron Release Cadence Change

从 Electron 15 开始,Electron 将每 8 周发布一个新的主要稳定版本。你可以在这里阅读完整详情。

🌐 As of Electron 15, Electron will release a new major stable version every 8 weeks. You can read the full details here.

此外,Electron 将支持的版本范围从最新的三个版本改为截至 2022 年 5 月的最新四个版本。查看我们的版本控制文档以获取有关 Electron 版本控制的详细信息。在 2022 年 5 月之后,我们将恢复支持最新的三个版本。

🌐 Additionally, Electron has changed supported versions from latest three versions to latest four versions until May 2022. See our versioning document for more detailed information about versioning in Electron. After May 2022, we will return to supporting latest three versions.

显著变化

🌐 Notable Changes

  • 现在支持 WebHID API。 #30213
  • app.requestSingleInstanceLock 添加数据参数,以便在实例之间共享数据。#30891
  • 将 securityOrigin 传递给媒体权限请求处理程序。#31357
  • 添加 commandLine.removeSwitch#30933

请查看 16.0.0 发布说明 以获取所有新功能和更改的完整列表。

🌐 See the 16.0.0 release notes for a full list of new features and changes.

技术栈变更

🌐 Stack Changes

重大变化

🌐 Breaking Changes

以下是 Electron 16 引入的重大变更。关于这些以及未来变更的更多信息,可以在 计划中的重大变更 页面找到。

🌐 Below are breaking changes introduced in Electron 16. More information about these and future changes can be found on the Planned Breaking Changes page.

构建原生模块

🌐 Building Native Modules

如果你的项目使用 node-gyp 来构建原生模块,你可能需要根据项目的设置和你的 Electron 版本用 --force-process-config 调用它。关于此更改的更多信息可以在 #2497 找到。

🌐 If your project uses node-gyp to build native modules, you may need to call it with --force-process-config depending on your project's setup and your Electron version. More information about this change can be found at #2497.

行为更改:crashReporter 实现已在 Linux 上切换为 Crashpad

🌐 Behavior Changed: crashReporter implementation switched to Crashpad on Linux

crashReporter API 在 Linux 上的底层实现已经从 Breakpad 改为 Crashpad,使其与 Windows 和 Mac 保持一致。因此,现在子进程会被自动监控,不再需要在 Node 子进程中调用 process.crashReporter.start(而且不建议这样做,因为这会启动第二个 Crashpad 报告器实例)。

🌐 The underlying implementation of the crashReporter API on Linux has changed from Breakpad to Crashpad, bringing it in line with Windows and Mac. As a result of this, child processes are now automatically monitored, and calling process.crashReporter.start in Node child processes is no longer needed (and is not advisable, as it will start a second instance of the Crashpad reporter).

在 Linux 上注释的报告方式也有一些细微变化,包括长值将不再在附加了 __1__2 等的注释之间拆分,而是会在(新的、更长的)注释值限制处被截断。

🌐 There are also some subtle changes to how annotations will be reported on Linux, including that long values will no longer be split between annotations appended with __1, __2 and so on, and instead will be truncated at the (new, longer) annotation value limit.

API 变更

🌐 API Changes

Electron 16 中没有 API 变更。

🌐 There were no API changes in Electron 16.

移除/弃用的变更

🌐 Removed/Deprecated Changes

  • 在渲染器中使用 desktopCapturer.getSources API 已被弃用,并将被移除。此更改提升了 Electron 应用的默认安全性。有关如何在应用中替换此 API 的详细信息,请参见 这里

12.x.y 终止支持

🌐 End of Support for 12.x.y

根据项目的支持政策,Electron 12.x.y 已达到支持终止。建议开发者和应用升级到更新的 Electron 版本。

🌐 Electron 12.x.y has reached end-of-support as per the project's support policy. Developers and applications are encouraged to upgrade to a newer version of Electron.

从 Electron 15 开始,我们将支持的版本从最新的三个版本更改为截至 2022 年 5 月的最新四个版本,并将其持续到 Electron 19 版本。Electron 19 之后,我们将回到支持最新三个版本。这一版本支持的更改是我们新更新频率变化的一部分。详情请参见我们的博客文章

🌐 As of Electron 15, we have changed supported versions from latest three versions to latest four versions until May 2022 with Electron 19. After Electron 19, we will return to supporting the latest three versions. This version support change is part of our new cadence change. Please see our blog post for full details here.

E15(2021年9月)E16(2021年11月)E17(2022年2月)E18(2022年3月)E19(2022年5月)
15.x.y16.x.y17.x.y18.x.y19.x.y
14.x.y15.x.y16.x.y17.x.y18.x.y
13.x.y14.x.y15.x.y16.x.y17.x.y
12.x.y13.x.y14.x.y15.x.y--

下一步计划

🌐 What's Next

在短期内,你可以预期团队将继续专注于跟进构成 Electron 的主要组件的开发,包括 Chromium、Node 和 V8。尽管我们小心翼翼地避免对发布日期作出承诺,但我们的计划是大约每两个月发布一次包含这些组件新版本的 Electron 主要版本。

🌐 In the short term, you can expect the team to continue to focus on keeping up with the development of the major components that make up Electron, including Chromium, Node, and V8. Although we are careful not to make promises about release dates, our plan is to release new major versions of Electron with new versions of those components approximately every 2 months.

你可以在这里找到 Electron 的公开时间线

🌐 You can find Electron's public timeline here.

有关未来更改的更多信息可以在计划中的重大变更页面上找到。

🌐 More information about future changes can be found on the Planned Breaking Changes page.