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 install electron@latest
使用 npm 安装它,也可以从我们的 发布网站。此版本包含升级、修复和新功能。我们迫不及待地想看看你使用它们构建的内容!继续阅读以了解有关此版本的详细信息,并请分享你的任何反馈!
¥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
技术栈变更
¥Stack Changes
-
Chromium
80.0.3987.86
-
Node.js
12.13.0
-
V8
8.0
亮点功能
¥Highlight Features
-
实现了 Chrome 内置拼写检查功能的使用。请参阅 #20692 和 #21266 中的更多详细信息。
¥Implemented usage of Chrome's built-in spellchecker feature. See more details in #20692 and #21266.
-
IPC 通信现在使用 v8 的结构化克隆算法。与现有逻辑相比,这更快、功能更丰富、更令人意外,并且为大缓冲区和复杂对象带来了 2 倍的性能提升。小消息的延迟不会受到显著影响。请参阅 #20214 中的更多详细信息。
¥IPC communication now uses v8's Structured Clone Algorithm. This is faster, more featureful, and less surprising than the existing logic, and brings about a 2x performance boost for large buffers and complex objects. Latency for small messages is not significantly affected. See more details in #20214.
请参阅 8.0.0 发行说明 获取新功能和变更的完整列表。
¥See the 8.0.0 release notes for a full list of new features and changes.
重大变化
¥Breaking Changes
-
在上下文感知模块的弃用警告中显示模块名称。#21952
¥Show module name in deprecation warning for context-aware modules. #21952
-
这是为满足未来在渲染器进程中加载的原生 Node 模块必须是 N-API 或 上下文感知 的要求而进行的持续工作。完整信息和拟议时间表详见 这个问题。
¥This is continued work for a future requirement that native Node modules loaded in the renderer process be either N-API or Context Aware. Full info and proposed timeline is detailed in this issue.
-
-
通过 IPC 发送的值现在使用结构化克隆算法进行序列化。#20214
¥Values sent over IPC are now serialized with Structured Clone Algorithm. #20214
-
由于缺少维护人员,离屏渲染目前已停用。它在 Chromium 升级期间崩溃,随后被禁用。#20772
¥Offscreen Rendering is currently disabled due to lack of a maintainer to work on this feature. It broke during the Chromium upgrade and was subsequently disabled. #20772
有关这些变更和未来变更的更多信息,请参阅 计划中的突发事件变更 页面。
¥More information about these and future changes can be found on the Planned Breaking Changes page.
API 变更
¥API Changes
-
app
API 变更:¥
app
API changes: -
BrowserWindow
API 变更:¥
BrowserWindow
API changes:-
更新了文档,指出 BrowserWindow 选项
hasShadow
在所有平台 #20038 上均可用。¥Updated docs to note that BrowserWindow options
hasShadow
is available on all platforms #20038 -
在 BrowserWindow 选项中添加了
trafficLightPosition
选项,允许自定义交通信号灯按钮的位置。#21781¥Added
trafficLightPosition
option to BrowserWindow options to allow custom positioning for traffic light buttons. #21781 -
在 BrowserWindow 中添加了
accessibleTitle
选项,用于设置可访问的窗口标题 #19698¥Added
accessibleTitle
option to BrowserWindow for setting the accessible window title #19698 -
BrowserWindow.fromWebContents()
现在可以返回 null #19983¥
BrowserWindow.fromWebContents()
can now return null #19983 -
添加了
BrowserWindow.getMediaSourceId()
和BrowserWindow.moveAbove(mediaSourceId)
。#18926¥Added
BrowserWindow.getMediaSourceId()
andBrowserWindow.moveAbove(mediaSourceId)
. #18926 -
添加了对 macOS 上
will-move
事件的支持。#19641¥Added support for
will-move
event on macOS. #19641
-
-
已记录之前未记录的
crashReporter.getCrashesDirectory()
。#20417¥Documented previously undocumented
crashReporter.getCrashesDirectory()
. #20417 -
dialog
API 变更:¥
dialog
API changes:-
在
dialog.showOpenDialog
和dialog.showOpenDialogSync
中添加了dontAddToRecent
属性,以防止在打开的对话框中将文档添加到 Windows 上的最近文档中。#19669¥Added
dontAddToRecent
property todialog.showOpenDialog
anddialog.showOpenDialogSync
to prevent documents from being added to recent documents on Windows in open dialogs. #19669 -
为
dialog.showSaveDialog
和dialog.showSaveDialogSync
添加了属性自定义。#19672¥Added property customization to
dialog.showSaveDialog
anddialog.showSaveDialogSync
. #19672
-
-
Notification
API 变更:¥
Notification
API changes: -
session
API 变更:¥
session
API changes:-
更新了
session.setProxy(config)
和session.setCertificateVerifyProc(proc)
的文档,指出了可选选项。#19604¥Updated documentation on
session.setProxy(config)
andsession.setCertificateVerifyProc(proc)
to note optional options. #19604 -
添加
session.downloadURL(url)
以允许在没有浏览器窗口的情况下触发下载。#19889¥Added
session.downloadURL(url)
to allow to triggering downloads without a BrowserWindow. #19889 -
通过
session.preconnect(options)
和preconnect
事件添加了对 HTTP 预连接资源提示的支持。#18671¥Added support for HTTP preconnect resource hints via
session.preconnect(options)
and thepreconnect
event. #18671 -
添加
session.addWordToSpellCheckerDictionary
以允许在词典 #21297 中使用自定义单词¥Added
session.addWordToSpellCheckerDictionary
to allow custom words in the dictionary #21297
-
-
在 macOS 上为
shell.moveItemToTrash(fullPath[, deleteOnFail])
添加了选项,用于指定 moveItemToTrash 失败时发生的情况。#19700¥Added option to
shell.moveItemToTrash(fullPath[, deleteOnFail])
on macOS to specify what happens when moveItemToTrash fails. #19700 -
systemPreferences
API 变更:¥
systemPreferences
API changes: -
添加了
nativeTheme.themeSource
以允许应用覆盖 Chromium 和操作系统的主题选择。#19960¥Added
nativeTheme.themeSource
to allow apps to override Chromium and the OS's theme choice. #19960 -
TouchBar API 变更:
¥TouchBar API changes:
-
在
TouchBarButton
和TouchBarLabel
中添加了accessibilityLabel
属性,以提高 TouchBarButton/TouchBarLabel 的可访问性。#20454¥Added
accessibilityLabel
property toTouchBarButton
andTouchBarLabel
to improve TouchBarButton/TouchBarLabel accessibility. #20454 -
更新了 TouchBar 相关文档 #19444
¥Updated TouchBar related documentation #19444
-
-
tray
API 变更:¥
tray
API changes:-
为
tray.displayBalloon()
添加了新选项:iconType
、largeIcon
、noSound
和respectQuietTime
。#19544¥Added new options to
tray.displayBalloon()
:iconType
,largeIcon
,noSound
andrespectQuietTime
. #19544 -
添加了 tray.removeBalloon(),用于移除已显示的气球通知。#19547
¥Added tray.removeBalloon(), which removes an already displayed balloon notification. #19547
-
添加了 tray.focus(),用于将焦点返回到任务栏通知区域。壮举:添加 tray.focus() #19548
¥Added tray.focus(), which returns focus to the taskbar notification area. feat: add tray.focus() #19548
-
-
webContents
API 变更:¥
webContents
API changes:-
添加
contents.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture])
以在 webContents API 上公开 executeJavaScriptInIsolatedWorld。#21190¥Added
contents.executeJavaScriptInIsolatedWorld(worldId, scripts[, userGesture])
to expose executeJavaScriptInIsolatedWorld on the webContents API. #21190 -
添加了用于捕获隐藏 webContents 的方法。#21679
¥Added methods to capture a hidden webContents. #21679
-
为
webContents.print([options], [callback])
添加了选项,以便自定义打印页眉和页脚。#19688¥Added options to
webContents.print([options], [callback])
to enable customization of print page headers and footers. #19688 -
添加了通过
webContents.getAllSharedWorkers()
和webContents.inspectSharedWorkerById(workerId)
检查特定共享工作器的功能。#20389¥Added ability to inspect specific shared workers via
webContents.getAllSharedWorkers()
andwebContents.inspectSharedWorkerById(workerId)
. #20389 -
在 WebContents.printToPDF() 中添加了对
fitToPageEnabled
和scaleFactor
选项的支持。#20436¥Added the support of
fitToPageEnabled
andscaleFactor
options in WebContents.printToPDF(). #20436
-
-
更新了
webview.printToPDF
文档,指出返回类型现在为 Uint8Array。#20505¥Updated
webview.printToPDF
documentation to indicate return type is now Uint8Array. #20505
已弃用的 API
¥Deprecated APIs
以下 API 现已弃用:
¥The following APIs are now deprecated:
-
已弃用
BrowserWindow.setVisibleOnAllWorkspaces
中不起作用的visibleOnFullScreen
选项,并在下一个主要版本中将其移除。#21732¥Deprecated the nonfunctional
visibleOnFullScreen
option withinBrowserWindow.setVisibleOnAllWorkspaces
prior to its removal in the next major release version. #21732 -
已弃用 macOS 系统上
systemPreferences.getColor(color)
上的alternate-selected-control-text
。#20611¥Deprecated
alternate-selected-control-text
onsystemPreferences.getColor(color)
for macOS. #20611 -
已弃用
webContents
、webFrame
和<webview> Tag
上的setLayoutZoomLevelLimits
,因为 Chromium 移除了此功能。#21296¥Deprecated
setLayoutZoomLevelLimits
onwebContents
,webFrame
, and<webview> Tag
because Chromium removed this capability. #21296 -
app.allowRendererProcessReuse
的false
默认值现已弃用。#21287¥The default value of
false
forapp.allowRendererProcessReuse
is now deprecated. #21287 -
已弃用
<webview>.getWebContents()
,因为它依赖于远程模块。#20726¥Deprecated
<webview>.getWebContents()
as it depends on the remote module. #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 测试版;作为回报,他们发现的新 bug 将优先发布到稳定版本。如果你想参与或了解更多信息,请联系 查看我们关于该程序的博客文章。
¥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.