News for hackers. Stuff that matters.
Re:Electron apps cannot be submitted to the Apple store by Razengan on Sunday November 03, 2019 @06:45PM (#21437608)
As a user I am glad. As is custom for all Electron discussions, someone must point out its flaws. Why the dislike, you ask? A picture is worth a thousand 64-bit words:

https://imgur.com/a/XnCOHUD

And mind you, GitHub Desktop is taking that much just for showing a mostly empty window! while Fork and Tower are displaying a lot more UI, more controls, trees, custom drawing, more text, and have overall more features (best of all: spell checking for commit messages because all native text fields get it for free.) You can try it on your own machine and compare them.

Now yes Electron has made life very easy for some developers and some apps wouldn't even exist if not for Electron, but why, as a user, should I pick an Electron app over native alternatives?

Re:Electron apps cannot be submitted to the Apple store by ajxs on Sunday November 03, 2019 @06:57PM (#21437670)
While working on a project that uses a service built in Typescript I've been using vscode. I was wondering what was wrong with my laptop's battery, it had gone from lasting around 2-3 hours unplugged doing reasonably intensive to lasting around 40 minutes. As soon as I stopped using vscode the battery life went back to what I'd normally expect. It's honestly outrageous that applications built on Electron strangle your CPU to this extent. I'm not sure if vscode is particularly resource expensive compared to other Electron apps, but compared to other editors it's just ridiculous.
Re:Electron apps cannot be submitted to the Apple store by jjcm on Sunday November 03, 2019 @11:11PM (#21438985)
This is the bigger thing for me. The CPU usage of many electron apps is through the roof. It's so convenient to use that I'll probably still make electron apps, but I'd love to see Apple and Microsoft partner with each to make both more performant.
Re:Electron apps cannot be submitted to the Apple store by jamil7 on Monday November 04, 2019 @08:28AM (#21441384)
I have been very happy developing a typescript project for work in nvim and coc.nvim.
Re:Electron apps cannot be submitted to the Apple store by codedokode on Sunday November 03, 2019 @06:57PM (#21437669)
These numbers are too low. I assume that this task manager might show only private pages and not account shared pages with code (and the code size in Chrome is close to 100 Mb). Anyway, the number looks a bit unrealistic. Or maybe it doesn't count swap.

I used Electron apps on Linux and typically memory usage doesn't get below 250-500 Mb.

Here is an example for Skype: 220 Mb of swap + 388 Mb of PSS (Proportional set size).

Re:Electron apps cannot be submitted to the Apple store by ajxs on Sunday November 03, 2019 @07:03PM (#21437699)
Even that's low. Here's my result of running pmap on an open vscode process. "total 1046516K"

Yikes.

Re:Electron apps cannot be submitted to the Apple store by codedokode on Monday November 04, 2019 @09:58AM (#21442188)
I would rather use smem, that calculates PSS (Potential Set Size) that properly accounts for pages shared between processes and shows swap usage per process. 1 Gb seems realistic though.
Re:Electron apps cannot be submitted to the Apple store by starbugs on Monday November 04, 2019 @09:31AM (#21441953)
I manage to get these numbers with Sublime Text on a big project. Sublime Text is native.
Re:Electron apps cannot be submitted to the Apple store by codedokode on Monday November 04, 2019 @09:58AM (#21442191)
It is partly written in Python, as well as plugins.
Re:Electron apps cannot be submitted to the Apple store by starbugs on Monday November 04, 2019 @11:16AM (#21442994)
But it's not written in Electron, which is my point.
Re:Electron apps cannot be submitted to the Apple store by baroffoos on Sunday November 03, 2019 @07:12PM (#21437759)
The memory usage issue is insane. My work laptop is regularly at 20GB memory usage partly because all of these electron apps take up 300mb to sit in the background and show me a notification every now and then. Its hugely refreshing to see my notes app (Zim Wiki) using 19mb of ram while being super fast and providing a huge amount of utility.
Re:Electron apps cannot be submitted to the Apple store by ptx on Monday November 04, 2019 @02:14PM (#21445266)
Also interesting to note that this relatively super-fast app is written in Python.
Re:Electron apps cannot be submitted to the Apple store by lacker on Sunday November 03, 2019 @10:27PM (#21438793)
As a user I think Electron is great. It means many more apps have a Mac version. Compare to games, where Electron typically isn’t feasible, and observe how many games don’t have a Mac version. A little extra memory usage is fine by me. I can understand how people disagree, and that’s fine, just don’t use Electron apps. No need to ban them from the platform.
Re:Electron apps cannot be submitted to the Apple store by fooey on Monday November 04, 2019 @01:50AM (#21439476)
Yes, this is the thing.

The option isn't electron vs native, it's electron vs nothing.

Re:Electron apps cannot be submitted to the Apple store by leadingthenet on Monday November 04, 2019 @02:20AM (#21439575)
Often, nothing is better than the Electron equivalent.

Case in point, if I run Slack in Safari, it runs better than the electron version. Functionally, it’s identical, except the scrolling is now native and feels a bit better integrated in macOS. So what’s the point?

Re:Electron apps cannot be submitted to the Apple store by wutbrodo on Monday November 04, 2019 @03:58PM (#21446436)
I work on AVs, so we have incredibly beefy workstations: I've never managed to make my workstation seize up, even when building and running the full AV stack. Somehow, all of my coworkers who use native Slack have developed the reflex of killing and restarting the application whenever their workstation hangs. It's beyond me why they continue to use it.

(That isn't to say that the web version of Slack isn't horribly engineered too, but it poses far less of a problem)

Re:Electron apps cannot be submitted to the Apple store by Seirdy on Tuesday November 05, 2019 @07:21AM (#21451699)
There is literally no reason to distribute an electron app when you could simply run it as a web server using `npm start` and navigate to `http://localhost:[port number]`. Electron is born out of a misplaced notion that some apps are "special" and deserve a certain extra percentage of the users' CPU cycles and battery life for a spot in a user's system tray. 10% of a user's battery life multiplied by all their electron apps is not worth it when alternatives (like starting a web server and launching the users' preferred browser) exist.
Re:Electron apps cannot be submitted to the Apple store by imtringued on Wednesday November 06, 2019 @04:51AM (#21461073)
I once used this pattern and implemented the webserver using C++. It was quite interesting that I could read gigabytes worth of files and run a sqlite database in the same process and still not exceed 3MB of RAM. Of course the tab in the browser used a lot more RAM (maybe 25MB) but browsers can suspend or simply close tabs. With regular applications the GUI would always be loaded in memory.

The reason why this pattern isn't used more commonly is the fact that right now web browsers simply aren't designed to be used this way unless you start a new instance for just a single app. The second reason is that electron developers are lazy. They only want to test a single browser (or browser version) and are perfectly happy that this means Google can get away with shady things.

Re:Electron apps cannot be submitted to the Apple store by imtringued on Wednesday November 06, 2019 @04:44AM (#21461033)
I once used this pattern and implemented the webserver using C++. It was quite interesting that I could read gigabytes worth of files and run a sqlite database in the same process and still not exceed 3MB of RAM. Of course the tab in the browser used a lot more RAM (maybe 25MB) but browsers can suspend or simply close tabs. With regular applications the GUI would always be loaded in memory.
Re:Electron apps cannot be submitted to the Apple store by ldh on Monday November 04, 2019 @09:31AM (#21441943)
The option is native vs. electron vs. a regular web app. There's rarely any reason you need your web app to live in a dedicated Chrome instance without a URL bar.
Re:Electron apps cannot be submitted to the Apple store by swiley on Monday November 04, 2019 @06:25AM (#21440617)
Most decent apps build fine on BSD, electron is for closed crap with bad GUIs.
Re:Electron apps cannot be submitted to the Apple store by kristiandupont on Sunday November 03, 2019 @09:21PM (#21438462)
>Why the dislike, you ask?

Nobody is asking that, there's a crowd in here that restates the same three points about memory, performance and native UI about once a week.

I dislike waste, I have written assembly code for tiny processors. And yet, I run several Electron apps on my 8gb 2013 Macbook Air and it runs fine, especially VSCode. I am picking that over my previous choice which was native (vim), because I think it's better.

Re:Electron apps cannot be submitted to the Apple store by ajxs on Monday November 04, 2019 @12:17AM (#21439216)
Not every developer runs a Macbook. Like many others for my laptop I use Linux running on a cheap ThinkPad with a quarter of the specs of the one you mentioned. ( I could afford to buy an overpriced Macbook, but I like my rugged $100 ThinkPad. ) As I stated elsewhere in this thread, vscode absolutely chews up my battery power. That's a practical concern. If I run several Electron apps on my laptop I'd be lucky to get an entire commute's worth of battery life out of it.
Re:Electron apps cannot be submitted to the Apple store by nl on Monday November 04, 2019 @07:19AM (#21440918)
As someone who spent years complaining about the lack of cross-platform apps that I could run on Linux, I'm grateful everyday for Electron and for MS for using it for VS.Code.

The fact that it works the same on OSX and Linux is even better.

Re:Electron apps cannot be submitted to the Apple store by ptx on Monday November 04, 2019 @02:17PM (#21445305)
Linux wasn't exactly lacking in text editors, though.
Re:Electron apps cannot be submitted to the Apple store by Razengan on Sunday November 03, 2019 @10:12PM (#21438716)
> there's a crowd in here that restates the same three points about memory, performance and native UI about once a week.

Where else would users complain about undesirable developer trends if not on a developers' community?

Re:Electron apps cannot be submitted to the Apple store by kristiandupont on Sunday November 03, 2019 @10:31PM (#21438807)
You are right and I am sorry, that was unnecessary.

For the record, I do think there are problems with Electron, just not the ones usually mentioned. A big (huge!) problem in my opinion is that two windows can't share JS context. It's the reason why VSCode is way behind in multi-monitor support for instance.

Re:Electron apps cannot be submitted to the Apple store by RodoBobJon on Monday November 04, 2019 @02:43PM (#21445593)
This drives me crazy with Slack. In 2019 I can't have two chats open at once? Madness.
Re:Electron apps cannot be submitted to the Apple store by Seirdy on Tuesday November 05, 2019 @07:33AM (#21451782)
Not everyone is in your boat. As developers, we build things for others to use; empathy is a cornerstone of the job description. Hopefully this will help illustrate why Electron isn't a good choice:

Say a somewhat below-average user has 6GB of memory (I'm being generous here; plenty don't have more than 4GB). Today is a worse-than-usual day, and 4GB are taken by everything that isn't Electron because 40 tabs are open for a research paper due tomorrow. That leaves three gigs to spare. Now the user starts up some Electron apps.

- Music player? +400mb

- Note-taking? +300mb

- Messaging? +500mb (thanks, Slack!)

- News? +300mb

- Editor/IDE? +500mb

That's it. No more space. And that's before we even begin talking about what we're putting that dual-core CPU through. Battery life is a joke at this point.

A comparison: My OS, window manager, mail client, password manager, taskbar, music player (mpd+ncmpp+clerk.pl), file manager, system monitor, RSS reader, podcast player, IRC client, and editor/IDE (neovim+language servers with diagnostics, gotos, floating documentation, and refactoring all running) barely use over 1GB of memory, combined. Let that sink in. Essentially, a single electron app using 500mb of memory would increase my memory usage by 40%.

People shouldn't have to throw away/upgrade their computers every four years. I'm still rocking a 2013 HP Elitebook G1 with a Haswell i5 as my secondary machine. It runs just as well as my desktop for anything except heavy websites with JS enabled, compiling, and graphics-intensive work. I plan to either continue using it for another few years or donate it and switch to a more lightweight \$199 Pinebook Pro. Using less powerful hardware forces me to empathize with users who are using tech from the past rather than the future, because that's my job. I build tools for people besides myself to use.

If you must use the web, consider making your "app" start a local web server and launching the users' preferred browser for a more lightweight solution.

Re:Electron apps cannot be submitted to the Apple store by pier25 on Sunday November 03, 2019 @11:10PM (#21438977)
> why, as a user, should I pick an Electron app over native alternatives?

I'd pick the native version every time, but there is no native VSCode, Atom, Slack, or Whatsapp.

I use Sublime because it's native and I don't use too many plugins but a lot of people prefer VSCode.

Re:Electron apps cannot be submitted to the Apple store by saagarjha on Sunday November 03, 2019 @07:09PM (#21437748)
Of course, Apple does not usually reject Mac App Store applications for RAM usage (and they're not doing it here).
Re:Electron apps cannot be submitted to the Apple store by kevingadd on Sunday November 03, 2019 @10:08PM (#21438695)
On Windows, Slack.exe would sometimes eat up so much memory that I'd run out entirely. I upgraded to 64GB of RAM so I could keep it open for work.
Re:Electron apps cannot be submitted to the Apple store by jmeyer2k on Sunday November 03, 2019 @08:28PM (#21438193)
What a ridiculous question... why would you not want the option to download Electron apps through the app store?
Re:Electron apps cannot be submitted to the Apple store by aidenn0 on Sunday November 03, 2019 @11:49PM (#21439124)
Not owning an iPhone, I don't have a horse in the race, but if company X is going to make a client for their service, and for whatever reason you need to use their client, if they are not allowed to use Electron, then they will use a different toolkit. If you don't like Electron apps, then this is a win for you personally. Too many services can only be accessed with the official app, which means it's not like you can just download the "not made with electron" version.
Re:Electron apps cannot be submitted to the Apple store by JohnFen on Monday November 04, 2019 @01:34PM (#21444777)
I just wish that Electron apps had a warning label applied so I won't accidentally download them.
Re:Electron apps cannot be submitted to the Apple store by krainboltgreene on Sunday November 03, 2019 @08:18PM (#21438138)
I uh...Sorry are you mad that an electron application is using ~80mb more than other native applications?

I cannot fathom the indignity required to care about that difference.

Re:Electron apps cannot be submitted to the Apple store by catalogia on Sunday November 03, 2019 @08:32PM (#21438213)
> "I cannot fathom the indignity required to care about that difference."

Your failure to empathize seems like an odd thing to brag about. Even if you have plenty of memory available, you should be capable of empathizing with people who are short on it.

Re:Electron apps cannot be submitted to the Apple store by Razengan on Tuesday November 05, 2019 @04:09AM (#21450825)
Taking more to do less. Can you fathom the ability to read the rest of that comment and all the other comments about it?
[dead]
Re:Electron apps cannot be submitted to the Apple store by johnny22 on Sunday November 03, 2019 @11:59PM (#21439155)
We used to joke about EMACS being Eight Megs And Constantly Swapping
Re:Electron apps cannot be submitted to the Apple store by erik_seaberg on Monday November 04, 2019 @01:05AM (#21439364)
We still do, but now it has more of a Dr. Evil vibe. “Eight million bytes.”
Re:Electron apps cannot be submitted to the Apple store by johnny22 on Saturday November 09, 2019 @12:00AM (#21489721)
lol. The communities were a bit more close knit with editors back then, so you couldn't avoid hearing such things. Nowadays there are so many choices that I hadn't heard the joke in a long time.

I'm glad that it still exists