-
Notifications
You must be signed in to change notification settings - Fork 210
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
#9 Upgrade Electron to v24 #164
Conversation
@@ -28,7 +27,8 @@ if (micromatch.isMatch(window.location.origin, originsAllowed) || protocolsAllow | |||
}); | |||
}); | |||
setTimeout(() => { | |||
ipcRenderer.sendTo(workerWebContentsId, 'bx-api-perform', channel, payload); | |||
ipcRenderer.invoke('get-worker-contents-id') |
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.
Perhaps store the result of this call so we just have to call it once per process.
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.
Perhaps store the result of this call so we just have to call it once per process.
I have doubts about this suggestion
Should we create a module for this purpose?
and then use it like
const id = require('some-new-module').workerWebContentsId
What is the right place to put it?
Is this worker-id
available in any moment of time and code? What if we ask for it too early?
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.
A module seems a little overkill, I was more thinking just storing the result of the call in a variable in the file itself
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.
That was my first version :)
Like this
const workerWebContentsIdPromise = ipcRenderer.invoke('get-worker-contents-id');
const sendPerformToProxy = (channel, payload) => {
const p = new Promise(resolve => {
ipcRenderer.once(`bx-api-perform-response-${channel}`, (_, result) => {
resolve(result);
});
});
setTimeout(() => {
workerWebContentsIdPromise
.then(workerWebContentsId => ipcRenderer.sendTo(workerWebContentsId, 'bx-api-perform', channel, payload));
}, 1);
return p;
};
But the same concern about requesting it too early.
And setTimeout
here looks like brute workaround, so I decided not to touch it and to keep as is.
@@ -40,7 +40,8 @@ if (micromatch.isMatch(window.location.origin, originsAllowed) || protocolsAllow | |||
}); | |||
}); | |||
setTimeout(() => { | |||
ipcRenderer.sendTo(workerWebContentsId, 'bx-api-subscribe', channel); | |||
ipcRenderer.invoke('get-worker-contents-id') |
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.
IDEM
Co-authored-by: Joël Charles <[email protected]>
Migrated to node@18, the build version works, but To fix that, we have multiple solutions:
All those solutions are not trivial. Finding a way to force/monkeypatch I will not have time to continue working on this for the next few weeks, so feel free to take over this subject. |
But I have the same test error with Node 18
hence Node upgrade won't help with this problem |
6fd440b
to
430f8a9
Compare
The test is fixed, it was due to some weird import issue 🤷♂️ Now only remains to fix |
I think we should migrate to Node 18 in a separate PR |
I also moved your yesterday commits to separate branch |
Electron 24 is tied to Node 18, so migrating one without the other is not a complete PR and will lead to unexpected behaviour. |
I found a quick way to monkeypatch crypto usage in webpack, the PR should be all good now |
7059c7a
to
415b189
Compare
@viktor44 Good to merge on my side. Ok for you too? |
absolutely |
What is this PR
Upgraded to Electron 24
Fixed issues