6 ms·
Electron overhead :(
by xabi 10y ago
Electron overhead :(
- pingec 10y agoHow else would you port a typescript/javascript editor to the Desktop? They do state they are working on decoupling the core Monaco editor but where else would you host it to make it faster?
- mike_hearn 10y agoYou wouldn't write it in Javascript to start with!
- imtringued 10y agoIn the browser.
- astannard 10y agoThey do much better work with use of threads though, so it seems much faster than atom to me with no lockups.
- StevePerkins 10y agoLet me preface the following by saying that a text editor is a use case where an Electron-based desktop app can make good sense. I recently put some time into experimenting with Electron, writing a simple media gallery app for viewing all the images and videos in a directory (https://gitlab.com/steve-perkins/MediaGallery-electron https://gitlab.com/steve-perkins/MediaGallery-electron). Certain things were easy, due to the fact that it's largely a web app under the covers. Certain things were frustratingly impossible, such as detecting whether a video is supported without adding it to the DOM and attempting to render it. Other things fell somewhere in between. HTML/CSS/JavaScript is a secondary skillset for me, so it felt like I swimming upstream to make a web app format and behave like a desktop app. My primary skillset is Java, and I haven't yet had a chance to tinker with JavaFX (i.e. Java's answer to Microsoft's WPF and XAML). So I decided to write a JavaFX version of the app for experience (https://gitlab.com/steve-perkins/MediaGallery-javafx https://gitlab.com/steve-perkins/MediaGallery-javafx). It was still a pain in the ass to learn a completely new GUI framework. But it was a relief to work with layout managers that actual want to function in a desktop paradigm. It was also nice to have unfettered access to local API's beyond the web-server-focused ones available to Node.js, and to have cleaner integration with the main process and the renderer thread. Interestingly, Java supports far more media types than the Electron browser engine. Here's the kicker. Not many people know about it, but modern JDK's ship with a "javapackager" tool that bundles up your app into a native executable with a stripped down embedded Java runtime (and even a platform-specific installer). Believe it or not, the standalone installer for my JavaFX-based app is about 25% SMALLER than the installer for my Electron-based version. Now, I'm not necessarily saying that JavaFX is a panacea for cross-platform desktop development. There really IS no ideal solution for that space, because so few people still care about it these days. However, I will say that Electron seems to make sense only for distributing apps that are basically just web apps, or perhaps have very limited native interaction outside the DOM (i.e. loading and saving plain text files, or spawning external processes). If you need to write a cross-platform desktop app that really IS a desktop app... then I think you're stuck with a C++ framework like Qt or xwWidgets, or perhaps JavaFX.
- mike_hearn 10y agoYeah, JavaFX is excellent. I wrote a cross-platform (win/mac/linux) app with it and it was a very straightforward and pleasant experience. The javapackager tool helped a lot. In Java 9 it is getting a lot of new abilities like being able to strip components (so then its size advantage over Electron will become even larger unless they duplicate the feature), do ahead of time optimisations and so on. > There really IS no ideal solution for that space, because so few people still care about it these days. I would say lots of USERS care about it. It's DEVELOPERS that have decided writing desktop apps is terminally uncool and give their users crappy web apps that have horrible UI latency, don't work offline, aren't accessible, don't integrate with the OS, etc. Eventually developers will figure out that making a good desktop app can still make you good money (see: Minecraft) and I suspect there will be a bit of a renaissance, especially if someone puts together an easy to use modern update framework. I made one called UpdateFX but I don't maintain it anymore.
- yAnonymous 10y agoIt's not overhead, but a feature that allows for a great variety of plugins and cross-platform compatibility. If you can't see the advantage of that, I feel sorry for you. It would be nice if the man childs who need to point out "electron bloat" in every thread could go back to arguing about vim vs emacs.