-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support for electron-main process customization with DI #8076
Conversation
d71cef3
to
3c82aa0
Compare
Thank you for the changes! I fixed nitpicks I found, but I'm happy with this PR. Although I'm having trouble marking the |
I am fine with it, I do not really mind who's avatar is next to the commit. Is it a problem for you? |
Could you elaborate please in
|
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.
Tested on Windows.
- The Electron application works correctly.
- A workspace is correctly opened when doing
yarn start <path>
. - The
electron-main
contributions are picked up. - I can see the traces for when we close a window and the IPC connection shutdowns.
Alright, what exactly? It would be nice to share this info with others. I thought you will review my part instead of modifying and force pushing it; so we can see the changes. |
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.
looking at sample looks quite clean :+1 adding a short PR description about new architecture would be helpful in the future
Let's merge after the release, that's an arch change to merge in 3 days before the release. |
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.
@kittaakos the nitpicks I had were so insignificant that I didn't want to just ask when I could just fix it. Sorry if you don't like me pushing to your branch, I will not do it again.
2ff0ede
to
f875177
Compare
You are entirely right, I added a simple description in I also updated the PR description. |
These are interfaces really specific to electron. Someone importing those interfaces from a |
I just wanted to mention that GH has a feature that can help for such little "nitpicks", in a more transparent way: one can suggest changes, that the PR author can accept at the click of a button. See: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request#applying-a-suggested-change |
Why did we decide to pull code in |
As as a consumer of this change, I had the following understanding:
|
The original approach that the same extension can contribute entry point with overrides for Electron. It looks like this PR makes it impossible as well as breaking downstream extensions doing it. It is visible in the PR itself since window entry point was unnecessary moved to
that should not be necessary |
it needs more review for breaking changes
That does not matter, from a downstream project's perspective, it's not a change. I never referenced the electron-specific window implementation, and I had to depend on |
Discussed with @kittaakos offline. It is indeed no-op for down streams, but there is a concern with how we divide code on extensions and js modules:
Introducing new extensions to separate by APIs goes against it. It would be good to revert changes to |
It seems one of the force pushes broke the open new workspace command. No matter what I try to open, it does not open anything and I have the purplish status bar in the browser window. :/ I will fix it as part of the |
All the logic for the electron main process currently has to be added to our generators, making it hard to extend without committing to Theia. This commit re-arranges the way Electron is launched to allow people to more easily change the behavior of their application. Add a basic CLI to open a workspace by doing `app path/to/workspace`. CLI can be overriden by application makers by extending and rebinding `ElectronApplication.launch` and handling yourself the `ExecutionParams`. Signed-off-by: Paul Maréchal <paul.marechal@ericsson.com> Co-Authored-By: Akos Kitta <kittaakos@typefox.io>
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
f875177
to
f443971
Compare
OK, I have moved back everything that originally was under
I am looking into these now. |
To discuss: |
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
Small heads up that I'll look into this again not before the coming monday. |
packages/core/src/electron-common/messaging/electron-connection-handler.ts
Show resolved
Hide resolved
"electronMain": "lib/electron-main/update/sample-updater-main-module" | ||
}, | ||
{ | ||
"frontendElectron": "lib/electron-browser/updater/sample-updater-frontend-module" |
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 should belong to the previous entry point?
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.
Yes, true. Thanks!
My comments are minor, changes are looking good now. I have not tried though, waiting for the final version. |
Signed-off-by: Paul Maréchal <paul.marechal@ericsson.com>
Closing in favor of #8125 |
What it does
This PR consists of the
Closes #7964
Closes #8069
This PR contributes a JSON-RPC communication scheme between the
electron-main
process and therenderer
processes. It is reusing the same architecture as the websocket-based connection between frontend/backend, but adapted to work over electron's ipc apis. Currently there isn't scoped connections, meaning that each renderer process will interact with the same singleton in the electron-main process, but for the current use-cases this is sufficient.How to test
Review checklist
Reminder for reviewers