A detailed look at our versioning policy and implementation.
As of version 2.0.0, Electron follows the SemVer spec. The following command will install the most recent stable build of Electron:
```sh npm2yarn npm install –save-dev electron
To update an existing project to use the latest stable version:
```sh npm2yarn
npm install --save-dev electron@latest
There are several major changes from our 1.x strategy outlined below. Each change is intended to satisfy the needs and priorities of developers/maintainers and app developers.
-beta
tagsmain
branch is versionless; only stabilization branches contain version informationWe will cover in detail how git branching works, how npm tagging works, what developers should expect to see, and how one can backport changes.
Below is a table explicitly mapping types of changes to their corresponding category of SemVer (e.g. Major, Minor, Patch).
Major Version Increments | Minor Version Increments | Patch Version Increments |
---|---|---|
Electron breaking API changes | Electron non-breaking API changes | Electron bug fixes |
Node.js major version updates | Node.js minor version updates | Node.js patch version updates |
Chromium version updates | fix-related chromium patches |
For more information, see the Semantic Versioning 2.0.0 spec.
Note that most Chromium updates will be considered breaking. Fixes that can be backported will likely be cherry-picked as patches.
Stabilization branches are branches that run parallel to main
, taking in only cherry-picked commits that are related to security or stability. These branches are never merged back to main
.
Since Electron 8, stabilization branches are always major version lines, and named against the following template $MAJOR-x-y
e.g. 8-x-y
. Prior to that we used minor version lines and named them as $MAJOR-$MINOR-x
e.g. 2-0-x
.
We allow for multiple stabilization branches to exist simultaneously, one for each supported version. For more details on which versions are supported, see our Electron Releases doc.
Older lines will not be supported by the Electron project, but other groups can take ownership and backport stability and security fixes on their own. We discourage this, but recognize that it makes life easier for many app developers.
Developers want to know which releases are safe to use. Even seemingly innocent features can introduce regressions in complex applications. At the same time, locking to a fixed version is dangerous because you’re ignoring security patches and bug fixes that may have come out since your version. Our goal is to allow the following standard semver ranges in package.json
:
~2.0.0
to admit only stability or security related fixes to your 2.0.0
release.^2.0.0
to admit non-breaking reasonably stable feature work as well as security and bug fixes.What’s important about the second point is that apps using ^
should still be able to expect a reasonable level of stability. To accomplish this, SemVer allows for a pre-release identifier to indicate a particular version is not yet safe or stable.
Whatever you choose, you will periodically have to bump the version in your package.json
as breaking changes are a fact of Chromium life.
The process is as follows:
beta.N
, e.g. 2.0.0-beta.1
. After the first beta, subsequent beta releases must meet all of the following conditions:
2.0.0-beta.2
.2.0.0
. After the first stable, all changes must be backwards-compatible bug or security fixes.2.0.1
.Specifically, the above means:
For each major and minor bump, you should expect to see something like the following:
2.0.0-beta.1
2.0.0-beta.2
2.0.0-beta.3
2.0.0
2.0.1
2.0.2
An example lifecycle in pictures:
2.0.0-beta.1
.
2.0.0-beta.2
.
2.0.0
.
2-0-x
line and release 2.0.1
.
A few examples of how various SemVer ranges will pick up new releases:
All supported release lines will accept external pull requests to backport
fixes previously merged to main
, though this may be on a case-by-case
basis for some older supported lines. All contested decisions around release
line backports will be resolved by the
Releases Working Group
as an agenda item at their weekly meeting the week the backport PR is raised.
Feature flags are a common practice in Chromium, and are well-established in the web-development ecosystem. In the context of Electron, a feature flag or soft branch must have the following properties:
All pull requests must adhere to the Conventional Commits spec, which can be summarized as follows:
BREAKING CHANGE:
.feat:
.fix:
.The electron/electron
repository also enforces squash merging, so you only need to make sure that your pull request has the correct title prefix.
main
branchmain
branch will always contain the next major version X.0.0-nightly.DATE
in its package.json
.main
.package.json
.main
must be bumped to the next major (i.e. main
is always versioned as the next theoretical release branch).Electron versions < 2.0 did not conform to the SemVer spec: major versions corresponded to end-user API changes, minor versions corresponded to Chromium major releases, and patch versions corresponded to new features and bug fixes. While convenient for developers merging features, it creates problems for developers of client-facing applications. The QA testing cycles of major apps like Slack, Teams, Skype, VS Code, and GitHub Desktop can be lengthy and stability is a highly desired outcome. There is a high risk in adopting new features while trying to absorb bug fixes.
Here is an example of the 1.x strategy:
An app developed with 1.8.1
cannot take the 1.8.3
bug fix without either absorbing the 1.8.2
feature, or by backporting the fix and maintaining a new release line.