You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/electron/README.md
+32-2Lines changed: 32 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# Electron
1
+
# @packages/electron
2
2
3
3
This is the lib responsible for installing + building Electron. This enables us to develop with the Electron shell that will match how the final compiled Cypress binary looks 1:1.
4
4
5
-
It does this by using `symlinks` while in development.
5
+
It does this by using symlinks while in development.
6
6
7
7
## Building
8
8
@@ -19,3 +19,33 @@ yarn workspace @packages/electron test
19
19
yarn workspace @packages/electron test-debug
20
20
yarn workspace @packages/electron test-watch
21
21
```
22
+
23
+
## Upgrading Electron
24
+
25
+
The version of `electron` that is bundled with Cypress should be kept as up-to-date as possible with the [stable Electron releases](https://www.electronjs.org/releases/stable). Many users expect the bundled Chromium and Node.js to be relatively recent. Also, historically, it has been extremely difficult to upgrade over multiple major versions of Electron at once, because of all the breaking changes in Electron and Node.js that impact Cypress.
26
+
27
+
28
+
Upgrading `electron` involves more than just bumping this package's `package.json`. Here are additional tasks to check off when upgrading Electron:
29
+
30
+
-[ ]**Write accurate changelog items.** The "User-facing changelog" for an Electron upgrade should mention the new Node.js and Chromium versions bundled.
31
+
- For example:
32
+
- Upgraded `electron` from `12.0.0-beta.14` to `13.1.7`.
33
+
- Upgraded bundled Node.js version from `14.6.0` to `14.17.0`.
34
+
- Upgraded bundled Chromium version from 89.0.0.1234 to 91.0.0.2345.
35
+
-[ ]**Determine if the Electron upgrade is a breaking change.** Electron upgrades constitute "breaking changes" in Cypress if:
36
+
- the major version number of Node.js changes, since users rely on the bundled Node.js to load plugins and `.js` fixtures, or
37
+
- there are changes to Electron that require new shared libraries to be installed on Linux, breaking existing CI setups, or
38
+
- there is some other change that would break existing usage of Cypress (for example, a Web API feature being removed/added to the bundled Chromium)
39
+
-[ ]**Create and publish Docker `base` and `browsers` family images matching the Node.js and Chromium versions in Electron.** The `browsers` image will be used for CI and the `base` will be used for any new `included` family images.
40
+
- See [`cypress-docker-images`](https://github.com/cypress-io/cypress-docker-images/).
41
+
-[ ]**Ensure that a matching Node.js version is enforced in the monorepo for local development and CI.** When Electron is upgraded, oftentimes, the bundled Node.js version that comes with Electron is updated as well. Because all unit and integration tests run in normal Node.js (not Electron's Node.js), it's important for this Node.js version to be synced with the monorepo. There are a few places where this needs to be done:
42
+
-[ ][`/.node-version`](../../.node-version) - used by `nvm` and other Node version managers
43
+
-[ ][`/appveyor.yml`](../../appveyor.yml) - update the `nodejs_version`
-[ ][`/scripts/run-docker-local.sh`](../../scripts/run-docker-local.sh) - update Docker image to the new matching `browsers` image
46
+
-[ ][`/circle.yml`](../../circle.yml)
47
+
- Update the Docker `image`s to the new matching `browsers` image.
48
+
- Update the `xcode` version to one with the same major Node.js version bundled. There is usually not an exact match, this is ok as long as the major version number as the same.
49
+
-[ ] Do a global search for the old Node.js version to identify any new areas that may need updating/unification, and update those locations (and this document!)
50
+
-[ ]**Manually smoke test `cypress open`.** Upgrading Electron can break the `desktop-gui` in unexpected ways. Since testing in this area is weak, double-check that things like launching `cypress open`, signing into the Dashboard, and launching Electron tests still work.
51
+
-[ ]**Fix failing tests.** Usually, these are due to breaking changes in either Node.js or Electron. Check the changelogs of both to find relevant changes.
0 commit comments