Electron 27.0.0
Electron 27.0.0 已发布!它包含对 Chromium 118.0.5993.32
、V8 11.8
和 Node.js 18.17.1
的升级。
¥Electron 27.0.0 has been released! It includes upgrades to Chromium 118.0.5993.32
, V8 11.8
, and Node.js 18.17.1
.
Electron 团队非常高兴地宣布 Electron 27.0.0 正式发布!你可以通过 npm install electron@latest
使用 npm 安装它,也可以从我们的 发布网站。继续阅读以了解有关此版本的详细信息。
¥The Electron team is excited to announce the release of Electron 27.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 或 Mastodon 上与我们分享,或加入我们的社区 Discord!可以在 Electron 的 问题跟踪器 中报告错误和功能请求。
¥If you have any feedback, please share it with us on Twitter or Mastodon, or join our community Discord! Bugs and feature requests can be reported in Electron's issue tracker.
显著变化
¥Notable Changes
技术栈变更
¥Stack Changes
-
Chromium
118.0.5993.32
-
Node.js
18.17.1
-
V8
11.8
重大变化
¥Breaking Changes
删除:macOS 10.13 / 10.14 支持
¥Removed: macOS 10.13 / 10.14 support
Chromium 不再支持 macOS 10.13 (High Sierra) 和 macOS 10.14 (Mojave)。
¥macOS 10.13 (High Sierra) and macOS 10.14 (Mojave) are no longer supported by Chromium.
旧版本的 Electron 将继续在这些操作系统上运行,但需要 macOS 10.15 (Catalina) 或更高版本才能运行 Electron v27.0.0 及更高版本。
¥Older versions of Electron will continue to run on these operating systems, but macOS 10.15 (Catalina) or later will be required to run Electron v27.0.0 and higher.
已弃用:ipcRenderer.sendTo()
¥Deprecated: ipcRenderer.sendTo()
ipcRenderer.sendTo()
API 已被弃用。应通过在渲染器之间设置 MessageChannel
来替换它。
¥The ipcRenderer.sendTo()
API has been deprecated. It should be replaced by setting up a MessageChannel
between the renderers.
IpcRendererEvent
的 senderId
和 senderIsMainFrame
属性也已被弃用。
¥The senderId
and senderIsMainFrame
properties of IpcRendererEvent
have been deprecated as well.
删除:systemPreferences
中的配色方案事件
¥Removed: color scheme events in systemPreferences
以下 systemPreferences
事件已被删除:
¥The following systemPreferences
events have been removed:
-
inverted-color-scheme-changed
-
high-contrast-color-scheme-changed
请改用 nativeTheme
模块上的新 updated
事件。
¥Use the new updated
event on the nativeTheme
module instead.
// Removed
systemPreferences.on('inverted-color-scheme-changed', () => {
/* ... */
});
systemPreferences.on('high-contrast-color-scheme-changed', () => {
/* ... */
});
// Replace with
nativeTheme.on('updated', () => {
/* ... */
});
删除:webContents.getPrinters
¥Removed: webContents.getPrinters
webContents.getPrinters
方法已被删除。请改用 webContents.getPrintersAsync
。
¥The webContents.getPrinters
method has been removed. Use
webContents.getPrintersAsync
instead.
const w = new BrowserWindow({ show: false });
// Removed
console.log(w.webContents.getPrinters());
// Replace with
w.webContents.getPrintersAsync().then((printers) => {
console.log(printers);
});
删除:systemPreferences.{get,set}AppLevelAppearance
和 systemPreferences.appLevelAppearance
¥Removed: systemPreferences.{get,set}AppLevelAppearance
and systemPreferences.appLevelAppearance
systemPreferences.getAppLevelAppearance
和 systemPreferences.setAppLevelAppearance
方法以及 systemPreferences.appLevelAppearance
属性已被删除。请改用 nativeTheme
模块。
¥The systemPreferences.getAppLevelAppearance
and systemPreferences.setAppLevelAppearance
methods have been removed, as well as the systemPreferences.appLevelAppearance
property.
Use the nativeTheme
module instead.
// Removed
systemPreferences.getAppLevelAppearance();
// Replace with
nativeTheme.shouldUseDarkColors;
// Removed
systemPreferences.appLevelAppearance;
// Replace with
nativeTheme.shouldUseDarkColors;
// Removed
systemPreferences.setAppLevelAppearance('dark');
// Replace with
nativeTheme.themeSource = 'dark';
删除:systemPreferences.getColor
的 alternate-selected-control-text
值
¥Removed: alternate-selected-control-text
value for systemPreferences.getColor
systemPreferences.getColor
的 alternate-selected-control-text
值已被删除。请改用 selected-content-background
。
¥The alternate-selected-control-text
value for systemPreferences.getColor
has been removed. Use selected-content-background
instead.
// Removed
systemPreferences.getColor('alternate-selected-control-text');
// Replace with
systemPreferences.getColor('selected-content-background');
新功能
¥New Features
-
添加了应用辅助功能透明度设置 API #39631
¥Added app accessibility transparency settings api #39631
-
添加了对
chrome.scripting
扩展 API #39675 的支持¥Added support for
chrome.scripting
extension APIs #39675 -
默认启用
WaylandWindowDecorations
和 #39644¥Enabled
WaylandWindowDecorations
by default #39644
24.x.y 支持终止
¥End of Support for 24.x.y
根据项目的 支持政策,Electron 24.x.y 已达到支持终止状态。建议开发者和应用升级到较新版本的 Electron。
¥Electron 24.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.
E27 (2023 年 10 月) | E28 (2023 年 12 月) | E29 (2024 年 2 月) |
---|---|---|
27.x.y | 28.x.y | 29.x.y |
26.x.y | 27.x.y | 28.x.y |
25.x.y | 26.x.y | 27.x.y |
22.x.y 扩展支持终止
¥End of Extended Support for 22.x.y
今年早些时候,Electron 团队将 Electron 22 的计划终止日期从 2023 年 5 月 30 日延长至 2023 年 10 月 10 日,以配合 Chrome 对 Windows 7/8/8.1 的扩展支持(更多详情请参阅 告别 Windows 7/8/8.1)。
¥Earlier this year, the Electron team extended Electron 22's planned end of life date from May 30, 2023 to October 10, 2023, in order to match Chrome's extended support for Windows 7/8/8.1 (see Farewell, Windows 7/8/8.1 for more details).
根据项目的 支持政策 和此支持扩展,Electron 22.x.y 已达到支持终止状态。这将使对最新的三个主要稳定版本的支持降级,并终止对 Windows 7/8/8.1 的官方支持。
¥Electron 22.x.y has reached end-of-support as per the project's support policy and this support extension. This will drop support back to the latest three stable major versions, and will end official support for Windows 7/8/8.1.
下一步计划
¥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.