Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Upgrade to Electron 13 #1230

Merged
merged 33 commits into from Jul 19, 2021
Merged

Conversation

TheCleric
Copy link
Collaborator

@TheCleric TheCleric commented Jun 16, 2021

This PR upgrades Nativefier to Electron 13. It will stay in draft until we feel its well tested.

Major Version Checklist

  • Wait a few weeks to let it stabilize. Never upgrade Nativefier to a .0.0.
  • Thoroughly digest the new version's breaking changes, grepping our codebase for every changed API. If called for by the breaking changes, perform the necessary API changes
  • Bump src/constants.ts / DEFAULT_ELECTRON_VERSION & DEFAULT_CHROME_VERSION and app / package.json / devDeps / electron
  • On Windows, macOS, Linux, test for regression and crashes:
    • With npm test and npm run test:manual
      • MacOS
      • Windows
      • Linux (@ronjouch can you handle this?)
    • With extra manual testing
      • MacOS
      • Windows
      • Linux (@ronjouch can you handle this?)

@TheCleric TheCleric requested a review from ronjouch June 16, 2021 18:39
@TheCleric
Copy link
Collaborator Author

Actually this will continue to be an issue on Mac. I realized in my test that I had a user agent override that gave me a false success. Without a user agent override, v13 as of 13.1.2 still crashes on load in Mac.

See

electron/electron#29343

@ronjouch
Copy link
Contributor

@TheCleric

This PR upgrades Nativefier to Electron 13. It will stay in draft until we feel its well tested.

👍!

Let me know how else we'd like to attack this

I dumped my usual workflow at https://github.com/nativefier/nativefier/blob/master/HACKING.md#major-updating-electron

Actually this will continue to be an issue on Mac. I realized in my test that I had a user agent override that gave me a false success. Without a user agent override, v13 as of 13.1.2 still crashes on load in Mac. See electron/electron#29343

Alrighty, let's keep this PR as draft until this is fixed.

@ronjouch
Copy link
Contributor

ronjouch commented Jul 1, 2021

@TheCleric wheeeee, I see that https://github.com/electron/electron/releases/tag/v13.1.5 was released, featuring:

Fixed crashes on macOS when Geolocation was used. #29912

@TheCleric
Copy link
Collaborator Author

Breaking changes checklist:

  • API Changed: session.setPermissionCheckHandler(handler)
    • NOTES: Not used
  • Removed: shell.moveItemToTrash()
    • NOTES: Not used
  • Removed: BrowserWindow.addExtension(path)
    • NOTES: Not used
  • Removed: BrowserWindow.addDevToolsExtension(path)
    • NOTES: Not used
  • Removed: BrowserWindow.removeExtension(name)
    • NOTES: Not used
  • Removed: BrowserWindow.removeDevToolsExtension(name)
    • NOTES: Not used
  • Removed: BrowserWindow.getExtensions()
    • NOTES: Not used
  • Removed: BrowserWindow.getDevToolsExtensions()
    • NOTES: Not used
  • Removed: systemPreferences.isDarkMode()
    • NOTES: Not used
  • Removed: systemPreferences.isInvertedColorScheme()
    • NOTES: Not used
  • Removed: systemPreferences.isHighContrastColorScheme()
    • NOTES: Not used
  • Deprecated: WebContents new-window event
    • NOTES: We are still using this, and should migrate off when we can, but for now new-window provides functionality that the new setWindowOpenHandler does not yet support.

@ronjouch
Copy link
Contributor

Wheee. Will test under Linux soon and report here.

@ronjouch ronjouch marked this pull request as ready for review July 16, 2021 23:00
src/constants.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@ronjouch ronjouch left a comment

Choose a reason for hiding this comment

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

🎉 , test:manual is all good on Linux!

I also:

  • Fixed two warnings about now-useless DT types, see 5d9cb91
  • Merged master into your branch
  • Bumped the default Firefox version

Feel free to merge this whenever you're done with Windows tests; I'll cut a release

@TheCleric
Copy link
Collaborator Author

@ronjouch everything seems good here!

@TheCleric TheCleric merged commit bf4be86 into nativefier:master Jul 19, 2021
@TheCleric TheCleric deleted the feature/electron_13 branch July 19, 2021 17:03
@ronjouch
Copy link
Contributor

@TheCleric 👍, released in https://github.com/nativefier/nativefier/releases/tag/v45.0.0 , now on npm.

Adam777Z pushed a commit to Adam777Z/nativefier that referenced this pull request Nov 9, 2022
* Catch promise errors better

* Move subFunctions to bottom of createNewWindow

* Use parents when creating child BrowserWindow instances

* Some about:blank pages have an anchor (for some reason)

* Inject browserWindowOptions better

* Interim refactor to MainWindow object

* Split up the window functions/helpers/events some

* Further separate out window functions + tests

* Add a mock for unit testing functions that access electron

* Add unit tests for onWillPreventUnload

* Improve windowEvents tests

* Add the first test for windowHelpers

* Move WebRequest event handling to node

* insertCSS completely under test

* clearAppData completely under test

* Fix contextMenu require bug

* More tests + fixes

* Fix + add to createNewTab tests

* Convert createMainWindow back to func + work out gremlins

* Move setupWindow away from main since its shared

* Make sure contextMenu is handling promises

* v13.1.2

* v13.1.4

* Update Webkit version for Safari

* 13.1.6 -> NO CRASH!

* Fix types/debug build error on Ubuntu

* 13 -> 13.1.7

* Bump default Firefox version

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants