-
-
Notifications
You must be signed in to change notification settings - Fork 560
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
Update to Electron 7 #1157
Update to Electron 7 #1157
Conversation
It doesn't seem like `RequestHeaders` is provided by `electron` anymore. From docs on `webRequest.onBeforeSendHeaders` [1], `requestHeaders` is typed as an optional `Record<string, string>`. 1: https://electronjs.org/docs/api/web-request#webrequestonbeforesendheadersfilter-listener
This interface is no longer present in `electron` but it spelled out in the docs [1] 1: https://electronjs.org/docs/api/web-request#webrequestonsendheadersfilter-listener
This might've been needed if `requestHeaders` wasn't defined on the prior `OnSendHeadersDetails` interface.
`shell.openExternalSync` was deprecated in electron/electron#18179 Since it is no longer present, it should be replaced with `shell.openExternal`. This is not a synchronous function and since the full context of these functions is unclear to me, `async`/`await` syntax is used.
There are some non-blocking warnings that I will also try to address:
|
This fixes my issue that I opened up yesterday too #1153 😄. |
It's unclear to me how to resolve the lint error on |
Just use a |
This supresses the following error when using `npm run lint`: ``` ✖ 20:8 IpcMain is defined but never used. @typescript-eslint/no-unused-vars ``` Note that an `// @ts-ignore` directive did not supress this error, I guess because the linting engine `xo` performs typescript linting with `eslint`.
Dark mode following system appearance doesn't have to go in this PR, but pretty much all the existing logic for it seems to have been deprecated. I've been trying to get this to use the new The import statement Anyways, it appears some code needs to be shuffled around here. I can send |
resourceType: string; | ||
referrer: string; | ||
timestamp: number; | ||
requestHeaders: Record<string, string>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to manually type this now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem to be present in the electron
library. I'm not sure why
This was fixed in electron 7.1.1
From `npm run lint`: ``` source/index.ts:466:5 - error TS2532: Object is possibly 'undefined'. 466 options.webPreferences.nodeIntegration = false; ~~~~~~~~~~~~~~~~~~~~~~ source/index.ts:467:5 - error TS2532: Object is possibly 'undefined'. 467 options.webPreferences.preload = path.join(__dirname, 'browser-call.js'); ~~~~~~~~~~~~~~~~~~~~~~ ```
Addressed merge conflicts, resolved some questions and using later Electron version to avoid that type hack. |
Thanks 🙌 |
I was complaining about a system vibrancy problem in #1091 and it was indicated that to fix the issue properly on Catalina it was necessary to wait for the next version of Electron to be released. It was indeed released a week ago.
This PR updates the version and then fixes the errors that I saw running
npm install && npm start
.(It does not appear to fix my original complaint, any additional work will go in another branch)