4 ms·
the same way that the JVM works, at least in theory. You have the base virtual machine installed, and then the app just needs to ship the code itself. You cou
by rtpg 9y ago
the same way that the JVM works, at least in theory.
You have the base virtual machine installed, and then the app just needs to ship the code itself.
You could even ship with an "install script header", like "if this isn't installed, offer to download and install it". I imagine a lot of us have seen these kinds of installers before.
- jancsika 9y agoI don't understand how that would be different than Electron or nw.js. For example, if there were a Debian package for either of those, all apps leveraging them would just declare that same package a dependency and you'd have a single system-wide install for the large binary everyone keeps complaining about. (AFAICT there is no such deb package for any of the above.)
- Crespyl 9y agoElectron is designed to be bundled into your app, I'm not aware of any distros/package tools that allow Electron apps to share a runtime. The JVM (and apparently qbrt) is designed to be shared, apps are expected to use the installed system version of the VM, though if the packager wants they can include a specific version to use. I wish it were easy/possible to get Electron apps to share things, it bothers me that Chrome, Discord, and Slack almost certainly could share most of their hundreds of megabytes.
- jancsika 9y agoIt appears both electron and nw.js can be installed through npm (though the electron one is more up-to-date than the nw.js one: https://www.npmjs.com/package/nwjs https://www.npmjs.com/package/nwjs and electron: https://github.com/electron-userland/electron-prebuilt https://github.com/electron-userland/electron-prebuilt
- iipin 9y agoBut your distributed applications certainly do not use those installed by npm, right?
- roryisok 9y agoYou can install electron globally but if you package your app to target electron prebuilt you'd have to require the use to have installed both it and nodejs already. It's not completely bonkers. It could be possible to make a web installer that checks for node and electron and downloads them if necessary. Nobody seems to do that though. Every electron app bundles electron. At least every one I've seen
- rtpg 9y agoPart of the problem here is that the entire JS ecosystem is built around local copies of things, so there might not be a lot of institutional knowledge in that corner of OSS to pull off the "shared env" thing quite well. That plus scarring from browser differences over N years. Of course it's still totally possible, but there are probably gotchas that aren't obvious if you're mainly a web developer.
- scriptproof 9y agoYou may bundle the Electron runtime in an app or not. An app is started by "electron main.js", so once Electron is installed you have just to download an app and create an icon. Example with https://github.com/Scriptol/Advanced-Editor https://github.com/Scriptol/Advanced-Editor