-
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
New @theia/example-hybrid
application
#2340
Conversation
@theia/example-hybrid
application
Currently having an issue when the electron client connects to the hybrid backend: The correct It looks like the AMD loader is assuming a |
be63c27
to
052ecd4
Compare
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.
The generator part looks good already :)
dev-packages/application-manager/src/generator/backend-generator.ts
Outdated
Show resolved
Hide resolved
Could you elaborate on:
|
When typing a URL to connect to, the |
5e92052
to
e28d4fa
Compare
I just realized that the issue I am having when trying to run the Electron Frontend from http seems to be unrelated to my changes. If you start an electron application, and then try to open
I currently don't really understand how to fix this. |
18286dd
to
9a79a02
Compare
Loader issues fixed by monkey patching what was failing \o/ |
0044994
to
616b07a
Compare
@akosyakov I think I have made good progress, if you want to check now and see if anything looks wrong. Last bit that bothers me is that @simark cc in case |
packages/core/src/electron-browser/remote/connection-state-service.ts
Outdated
Show resolved
Hide resolved
packages/core/src/electron-browser/remote/connection-state-service.ts
Outdated
Show resolved
Hide resolved
packages/core/src/electron-browser/remote/electron-application-location.ts
Outdated
Show resolved
Hide resolved
57ffb75
to
4d07884
Compare
Current state of the PR is that I am fighting with webpack/electron/packages in order to enable appropriate security settings (such as Packages often try to guess the environment, and when they detect Electron they just try to use every NodeJS API they can, when we don't want that. |
de2d2e4
to
de476f6
Compare
@theia/example-hybrid
application@theia/example-hybrid
application
@akosyakov I will consider this feature done, even though some security concerns are not fully taken into account. This doesn't add more security issues than before, as I am still using the mechanics already in place. My idea is that this is a feature that people could test for themselves and improve upon if they find it useful for their workflow. @thegecko pinging you in case you want to secure the feature. We could discuss about the technical details if you are interested in this problem. IMO connecting the Electron application to a remote server is an awesome use case, although my biggest issue right now would be the current instability of the client (the whole app sometimes shutdowns). Point is, for people that prefer native clients like me, being able to connect to workspace servers is very nice. |
Thanks for the heads up, I'm away until September when I will be available to revisit security of Theia. In the meantime don't wait on me to merge. |
e266d90
to
d18d9c9
Compare
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.
Hi Paul,
I did a first pass and have a few comments.
const loadMainWindow = (port) => { | ||
mainWindow.loadURL('file://' + join(__dirname, '../../lib/index.html') + '?port=' + port); | ||
const loadMainWindow = (uri) => { | ||
// mainWindow.loadURL(\`http://localhost:\${port}\`); |
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.
left-over code or example of mainWindow.loadURL()
usage?
{ | ||
"private": true, | ||
"name": "@theia/example-hybrid", | ||
"version": "0.3.11", |
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.
reminder: specific package and dependencies versions will need to be updated to whatever is applicable, at the time we merge.
"target": "hybrid" | ||
}, | ||
"dependencies": { | ||
"@theia/callhierarchy": "^0.3.11", |
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.
also we will need to update the dependencies, that might have changed in the other example applications, in the meantime
c08a613
to
cc62402
Compare
@marcdumais-work updated. |
@marechal-p when you have time, it would be good to rebase this PR. |
Add a new example package serving both web browsers and electron clients. Add new commands for electron to connect to remote servers. `electron.remote.connect` command to open a QuickOpenMenu and input an URL. `electron.remote.history.clear` command to clear the local URL history. `electron.remote.disconnect` to close the window in case you are connected to a server. Adds an endpoint to tell if it is a Theia application or not. Signed-off-by: Paul Maréchal <paul.marechal@ericsson.com>
cc62402
to
a9506fc
Compare
Based on new discussions and considerations, the following PR is considered as a POC instead, and more thinking would be required before proceeding. |
This PR adds support for an electron client to connect to an hybrid backend.
Currently done:
@theia/example-hybrid
package that can serve both web browsers and electron apps.@theia/example-hybrid
.How to test this PR:
node v8.2.1
, it should be the same as the one used by Electron, so that you don't have to rebuild native modules when starting@theia/example-electron
and@theia/example-hybrid
@theia/example-electron
and@theia/example-hybrid
so that you have a server to connect to.Remote: Connect to a server
.