6 ms·
Regardless of whether the HTML+JS+CSS stack is good for desktop apps... The one thing that bums me about Electron is that it bundles an entire web runtime with
by pavlov 10y ago
Regardless of whether the HTML+JS+CSS stack is good for desktop apps... The one thing that bums me about Electron is that it bundles an entire web runtime with each app, even though a suitable runtime already exists as part of the operating system.
Seriously, WebKit on Mac and Edge on Windows would be just fine for >99% of Electron apps. Using the available web runtime would be a tremendous saving both in build size and memory usage.
Did you know that Chromium contains 25.3 million lines of code? [1] Each Electron app is bundling a separate copy of that enormous codebase in binary form. It's a terrible waste of memory.
It's true that supporting the native web runtimes would be more work for the Electron framework developers, and sometimes would also mean more work for app developers... But most web apps have absolutely no good reason to be tied to Chromium, so for app developers the diversity would actually be beneficial in the long term IMO.
If someone wants to start a project that's like Electron but uses the native runtimes, I'd actually like to contribute some work. Let's call it "Electrino"?
[1] https://twitter.com/worrydream/status/857794605076500480 https://twitter.com/worrydream/status/857794605076500480
- PaulHoule 10y agoIt just astonishes me how big the slack install is. It is like installing the latest video drivers from Nvidia or AMD.
- scarface74 10y agoWhat's the purpose of the Slack desktop app? What does it do that the web app doesn't?
- untog 10y agoPrimarily, it sits as its own entry in your task switcher, and can show the number of pending alerts you have. It also uses OS native notifications, though I know that's increasingly possible through the web too.
- scarface74 10y agoWhen I did use Slack to communicate with remote coworkers. I just kept a tab open - with notifications turned on. Most of the time I was working with three monitors anyway. Now that I only use Slack to communicate with former coworkers I just keep it on my phone.
- efdee 10y agoOnly having to target a single browser does make life easier for application developers. It's like programming for the web, but without the hassle of cross-browser compatibility.
- awjr 10y agoLook at it from a product owner's perspective. I want 100% of users to have the same experience. Electron bundling a web runtime that gives the same experience on each platform is absolutely key to giving them the same experience. There may also be security issues to consider.
- bkor 10y agoThat web runtime doesn't ensure that people have the same experience. You're still relying on the abstractions of that runtime. Plus that there haven't been any changes to it.
- hashkb 10y agoCan you elaborate? Are you saying that Electron apps have portability issues?
- pavlov 10y agoLook at it from the computer owner's perspective. I don't want your experience if it comes with 100+ MB of redundant code.
- hashkb 10y agoIsn't that size arbitrary? Downloading and storing a 100mb program takes the same (or less) fraction of your available resources today as downloading and storing a 1mb program in 1995. Are you short on disk space? Download is too slow? Is this a real problem?
- pavlov 10y agoDownload size is relatively harmless; size on disk is an annoyance and a real concern (a lot of laptop users have an SSD in the 128-256 GB range); but memory footprint is the real killer for me. I don't want every little widget to consume hundreds of megs of memory. In 1995 my computer had 8 or 16 MB memory... Having a 1 MB app running in the background would have been huge. I certainly don't want to go back to that era.
- mijoharas 10y agoFor me, I'd just love it if progressive web apps would have a desktop offline install mode that allowed them to deliver notifications, a desktop icon, and a separate window. I was expecting this to happen after chrome discontinued their "chrome apps", that the underlying tech would come back with progressive web apps, but I haven't seen anything in that space. I think it would solve the problems with Electron apps (wouldn't have to rebundle the runtime for a massive binary size and massive memory use). If anyone knows if anything is happening in this space (progressive web app installation for desktop) please let me know.
- crucialfelix 10y agoI am looking forward to more PWA and I agree this would replace most use cases for Electron, but not all. If it's just a web app (network, localStorage etc) then it would be fine. But if you need to read/write to the user's filesystem or need to include other executables then we can't run that in our browser. We don't want a webbrowser to have any possible path to screwing with your filesystem or running executables.
- gcoda 10y agoThere is a flag for it. I was surprised that my website 'installed' on my Linux PC, created a '.desktop' file and launched in a separate window. It works now, only bug I encountered is asking 'add do desktop' while I already launched it from desktop
- mijoharas 10y agoReally? Awesome! What is the flag? I couldn't find it when googling about for information a few weeks ago. EDIT: Found this: https://mobile.twitter.com/nolanlawson/status/712668097216438273 https://mobile.twitter.com/nolanlawson/status/71266809721643...
- k__ 10y agoIsn't this more of a philosophical problem? Static binding vs dynamic binding? Bundling everything up so no outside deps are needed vs using everything that is on the system to save space?
- pavlov 10y agoYes, and I wish developers could make that choice more easily. The Electron approach is fine for genuinely large applications. But I've seen many Electron-based Mac desktop apps where the UI has a handful of elements. The equivalent Cocoa app would be maybe 100 kB. I understand that people won't learn Cocoa just for tiny UIs, so it would be really nice if there were a mostly Electron-compatible solution that would use the system web runtime which is already there (and probably already loaded in active memory).
- k__ 10y agoIt's funny somehow. They built a framework for, as you say, "genuinely large applications" but it seems to be so easy to use that it's used especially for small ones.
- bbcbasic 10y agoAnd if you are building a large app you'd benefit from a statically typed language with better native data type support than JS.
- pavlov 10y agoWell, why wait. I made a repo for "Electrino": https://github.com/pojala/electrino https://github.com/pojala/electrino Sorry, it's totally empty! But I'm hoping to get around to making a Cocoa+WebKit proof-of-concept this week. I guess the starting point would be to implement just enough APIs to be able to run the main.js example from this Electron tutorial: https://github.com/electron/electron/blob/master/docs/tutorial/quick-start.md https://github.com/electron/electron/blob/master/docs/tutori...
- WorldMaker 10y agoAnother direction might be to extend Cordova to support macOS and Linux. Cordova already supports building UWP for Windows Desktop/Xbox/HoloLens using the native HTML+JS stack. Seems to me like a lot of existing Cordova plugins just need subtle nudges to support macOS in addition to iOS. Then you just need a good Linux solution and you cover all the desktop environments. Then narrow the few missing desktop-focused APIs that Electron has but Cordova doesn't have good plugins for. (It would also be nice to support more Node-like background processes in Cordova and more Node-native libraries, but you would need to find a good balance that plays well with mobile.)
- roboguy12 10y agoThere's also React Native, which can work on macOS (https://github.com/ptmt/react-native-macos https://github.com/ptmt/react-native-macos). I'm not sure about other operating systems, though.
- giaour 10y agoMicrosoft has put out an implementation for Windows, too: https://github.com/Microsoft/react-native-windows https://github.com/Microsoft/react-native-windows
- pavlov 10y agoUpdate on Electrino: implemented minimal APIs to load Electron's "Hello World" example. Code is in the repo.
- theflork 10y agoOpenFin claims to have remediated the memory issues of electron somewhat. https://openfin.co/2016/11/04/openfin-slashes-electron-memory-78/ https://openfin.co/2016/11/04/openfin-slashes-electron-memor...
- skdotdan 10y agoOr even Chrome itself.
- mmgutz 10y agoThe con is not all browsers support the same features. Sure, we've come along since IE6 and Mozilla but if I'm creating a web-based desktop app, I want to deploy with 100% certainty that the CSS/JS I used works exactly the same when I was developing it.
- pavlov 10y agoUpdate: I decided to build a proof of concept for Electrino. It can run a "Hello world" now. Here's the Show HN: https://news.ycombinator.com/item?id=14260755 https://news.ycombinator.com/item?id=14260755