At Oursky, we built several apps with electron.
We find that it's easy to set up, you can use npm packages. Yet the build size is quite big and it might not support all native features. What's your thoughts?
We find that it's easy to set up, you can use npm packages. Yet the build size is quite big and it might not support all native features. What's your thoughts?
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
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.
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.
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/tutori...
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.)
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?
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).
https://openfin.co/2016/11/04/openfin-slashes-electron-memor...
Here's the Show HN:
https://news.ycombinator.com/item?id=14260755
No, it is a terror. Applications produced with it are bloated monstrosities, gobbling up hundreds of megabytes in both storage and RAM before getting round to as much as putting a checkbox on screen. Bundling an entire web browser inside your program in order to provide portable GUI functionality like what Tk managed more than twenty years ago without breaking a sweat, and at roughly 1/100 the size, yeah, sure, it flies. So did the Spruce Goose, sort of.
But then, I never took to js, I never took to Chrome, I never took to bloat as a way of life.
[edit: typo]
It is totally embarrassing that programs are 100-1000 times the size they used to be, and slow. I think it shows an overall disinterest in our tooling and field, and it's shameful.
When unpacked, it weighs about 100MB. This disk space costs roughly £0.004 for an HDD or about £0.020 for an SSD.
In exchange for these extra costs, I get to use HTML, CSS and JS on both our website and our desktop applications and they get to share the same codebase. That alone must saves me 50% of the time. The fact people might have to spend upto 3 more minutes to download my application and that it costs them 2p to install it on their SSD is minimal compared to the fact that I can have twice as many features in the same amount of time.
However, as the team and product grow up, it becomes less acceptable as users expect more performance by going more native and deeper integration with the OSes.
Sorry but Electron is not the future for me. I dislike the memory consumption it eats up. There is nothing acceptable about a simple chat app eating up 1GB of memory when the identical IRC client I had was using 100KB and has more features and the same client was built back a long time ago.
As for others talking about how there's plenty of disk storage and memory, that's lazy. We're losing a generation of native coders to people who only know about Javascript and never taking the step to learn more about how bare metal works, effectively losing all the knowledge of optimizations, iterations and programming skills we've learnt in the past three decades.
I can assure you, you can stick with Electron apps only for your business but the moment I find a native version of the same apps, I'm done with your business too. Slack, VS Code/Atom, etc, none of them are on my recommendations list and they will never be until they either go native or there's a native competitor. Sublime Text destroys VS Code/Atom completely and yet, the version they've built 5+ years ago is still better than Code/Atom today in pure performance despite all of improvements Atom has done.
I suspect we'll see us going from Electron > React-Native or identical and then realizing the benefits of native stuff and back to native code once MS/Apple/other OS try to replicate the ease development process with their languages like Swift, C#, Go, and etc.
First why would you use web technology to build a desktop app? I could understand if their wasn't a cross platform answer like python and java that are high enough languages that even middle school kids can learn to make desktop apps with. Yet lets default to language and markup language specifically design for a client server relationship.
Secondly from my experience electron runs horribly on linux and windows. I can always tell a desktop app uses electron on my desktop not just by the larger then normal amount of resource it takes to do simple task, but because it will randomly crash. It crashes silently and instantly reboots it self and try to act like nothing happen but it happens so often that I catch it when it does.
Thirdly, I am not about to act like I am some type of security expert, but this is just screaming at me security risk. Electron uses at least 4 engines, how and when do they get updated and security patches installed? Can the programmers stop upgrades of these engines to insure that their app will continue running as is? You can argue all things are security risk, but when you put so many complex engines in one app it is bound to make it difficult to keep up with all the security concerns.
I could keep coming up with more and more reasons why electron is horrible solution to a problem that already has solutions. The appear to webs to keep using technology they are comfortable with is horrible reason to justify this Frankenstein of a code base.
Literally the only advantage of this is the lack of DOM related performance issues. Support for mobile is probably a nightmare and you still have to make the website anyways, so might as well write it once. Also trying to combine cross platform, speed, and 3 sounds like it's own nightmare anyways.
> Java
Much more practical option, main cons involve large JRE download and I still have to write my website in JS anyways, so why write it twice? React Native really brings the mobile performance up to par that fits 95% of non-game use cases.
This next statement is not directly related to the parent comment: I'd like to read more about why eletron alternatives are better (or exist) and less about how electron is slow or some other thinly veiled hand-wavey "bad because js".
>Java Again if you are making a desktop app why would you also need a website performing the same task? React Native is for mobile apps electron is for desktop apps so I don't understand why you are bring this up as well.
Electron exist same reason nodejs exist webbies to scare to learn another language. JS isn't bad, but how people use it makes it bad. I should actually say programmers are to scare or lazy to learn alternative solutions to a problem. It is simpler to use what you already know then to try something else. What does electron bring to the table? A way for someone that know JS, css, and html to produce a cross platform desktop app that is it. You don't gain performance, security, and it isn't the only cross platform solution like Java once was. People use to use Java only because it was the only cross platform solution. It had horrible memory leaks and all sorts of issues that still plague it to today. Yet it was the only cross platform desktop solution of its time. That is why electron is seen as useless to me I know how to program in c, c++, c#, JS, and elixir. I would probably learn python stack if I wanted a cross platform solution to a desktop app.
1. Ease of building and distributing packages with Electron-Builder. I'm able to build for all three operating systems on my Mac, took a few hours to set up.
2. Access to the vast NPM library for all sorts of functionality.
3. Ability to use CSS libraries for styling. I'm no designer so it saves me some time. Collate uses Bulma for styling.
From what I've seen, users are more than happy to have an application that solves their need no matter what it's created in. Most people don't really think about file sizes, or the fact that Chromium is packaged with Node, they just want their problem solved without visual or performance hiccups.
If it wasn't for Electron, Collate would be a very different application or non-existant. I think people need to look at Electron as opening the door to more possibilities.
- You can find libraries for "all sorts of functionality" with ease for native languages - Swift, C#, Python (Mac, Win, Linux).
- In the end the ability to use CSS is harming user because now you don't have default OS element styling and every app is using it's own styling for things like buttons - this is very bad.
Exactly. If you're building an app yourself you'd never have the resources to make a native app for Mac, Windows and Linux. Nothing is perfect in software development. Electron is a decent tradeoff for certain projects. Regular customers aren't going to even consider disk space or memory usage unlike many vocal commenters in this community.
To be frank, most users often don't have a better performant alternative (outside of maybe a browser tab) so it seems like a redundant point.
The disadvantage that is most talked about is its final bundle size, and I'm not aware of any developments that are trying to solve it. I'm in a project with a number of Electron apps built and in the pipeline, and we're searching for a potential in-house solution, of a central app that hosts/downloads/embeds "mini-apps" that run on the same foundation, to share the same Chromium run-time. Really hoping for a community solution to this though.
https://github.com/electron/electron/issues/673
It got a bit daunting to see in more detail the potential complexity of the problem. Someone noted in the comments here, that there have been countless attempts at solving this "shared runtime for cross-platform apps" idea, apparently with a still unsatisfactory history.
Reading through the thread does give me hope, since the discussion is on-going after 2+ years, which means people are interested in an efficient solution. Seeing the HN crowd go at this Electron topic again and again, always with a kind of emotional "turbulence", implies that this is a worthy problem to solve.
I like that one of the recent suggestions is to "split the Electron", to accommodate bindings with theoretically any language.
Electron has made me forget those days! Today, most of the tools I use are available on all platforms and while they do take up a lot more ram and disk space - both are generally things I can buy and fit on my computer and will be supported out of the box but not having those apps won't.
I know it's great to hate Electron because of how much ram and disk space it takes, but for those few on Linux, it's truly made life easy!
As you may surmise, I do not entirely agree with you: I have tried the odd Electron application, but I don't think any of them lasted a week on my desktop. It's not just the bloat in itself. Software built on what I consider iffy technologies - somehow I never really manage to trust them or just feel reasonably comfortable with them.
I don't like Electron apps particularly, but I understand why people make them. I think that if your desktop app is "the thing" you're making then you should avoid Electron if possible, as it does provide an experience that's subpar. But if your desktop app is just a convenience offering for your product that lives mostly on the web, I think it's fine to use it.
(there are exceptions like VS code, but they're very finely tuned compared to the average Electron app)