Electron 27.0.0
Electron 27.0.0 现已发布! 它包括对 Chromium 118.0.5993.32
、V8 11.8
和 Node.js 18.17.1
的升级。
Electron 团队很高兴宣布 Electron 27.0.0 的发布!您可以通过 npm install electron@latest
使用 npm 安装,或从我们的 发布网站 下载。请继续阅读以了解此版本的详细信息。
如果您有任何反馈,请通过 Twitter 或 Mastodon 与我们分享,或加入我们的社区 Discord!错误和功能请求可以在 Electron 的 问题跟踪器 中报告。
重要变更
技术栈变更
- Chromium
118.0.5993.32
- Node.js
18.17.1
- V8
11.8
破坏性变更
已移除:对 macOS 10.13 / 10.14 的支持
Chromium 不再支持 macOS 10.13 (High Sierra) 和 macOS 10.14 (Mojave)。
旧版本的 Electron 将继续在这些操作系统上运行,但运行 Electron v27.0.0 及更高版本将需要 macOS 10.15 (Catalina) 或更高版本。
已弃用:ipcRenderer.sendTo()
ipcRenderer.sendTo()
API 已弃用。应使用在渲染器之间设置 MessageChannel
来替代它。
IpcRendererEvent
的 senderId
和 senderIsMainFrame
属性也已被弃用。
移除:systemPreferences
中的颜色方案事件
以下 systemPreferences
事件已被移除:
inverted-color-scheme-changed
high-contrast-color-scheme-changed
请改用 nativeTheme
模块上新的 updated
事件。
// Removed
systemPreferences.on('inverted-color-scheme-changed', () => {
/* ... */
});
systemPreferences.on('high-contrast-color-scheme-changed', () => {
/* ... */
});
// Replace with
nativeTheme.on('updated', () => {
/* ... */
});
已移除:webContents.getPrinters
webContents.getPrinters
方法已被移除。 请改用 webContents.getPrintersAsync
。
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
systemPreferences.getAppLevelAppearance
和 systemPreferences.setAppLevelAppearance
方法已被移除,systemPreferences.appLevelAppearance
属性也已被移除。请改用 nativeTheme
模块。
// 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
值
systemPreferences.getColor
的 alternate-selected-control-text
值已被移除。 请改用 selected-content-background
。
// Removed
systemPreferences.getColor('alternate-selected-control-text');
// Replace with
systemPreferences.getColor('selected-content-background');
新特性
- 添加了应用无障碍透明度设置 API #39631
- 添加了对
chrome.scripting
扩展 API 的支持 #39675 - 默认启用了
WaylandWindowDecorations
#39644
终止对 24.x.y 的支持
Electron 24.x.y 已根据项目的 支持策略 结束支持。鼓励开发人员和应用程序升级到新版本的 Electron。
E27 (23年10月) | E28 (23年12月) | E29 (24年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 的扩展支持
今年早些时候,Electron 团队将 Electron 22 的计划寿命结束日期从 2023 年 5 月 30 日延长至 2023 年 10 月 10 日,以匹配 Chrome 对 Windows 7/8/8.1 的延长支持(有关更多详细信息,请参阅 告别 Windows 7/8/8.1)。
Electron 22.x.y 已根据项目的 支持策略 和此支持延长,结束支持。这将终止对最新三个稳定主版本的支持,并且将结束对 Windows 7/8/8.1 的官方支持。
下一步计划
短期内,您可以预期团队将继续专注于跟进构成 Electron 的主要组件(包括 Chromium、Node 和 V8)的开发。
您可以在此处找到 Electron 的公开时间线。
有关未来变更的更多信息,请参阅计划中的破坏性变更页面。