Electron 8.0.0
Electron 8.0.0 已经发布!它包括对 Chromium 80、V8 8.0 和 Node.js 12.13.0 的升级。我们还添加了 Chrome 内置的拼写检查功能,以及更多其他功能!
🌐 Electron 8.0.0 has been released! It includes upgrades to Chromium 80, V8 8.0, and Node.js 12.13.0. We've added Chrome's built-in spellchecker, and much more!
Electron 团队很高兴地宣布 Electron 8.0.0 正式发布!你可以通过 npm 使用 npm install electron@latest 安装,或从我们的发布网站下载。本次发布包含了大量升级、修复和新功能。我们迫不及待想看看你会用它们创造出什么作品!继续阅读以了解本次发布的详细信息,并请分享你的任何反馈!
🌐 The Electron team is excited to announce the release of Electron 8.0.0! You can install it with npm via npm install electron@latest or download it from our releases website. The release is packed with upgrades, fixes, and new features. We can't wait to see what you build with them! Continue reading for details about this release, and please share any feedback you have!
显著变化
🌐 Notable Changes
- 已实现使用 Chrome 内置拼写检查功能。更多详情请参见 #20692 和 #21266。
- IPC 通信现在使用 v8 的结构化克隆算法。这比现有逻辑更快、功能更多且更少意外,对于大型缓冲区和复杂对象带来了约 2 倍的性能提升。小消息的延迟没有显著影响。更多详情请参见 #20214。
请查看8.0.0版本说明以获取新功能和更改的完整列表。
🌐 See the 8.0.0 release notes for a full list of new features and changes.
技术栈变更
🌐 Stack Changes
- Chromium
80.0.3987.86 - Node.js
12.13.0 - V8
8.0
重大变化
🌐 Breaking Changes
- 在面向上下文的模块的弃用警告中显示模块名称。 #21952
- 这是为未来需求而进行的持续工作,即渲染进程中加载的本地 Node 模块必须是 N-API 或 Context Aware。完整信息和拟议时间表详见 此问题。
- 通过 IPC 发送的值现在使用结构化克隆算法进行序列化。#20214
- 由于缺乏维护人员,该功能目前已禁用。它在 Chromium 升级进程中出现了问题,因此被禁用。#20772
有关这些和未来更改的更多信息,请参阅计划中的重大更改页面。
🌐 More information about these and future changes can be found on the Planned Breaking Changes page.
API 变更
🌐 API Changes
appAPI 变更:BrowserWindowAPI 变更:- 更新了文档,注明 BrowserWindow 选项
hasShadow在所有平台上可用 #20038 - 在 BrowserWindow 选项中添加了
trafficLightPosition选项,以允许自定义交通灯按钮的位置。 #21781 - 在 BrowserWindow 中添加了
accessibleTitle选项,用于设置可访问的窗口标题 #19698 BrowserWindow.fromWebContents()现在可以返回 null #19983- 已添加
BrowserWindow.getMediaSourceId()和BrowserWindow.moveAbove(mediaSourceId)。#18926 - 已在 macOS 上添加对
will-move事件的支持。 #19641
- 更新了文档,注明 BrowserWindow 选项
- 记录了之前未记录的
crashReporter.getCrashesDirectory()。#20417 dialogAPI 变更:NotificationAPI 变更:sessionAPI 变更:- 在 macOS 上为
shell.moveItemToTrash(fullPath[, deleteOnFail])添加了选项,以指定当 moveItemToTrash 失败时的处理方式。 #19700 systemPreferencesAPI 变更:- 添加了
nativeTheme.themeSource,以允许应用覆盖 Chromium 和操作系统的主题选择。#19960 - TouchBar API 变更:
trayAPI 变更:webContentsAPI 变更:- 在 webContents API 上添加了
contents.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture])以公开 executeJavaScriptInIsolatedWorld。#21190 - 添加了捕获隐藏 webContents 的方法。#21679
- 为
webContents.print([options], [callback])添加了选项,以支持自定义打印页面的页眉和页脚。#19688 - 新增了通过
webContents.getAllSharedWorkers()和webContents.inspectSharedWorkerById(workerId)检查特定共享工作线程的功能。 #20389 - 在 WebContents.printToPDF() 中添加了对
fitToPageEnabled和scaleFactor选项的支持。 #20436
- 在 webContents API 上添加了
- 已更新
webview.printToPDF文档,以显示返回类型现在为 Uint8Array。#20505
已弃用的 API
🌐 Deprecated APIs
以下 API 现已弃用:
🌐 The following APIs are now deprecated:
- 在下一个主要版本中移除之前,已弃用
BrowserWindow.setVisibleOnAllWorkspaces中无效的visibleOnFullScreen选项。#21732 - 在 macOS 上弃用
systemPreferences.getColor(color)的alternate-selected-control-text。#20611 - 由于 Chromium 移除了此功能,
setLayoutZoomLevelLimits在webContents、webFrame和<webview> Tag上已被弃用。#21296 app.allowRendererProcessReuse的false默认值现在已被弃用。 #21287- 弃用
<webview>.getWebContents(),因为它依赖于远程模块。 #20726
5.x.y 停止支持
🌐 End of Support for 5.x.y
根据该项目的支持政策,Electron 5.x.y 已停止支持。建议开发者和应用升级到更新版本的 Electron。
🌐 Electron 5.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.
应用反馈计划
🌐 App Feedback Program
我们继续使用我们的应用反馈计划进行测试。参与该计划的项目会在他们的应用上测试 Electron 测试版;作为回报,他们发现的新问题会被优先处理用于正式版本。如果你想参与或了解更多信息,请查看我们关于该计划的博客文章。
🌐 We continue to use our App Feedback Program for testing. Projects who participate in this program test Electron betas on their apps; and in return, the new bugs they find are prioritized for the stable release. If you'd like to participate or learn more, check out our blog post about the program.
下一步计划
🌐 What's Next
在短期内,你可以预期团队将继续专注于跟进构成 Electron 的主要组件的开发,包括 Chromium、Node 和 V8。虽然我们小心翼翼地避免对发布日期作出承诺,但我们的计划是大约每季度发布一次包含这些组件新版本的 Electron 主要版本。临时 9.0.0 时间表列出了 Electron 9 开发生命周期中的关键日期。此外,请参阅我们的版本控制文档以获取关于 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 release new major versions of Electron with new versions of those components approximately quarterly. The tentative 9.0.0 schedule maps out key dates in the Electron 9 development life cycle. Also, see our versioning document for more detailed information about versioning in Electron.
有关即将发布的 Electron 版本中计划的重大更改的信息,请参阅我们的计划中的重大更改文档。
🌐 For information on planned breaking changes in upcoming versions of Electron, see our Planned Breaking Changes doc.
弃用 remote 模块(从 Electron 9 开始)
🌐 Deprecation of remote Module (Starting in Electron 9)
由于严重的安全隐患,我们计划从 Electron 9 开始弃用remote模块。你可以查阅并关注此问题,其中详细说明了我们的原因,并包含弃用的建议时间表。
🌐 Due to serious security liabilities, we are beginning plans to deprecate the remote module starting in Electron 9. You can read and follow this issue that details our reasons for this and includes a proposed timeline for deprecation.