7 ms·
Electron: The Bad Parts
- jszymborski 9y agoI 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 9y agoThat is essentially what qml does
- ahartmetz 9y agoDepends 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.
- amelius 9y ago> 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?
- pier25 9y agoThere is a project that actually does something in those lines. https://github.com/nodekit-io/nodekit https://github.com/nodekit-io/nodekit Instead of embedding a browser engine and Node in each application, it uses the available ones in the platform it's running.
- api 9y agoThen you'll get weird errors. Everyone distributes the whole universe because it just works. Docker is the same idea for services.
- tentaTherapist 9y agoAnd you fix these errors as they arise, adding platform-specific hacks to the library as necessary. Your product still ends up much smaller and better-performing than the others.
- styfle 9y agoAnother similar project to use the available browser on the user's current platform: https://github.com/pojala/electrino https://github.com/pojala/electrino
- cjsaylor 9y agoNot that I disagree, but the downside is that you would have the browser fragmentation that alot of people use electron to avoid.
- ameliaquining 9y agoThe big advantage of doing it this way is that, for users, it Just Works. They never get incomprehensible error messages telling them that they've got an incompatible version of libwhatever.dll when they try to load your app. I remember well the bad old days of Java desktop apps in the early 2000s, where this problem was omnipresent. Moving away from that was a major boon to users, and I don't ever want to go back.
- Klathmon 9y agoAnd now many java apps bundle their own JRE (at least on windows). Like anything else it's a tradeoff, and for the average user not having to install separate dependencies (at least on windows and mac) is going to be easier, and 50 or 100 mb isn't something anyone is going to really have an issue with in the vast majority of cases.
- michaelmrose 9y agoSlack for example is 192 MB. I guess if everyone had that theory I might have 30 extra copies 6 extra gigabytes. More importantly I would have to ensure I killed apps lest say a calculator app or editor ruin my battery life by itself for the dubious privilege of rendering a blinking cursor.
- Klathmon 9y agoLike I said it's a tradeoff. For you, it sounds like it hurts more than it helps, but for others the options may be: 1. Don't use slack at all because they can't figure out how to install the correct version of libthingy.dll. Or they don't get the app at all because it's not for their platform. 2. Use slack And in that scenario, the option they went with wins hands down. I'm not saying it's perfect, and I still believe that giving both options would be a benefit for most, but the fact that it is done this way wasn't a "mistake", it was a tradeoff for the targeted audience solving problems that many had.
- izym 9y ago
- api 9y agoIt'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 9y agoWhat do you mean should be hashed? Each library?
- api 9y agoYes. 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 9y agoThere 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.
- jancsika 9y agoI think Guix has the potential to do that. At least the hash for the reproducible build is part of the package definition. So it seems like one should be able to just have that hash, and then rely on the backend to just go fetch a blob that has that hash from a list of possible sources (centralized repo, bittorrent tracker, IPFS, etc.)
- benjaminl 9y agoWindows Side-by-Side assemblies (WinSxS) are similar to this. Each assembly or .dll contains a manifest that list its dependencies by version and token id. The OS dynamically loads the dependencies based on the manifest. https://en.wikipedia.org/wiki/Side-by-side_assembly https://en.wikipedia.org/wiki/Side-by-side_assembly This was introduced in Windows 2000 and used for core OS components starting with Windows Vista.
- tombert 9y agoElectron 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.
- TeMPOraL 9y agoUnfortunately, it almost never works that way, because Electron is what allows people knowing only (and willing to only ever know) JavaScript to make "desktop" apps. At the point you should switch to something native, the prototype has so much JS code you'd have to por that it's not worth it anymore.
- tombert 9y agoOh, I figured that that was the case; it's easier to make desktop apps with Electron, so it's attractive to companies because they can hire JS developers, which are almost certainly cheaper than Cocoa/Qt/GTK+/Whatever-Windows-Uses-Now developers. They're able to deliver a good-enough product with Electron, and don't really see it as a prototyping tool.
- robocat 9y agoReact Native says otherwise: javascript talking to native components.
- benjaminjackman 9y agoReact native targeting QT or a similar desktop widget toolkit ... is that a thing? It seems like it should be a thing at least at the highly starred but otherwise vaporware github repo level?
- oceanswave 9y agoMicrosoft maintains react-native-windows that targets the UWP/XAML components
- 9y ago
- skybrian 9y agoUpdating 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?
- pier25 9y agoYes, Electron updates and installs are a pita. Specially in Windows.
- krallja 9y agoThe 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 9y agonw.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.
- city41 9y agoElectron does have native menus on OSX. I always got the impression that OSX is the main OS the team is interested in supporting.
- user5994461 9y agoQt is native and it has styling by CSS. It's not impossible to do.
- andrewguenther 9y agoI 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.
- Shywim 9y ago> 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?