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 使用 npm install electron@latest
安装它,或者从我们的发布网站下载它。继续阅读以了解有关此版本的详细信息。
如果您有任何反馈,请在 Twitter 或 Mastodon 上与我们分享,或者加入我们的社区 Discord!错误和功能请求可以在 Electron 的 问题跟踪器中报告。
值得注意的更改
堆栈更改
- Chromium
118.0.5993.32
- Node.js
18.17.1
- V8
11.8
重大更改
已删除:macOS 10.13 / 10.14 支持
macOS 10.13 (High Sierra) 和 macOS 10.14 (Mojave) 不再受 Chromium 支持。
旧版本的 Electron 将继续在这些操作系统上运行,但需要 macOS 10.15 (Catalina) 或更高版本才能运行 Electron v27.0.0 及更高版本。
已弃用: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 (Oct'23) | E28 (Dec'23) | E29 (Feb'24) |
---|---|---|
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 的公共时间表。
有关未来更改的更多信息,请访问计划的重大更改页面。