Skip to main content

Electron 21.0.0

· 5 min read

Electron 21.0.0 已发布!它包含对 Chromium 106、V8 10.6 和 Node.js 16.16.0 的升级。请阅读下文了解更多详情!

¥Electron 21.0.0 has been released! It includes upgrades to Chromium 106, V8 10.6, and Node.js 16.16.0. Read below for more details!


Electron 团队非常高兴地宣布 Electron 21.0.0 正式发布!你可以通过 npm install electron@latest 使用 npm 安装它,也可以从我们的 发布网站。继续阅读以了解有关此版本的详细信息。

¥The Electron team is excited to announce the release of Electron 21.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.

如果你有任何反馈,请在 Twitter 上与我们分享,或加入我们的社区 Discord!可以在 Electron 的 问题跟踪器 中报告错误和功能请求。

¥If you have any feedback, please share it with us on Twitter, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.

显著变化

¥Notable Changes

技术栈变更

¥Stack Changes

新功能

¥New Features

  • 添加了 webFrameMain.origin#35534

    ¥Added webFrameMain.origin. #35534

  • 添加了新的 WebContents.ipcWebFrameMain.ipc API。#35231

    ¥Added new WebContents.ipc and WebFrameMain.ipc APIs. #35231

  • 添加了对类似面板行为的支持。窗口可以悬浮在全屏应用上方。#34388

    ¥Added support for panel-like behavior. Window can float over full-screened apps. #34388

  • 添加了对 macOS 应用从 APNs 推送通知的支持。#33574

    ¥Added support for push notifications from APNs for macOS apps. #33574

重大变更和 API 变更

¥Breaking & API Changes

以下是 Electron 21 中引入的重大变更。

¥Below are breaking changes introduced in Electron 21.

V8 内存笼已启用

¥V8 Memory Cage Enabled

Electron 21 启用了 V8 沙盒指针,紧随 Chrome 的 决定在 Chrome 103 中也采取同样的措施 之后。这对原生模块有一些影响。此功能具有性能和安全性优势,但也对原生模块施加了一些新的限制,例如指向外部("off-heap")内存的 ArrayBuffer 的使用。请参阅 这篇博文 了解更多信息。#34724

¥Electron 21 enables V8 sandboxed pointers, following Chrome's decision to do the same in Chrome 103. This has some implications for native modules. This feature has performance and security benefits, but also places some new restrictions on native modules, e.g. use of ArrayBuffers that point to external ("off-heap") memory. Please see this blog post for more information. #34724

重构 webContents.printToPDF

¥Refactored webContents.printToPDF

重构了 webContents.printToPDF 函数,使其与 Chromium 的 headless 实现保持一致。请参阅 #33654 了解更多信息。

¥Refactored webContents.printToPDF to align with Chromium's headless implementation. See #33654 for more information.

有关这些变更和未来变更的更多信息,请参阅 计划中的突发事件变更 页面。

¥More information about these and future changes can be found on the Planned Breaking Changes page.

18.x.y 支持终止

¥End of Support for 18.x.y

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

¥Electron 18.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.

E18 (2022 年 3 月)E19 (2022 年 5 月)E20 (2022 年 8 月)E21 (2022 年 9 月)E22 (2022 年 12 月)
18.x.y19.x.y20.x.y21.x.y22.x.y
17.x.y18.x.y19.x.y20.x.y21.x.y
16.x.y17.x.y18.x.y19.x.y20.x.y

下一步计划

¥What's Next

短期内,你可以预期团队将继续专注于跟上构成 Electron 的主要组件(包括 Chromium、Node 和 V8)的开发。

¥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.

你可以找到 Electron 公开时间线

¥You can find Electron's public timeline here.

有关未来变更的更多信息,请参阅 计划中的突发事件变更 页面。

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