2

I know my title sounds crazy, as right now the popular practice is to use something like Electron or nw.js for desktop applications written using web stack technologies, but here's why I'm searching for alternative desktop web runtime solutions:

  • I need to minimize the maintenance of both a desktop app and web app that both behave identically, ideally by consolidating the code as much as possible into a single repository.
  • BUT the desktop app can't run using chromium-backed Electron or nw.js because it absolutely must run on Centos 6, which isn't officially supported by either (and I've sufficiently beaten my head against the wall trying).

So, to minimize code paths and maximize compatibility, my options appear to be:

  1. Wait 2.5 years for Centos 6 maintenance updates EOL (hopefully forcing customer migration)
  2. Give up and deal with maintaining both a java GUI and web app as separate code entirely.
  3. Re-purpose my web server for local desktop execution, so that it serves the same HTML/CSS/javascript but for access on localhost in whatever browser locally installed.
  4. Use JavaFX and reuse (at least some of?) my javascript/css code inside a webview GUI element.

Has anyone else tried to bridge this gap to consolidate desktop apps and web apps when unfortunately Electron/nw.js aren't viable? Or does the simplification I'm searching for simply not exist?

ecoe
  • 4,994
  • 7
  • 54
  • 72
  • Can you run Electron in a Docker container on your Centos machine? That might be a possible cross-platform solution for you. Perhaps this would be helpful: https://stackoverflow.com/questions/39930223/how-to-run-an-electron-app-on-docker – Matt Morgan Jul 02 '18 at 00:29
  • Thanks @Matt Morgan. Although I haven't given it quite a fair try, my understanding is docker no longer supports centos 6. I suppose I could use an old version of docker, but then would that old version be able to support Electron you think? – ecoe Jul 02 '18 at 00:32
  • It's a fair question. I don't know the answer, but maybe a little digging and experimentation will give you the answer. It certainly sounds better than maintaining two different implementations. – Matt Morgan Jul 02 '18 at 00:37
  • I'm quickly gaining interest in this idea, but my only other reservation is that customers would be weary figuring out how to install docker on their machines. Is there a simplified way, maybe by distributing [docker binaries](https://docs.docker.com/install/linux/docker-ce/binaries/)? – ecoe Jul 02 '18 at 00:50
  • I would create a nodejs application that can be viewed from within the Browser. It can still access system resources then. – Hans Koch Jul 02 '18 at 07:42
  • @HansKoch thank you, that idea intrigues me as well. The only two concerns then would be maintaining compatibility with old browsers and [protecting the source code](https://stackoverflow.com/questions/5951302/node-js-code-protection), which appear to be the only downsides. – ecoe Jul 02 '18 at 12:24
  • You can use the asar format outside of electron, which is the "protection" electron delivers i awnsered another question with in depth explaination about this https://stackoverflow.com/questions/50033184/electronjs-code-protection-2018/50042857#50042857 For maintainability i would not be too concerned about it, browser and js specs are not changing drastically anymore. You can keep the nodejs version at a certain version too just keep in mind to use the recent LTS. – Hans Koch Jul 02 '18 at 12:39

1 Answers1

1

https://xpda.net offers a quick pros/cons list of alternative tools for Cross-Platform Desktop App (XPDA) development.

Jaredcheeda
  • 1,657
  • 17
  • 15