Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade electron 7.3.2 -> 10.1.2 #1106

Merged
merged 6 commits into from
Oct 9, 2020
Merged

upgrade electron 7.3.2 -> 10.1.2 #1106

merged 6 commits into from
Oct 9, 2020

Conversation

mason-fish
Copy link
Contributor

@mason-fish mason-fish commented Oct 1, 2020

fixes #1044

Upgrades Electron and Spectron by 3 major versions. Also of note, is the underlying webdriverio dep is upgraded by 2 major versions (4.xx -> 6.xx).

Here are some of the breaking changes:

Electron

  • remote module is disabled by default now, and must be explicitly enabled for each browser window, this module is flagged to be deprecated and moved. More information on it's proposed future here
  • as of electron 9, sending complex objects over ipc will now throw an error. Previously the pieces which could not be serialized would just be silently dropped and was the source of a few bugs we've encountered in the past. So this is a welcome change, we now add .serialize() and deserialize() methods to classes when we have to send them over the ipc wire. This is also a useful pattern for persisting app state, since we encounter the same problem there.

Spectron

  • It's difficult to say how much of this is spectron and how much is chromedriver, but there are several new OS dependencies we need to install on centOS for our iTests to even begin to run. Thanks @jameskerr for chasing that down!
  • We also need to set the "--no-sandbox" flag since our tests are being run by the root user inside our CI container.
  • Previous versions of Spectron would create the directory provided as webdriverLogPath if it didn't exist but the current version does not, now we create it ourselves

Webdriverio (provides the primary api we use to programmatically interact with a browser)

  • Entire api has been "promisified", in some cases this allows us to simply await apiMethod() instead of using our own retry layers. Though this is not always the case.
  • api has also been refactored from browser.method(selector, methodOptions) -> browser.$(selector).method(methodOptions) in terms of the method input pattern. Since we are using async mode, this also means each method must be awaited/handled as a promise.
  • there are also several name changes, and in some cases methods have completely been removed and require us to write our own, see the changelist here

@mason-fish mason-fish force-pushed the 1044-upgrade_electron branch 10 times, most recently from 2f3ae04 to adbb2a2 Compare October 5, 2020 20:28
Mason Fish added 5 commits October 8, 2020 10:44
Signed-off-by: Mason Fish <[email protected]>
Signed-off-by: Mason Fish <[email protected]>
Signed-off-by: Mason Fish <[email protected]>
Signed-off-by: Mason Fish <[email protected]>
Signed-off-by: Mason Fish <[email protected]>
@mason-fish mason-fish changed the title upgrade electron 7.3.2 -> 10.1.2 (latest) upgrade electron 7.3.2 -> 10.1.2 Oct 8, 2020
@mason-fish mason-fish requested a review from a team October 8, 2020 19:16
zealot/index.js Outdated
@@ -0,0 +1,42 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file can be deleted now. The zealot stuff lives in dist/index.js

Copy link
Member

@jameskerr jameskerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one comment to delete the old zealot/index.js but then ship it!

Signed-off-by: Mason Fish <[email protected]>
@mason-fish mason-fish merged commit 4e93ec9 into master Oct 9, 2020
@mason-fish mason-fish deleted the 1044-upgrade_electron branch October 9, 2020 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Electron upgrade
2 participants