Skip to content

Conversation

mtgto
Copy link
Collaborator

@mtgto mtgto commented Apr 6, 2021

closes #151
There are breaking changes:

Set enableRemoteModule to true

Since Electron v9, BrowserWindow.webPreferences.enableRemoteModule is false in default.
https://www.electronjs.org/docs/breaking-changes#default-changed-enableremotemodule-defaults-to-false

Another breaking change since v7 to v11 doesn't effect current code.

Update spectron (and webdriverio)

Spectron v13 depends on webdriverio v6, which api is different with v4.
(v4 => v5 has many command changes)
https://github.com/webdriverio/webdriverio/blob/v5/CHANGELOG.md#v500-2018-12-20

Spectron 13.0.0 contains wrong type definition.
electron-userland/spectron#897
For now, I add overwrote type definition to fix compile error.

QuickFix wrong webpacking

Add "buffer/" to whitelist of webpack-node-externals.
Thus avoids runtime error for integration test: "Uncaught Error: Cannot find module 'buffer/'"

It might be resolved in latest webpack...? (I don't test yet)

Fix UnhandledPromiseRejectionWarning

Update electron-log to v4. v3 causes UnhandledPromiseRejectionWarning.

Update electron-mocha

I don't find the reason old electron-mocha blocks CI.
But I find latest electron-mocha and mocha resolves it.

mtgto added 2 commits April 6, 2021 23:03
Breaking changes:

Since Electron v9, BrowserWindow.webPreferences.enableRemoteModule
is false in default.
https://www.electronjs.org/docs/breaking-changes#default-changed-enableremotemodule-defaults-to-false

Update to spectron to match Electron v11.
spectron depends on webdriverio v6, which api is different with v4.
(v4 => v5 has many command changes)
https://github.com/webdriverio/webdriverio/blob/v5/CHANGELOG.md#v500-2018-12-20

Add "buffer/" to whitelist of webpack-node-externals.
Thus avoids runtime error for integration test:
"Uncaught Error: Cannot find module 'buffer/'"
It might be resolved in latest webpack...? (I don't test yet)

Update electron-log to v4.
v3 causes UnhandledPromiseRejectionWarning.
@mtgto mtgto requested a review from hokaccha April 6, 2021 14:08
@@ -0,0 +1,324 @@
// Type definitions for spectron v3.6.0
Copy link
Collaborator Author

Choose a reason for hiding this comment

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


app.on("ready", async () => {
// https://github.com/electron/electron/issues/13008#issuecomment-569363295
electron.session.defaultSession.webRequest.onBeforeRequest((details, callback) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It seems to be unnecessarily.

@mtgto mtgto force-pushed the update-electron-11 branch from f8e7ee2 to e597029 Compare April 7, 2021 12:17
@mtgto mtgto merged commit 99b309e into bdash-app:master Apr 17, 2021
@mtgto mtgto deleted the update-electron-11 branch April 17, 2021 02:17
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.

1 participant