It would be cool to support electron desktop apps in Gitpod, like for example:
So I tried running the nuclear web app in Gitpod's web preview (i.e. outside of electron), using these webpack-dev-server parameters:
--host=0.0.0.0 --allowed-hosts=.gitpod.io --target=web
The app loading screen does show up, but the app is mostly broken, likely because it's missing some electron features:
TypeError: fs.existsSync is not a function
Another option to support electron apps could be to run electron via noVNC.
We do have VNC support in Gitpod that could be handy here (basically noVNC): https://medium.com/gitpod/developing-native-ui-applications-in-gitpod-15af2967c24e
Running Electron apps directly in the web browser sounds like a lot of functionality from Electron would need to be available in the web browser... does Electron provide a solution for this?
Because if not, the options that I see are:
We should definitely go down the VNC route, as you cannot run electron apps in a browser (having access to node and some electron specific apis that bind to the OS is whole idea of it)
@jankeromnes did you try VNC?
@svenefftinge I agree about VNC, but haven't tested it yet. It's the next thing I was planning to do when I cycle back to this issue.
I think we should close this ticket, as Gitpod already supports Electron apps.
Chris' post shows how to run Vs Code which is an electron app.
So, I've now got https://github.com/nukeop/nuclear running in Gitpod:
Here is what the config looks like:
https://github.com/jankeromnes/nuclear/commit/c52e4ae40ada932e4ef473ff856ba36fa6d4a1d0
A few obvious UX problems:
Nice! Do you have suggestions how that could be improved?
We don't have that problem on Janitor, and I see a few differences in the x11vnc/Xvfb/noVNC options we use:
The differences are:
Xvfb options -pn (accept failure to listen on all ports) and -noreset (don't reset after last client exists)x11vnc option -shared (allow more than one viewer), and doesn't use -localhost (only accept localhost) or -forever (don't exit if first client disconnects)vnc.html from a full noVNC build, while Gitpod just serves an unbuilt vnc_lite.htmlutils/websockify into noVNC, for some reasonI suggest we start by adding options Xvfb -pn -noreset and x11vnc -shared to our gitpod/workspace-full-vnc image. I'll do that.
Most helpful comment
I think we should close this ticket, as Gitpod already supports Electron apps.
Chris' post shows how to run Vs Code which is an electron app.