3 ms·
Yesterday there was a thread on HN about using Electron to build desktop apps: https://news.ycombinator.com/item?id=14245183 https://news.ycombinator.com/item?
by pavlov 10y ago
Yesterday there was a thread on HN about using Electron to build desktop apps:
https://news.ycombinator.com/item?id=14245183 https://news.ycombinator.com/item?id=14245183
I posted a comment lamenting that Electron apps are so big because each contains a full set of the Node + Chromium runtimes, and proposed a lightweight version of the same concept using the system-provided web browser engine.
The idea seemed interesting, so I spent some time today putting together a minimal proof of concept.
This initial version of Electrino can load the "Hello World" example from Electron's quick start guide -- and that's pretty much it! With that enormous caveat, the difference in file size is huge. The Electron version sizes up to 115.7 MB, while the Electrino version is 167 kB.
I'm curious if this could be turned into a real project. Anyone out there with a small Electron-based Mac app that you'd like to put on an Electrino diet? Ping me, and let's see if we can make it work!
- JusticeJuice 10y agoThis is super duper cool. Slack and discord could immediately become 1/20th the size. A lot of electron apps don't need the full capabilities of electron - what would be dope is if you could selectively add packages for these things. The other huge downside of electron is performance - particularly with complex apps. If you could make any headway into that, I'd be 110% on your side.
- giancarlostoro 10y agoI don't have an Electron project going, but I can tell you something like this could add some value to some companies invested in Electron as-is. You just have to get their attention. I would suggest maybe resubmitting this post later if it doesn't catch the flare of intrigue. If I do end up building an Electron Project I will definitely look into Electrino when the time comes. You mention it doesn't feature all the features of Electron but is the typical browser DOM still available?
- pavlov 10y agoThanks! The full browser DOM is certainly there. The missing APIs are the Electron-specific ones that apps can use to access desktop features. Adding new APIs individually is pretty easy, but there's a lot of stuff in Electron, so reaching full coverage is of course a lot of work... That's why I'd like to try adding APIs based on usage in real-world apps, "filling in the gaps" so to speak. I wrote a blog post with some more details about the rationale behind Electrino: https://medium.com/@pauli/put-your-electron-app-on-a-diet-with-electrino-c7ffdf1d6297 https://medium.com/@pauli/put-your-electron-app-on-a-diet-wi...
- 52-6F-62 10y agoThis could be big. One of the most common complaints about Electron I've heard is the file size and cpu load. In short, nice work! I know it would add extra time to the build on the programmer end, but what about component API's -- to keep build size at a minimum while allowing access? I haven't looked at any of the code -- would this be possible? Any thoughts?
- wishinghand 10y agoA lot of people have griped about the bloat of Electron, or wondered why package each app with Chromium over and over, but you went and did something about it! This is rad and I'll be following avidly.
- styfle 10y agoI started a project call magnemite[0] that records the window and saves to disk. It's not done but it only makes a few API calls. [0]: https://github.com/styfle/magnemite https://github.com/styfle/magnemite