Skip to main content

Electron 2.0 及更高版本 - 语义化版本控制

· 3 min read

Electron 的新主要版本正在开发中,我们的版本控制策略也随之进行了一些调整。从 2.0.0 版本开始,Electron 将严格遵守语义化版本控制。

¥A new major version of Electron is in the works, and with it some changes to our versioning strategy. As of version 2.0.0, Electron will strictly adhere to Semantic Versioning.


此更改意味着你将更频繁地看到主要版本升级,并且通常是 Chromium 的重大更新。补丁版本也将更加稳定,因为它们现在只包含错误修复,不包含任何新功能。

¥This change means you'll see the major version bump more often, and it will usually be a major update to Chromium. Patch releases will also be more stable, as they will now only contain bug fixes with no new features.

主要版本增量

¥Major Version Increments

  • Chrom 版本更新

    ¥Chromium version updates

  • Node.js 主要版本更新

    ¥Node.js major version updates

  • Electron 断裂 API 更改

    ¥Electron breaking API changes

小版本增量

¥Minor Version Increments

  • Node.js 小版本更新

    ¥Node.js minor version updates

  • Electron 不间断 API 更改

    ¥Electron non-breaking API changes

补丁版本增量

¥Patch Version Increments

  • Node.js 补丁版本更新

    ¥Node.js patch version updates

  • 修复相关的 chromium 补丁

    ¥fix-related chromium patches

  • Electron 错误修复

    ¥Electron bug fixes

由于 Electron 的语义版本范围现在更有意义,我们建议使用 npm 的默认 --save-dev 标志安装 Electron,该标志会为你的版本添加 ^ 前缀,确保你能够安全地获取次要更新和补丁更新:

¥Because Electron's semver ranges will now be more meaningful, we recommend installing Electron using npm's default --save-dev flag, which will prefix your version with ^, keeping you safely up to date with minor and patch updates:

npm install --save-dev electron

对于只对错误修复感兴趣的开发者,你应该使用波浪符号语义版本前缀,例如 ~2.0.0,它永远不会引入新功能,只会修复以提高稳定性。

¥For developers interested only in bug fixes, you should use the tilde semver prefix e.g. ~2.0.0, which which will never introduce new features, only fixes to improve stability.

有关更多详细信息,请参阅 electronjs.org/docs/tutorial/electron-versioning

¥For more details, see electronjs.org/docs/tutorial/electron-versioning.