
Electron: The Bad Parts - mpweiher
https://hackernoon.com/electron-the-bad-parts-2b710c491547
======
Shywim
> _While many people would expect Chromium to drastically slow down the
> performance or “consume precious RAM” I haven’t experienced any of this in
> practice and haven’t heard bad feedback from thousands of test users._

Well you seem to be looking only at process attached to a window, look a bit
down in background tasks: see those chrome and other electron-based apps
eating your RAM?

------
tombert
Electron has always kind of felt like a prototyping tool to me. It's great for
rapidly developing desktop apps, but it feels like once you get a product you
want to distribute, you should use a more performant GUI library like Qt.

~~~
jcelerier
And then when you see how easy it is to make a Qt app (eg
[http://qmlbook.github.io/en/ch04/index.html](http://qmlbook.github.io/en/ch04/index.html))
you start wondering why you didn't go this route sooner :p

~~~
jancsika
_Unless_ you need features that aren't staples of the Qt system, like editable
diagrams connected by Bezier curves on an arbitrary size canvas.

~~~
jcelerier
Uh ? there are actually quite a bit of stuff like this, for instance I like
this one:
[https://github.com/paceholder/nodeeditor](https://github.com/paceholder/nodeeditor)

~~~
jancsika
From the "roadmap" section for that project

> GUI: fix scrolling for scene view window scrolling

I need the scrolling to work out of the box. Some of the users' diagrams are
going to be 10x the size of the examples shown for that framework (if not
larger).

Also in the issues section:

* you can't put a custom context menu for the nodes

nw.js (and I assume Electron) provide this by default.

* Crash: Attempting to connect an input node into self output node

Sorry, that's a showstopper. The application I maintain proudly does not crash
when the user tries to do this.

And then this one: * Implement QML frontend

So... if I'm not leveraging QML, what's my workflow with this framework? Am I
coding it in C++?

If so, then the speed and ease of developing the frontend doesn't compare to
HTML5.

Just noticed another showstopper:

* [https://github.com/paceholder/nodeeditor/issues/63](https://github.com/paceholder/nodeeditor/issues/63) (doesn't currently support HiDPI)

I need HiDPI support out of the box.

This may all seem secondary to my original statement, which was that Qt works
fine until you want to draw certain types of diagrams. While I'm convinced
it's possible (and looks to be getting easier in the future), the example you
gave isn't fully baked, doesn't have a QML frontend, and doesn't look to be
stable.

I have no doubt people can and will build more frameworks for Qt as it
continues to improve. Meanwhile, however, with HTML5 I can use raw Javascript,
or d3, or React, etc. all the way up the ladder to frameworks specifically
designed for editing diagrams. All of those will result in diagrams of boxes
connected by Bezier curves with performance that scales with the number of DOM
elements. And every single one of those options have demos that work in the
browsers we're staring at that merely require a keyboard shortcut to study and
change the code.

------
krallja
The second image on the Electron home page claims that it has "native menus."
However, as I noted in 2015 (and haven't seen any evidence of it changing -
[https://github.com/electron/electron/issues/2504](https://github.com/electron/electron/issues/2504)),
it absolutely does not have native menus. There's nothing native about
Electron at all; if there was, it wouldn't be stylable via CSS, and that would
defeat the purpose of the project. But Electron should at least try to emulate
the native menu behavior as close as possible. That doesn't seem to be a
priority for the project, however.

~~~
jancsika
nw.js has native menus:

[https://nwjs.io/](https://nwjs.io/)

That said, I'd steer away from native menus _unless_ the GUI toolkit specifies
their behavior precisely, including how the menu API interacts with HTML5
including DOM bubbling, CSS layout calculations, etc. Otherwise you'll need to
research the behavior yourself, for each platform, defeating one of the
benefits of using a cross-platform HTML5 toolkit in the first place.

------
amelius
> The fact that each application comes with its own version of Chromium (the
> 20 million LOC, ~30MB [packaged] Web runtime) is one of the most criticised
> aspects.

Can't they make use of shared libraries?

~~~
api
It's 2017 and we still can't distribute software or manage libraries. For some
reason content addressability based on hashes for libraries has never occurred
to anyone.

~~~
nugator
What do you mean should be hashed? Each library?

~~~
api
Yes. Then add a service on the OS that fetches the libraries for any binary.
It's not a complicated thing. It's been obvious to me for years that this is
how exact version linking should work.

Linux at least has library versioning so this is less of a problem. Windows
has foo.dll and foo.dll and foo.dll, so pretty much the only way is to ship
your own foo.dll.

~~~
paulddraper
There are schemes like this, e.g. Nix.

I like it though it not without any disadvantage.

It will be challenging to upgrade OpenSSL after a discovered vulnerability.

------
skybrian
Updating just the app is a nice trick. However, if you only update your app
and not your dependencies, that means you don't get security fixes to your
dependencies. It seems important to solve security updates for dependencies
too?

------
jszymborski
I really like the idea of using HTML/CSS/JS for the GUI and UI logic of an
app, but shoving in a whole web-server just seems nutty to me...

~~~
rhodysurf
That is essentially what qml does

~~~
ahartmetz
Depends on your definition of "essential". The biggest similarities of QML to
an HTML engine are that it contains a JS engine, and that it has item and
layout trees. It is worth noting that the core content description language of
both has nothing to do with JS.

------
andrewguenther
I would have liked to see a call out for crash reporting. I still haven't
found a good self hosted Breakpad server _.

_ Mozilla has Socorro, which is great, but way too heavy for a small
application.

------
pier25
Yes, Electron updates and installs are a pita. Specially in Windows.

