Electron 4.0.0
electronjs.org
electronjs.org
Does the Electron team have a focus on improving performance? Or is the issue with the developers using electron, should they be optimizing better?
I assume it's some of both, but curious if anyone with more experience in electron can provide any insight as to how the performance changes over time.
- The operating system cannot share memory between different Electron processes. Normally if you start many processes of the same binary, the memory is shared and only copied on write. Since each Electron app is a different binary (even though they are 99% identical) they each eat memory.
- The above applies to disk size as well. Electron apps are usually huge, and 99% of the binary is the same as all your other electron apps.
This is mostly why I'm against electron. If electron worked like the JVM and each app shared a runtime, many issues would be solved, including many electron apps running old, and vulnerable versions of Chromium. Now it's only updated if the developers decide to ship a new version.
This is in no way an endorsement for Electron, just an aspect common to all platforms that rely on an intermediate runtime that could in principle be shared.
But the memory one definitely is, I don't want each app to take 1GB of ram.
While hard drive space is cheap on spinning drives, space on consumer devices has stagnated or even decreased with the move to ssd
Here's one that doesn't suck:
Maybe that was very complicated to make, all I know is that it's blazing fast and doesn't hog memory. Or hey, take OggDrop and LameDrop, I'm sure there's programs that do the same, are 100 times as big and have 3 options. I don't know if there are 10x programmers, but I know there are 100000x programs, with not one electron app among them.
Another self-contained application I like is racket/drracket.
Lately I have been building apps with tkinter/python/asyncio and I can't get over how fast the apps are to load and to use. There is none of this "let's not respond to the mouse for 5 seconds" that is staggeringly common on my mac (particularly for apps like Safari and iTunes that come from Apple) nor the "go for a walk around the block" loading times for Java-based apps on my i7 Windows laptop.
True tk apps are ass-ugly but I find it mind-blowing to use GUI apps that are as responsive as Windows 95 apps were back in the day.
I love Kivy as well as QT. You can make some decent looking apps with the former and some incredible ones with the later. I have never personally worked with Electron.
But yeah, most devs use JS, HTML, and CSS for ui creation because of the Web.
I think something like QML could replace the html and css parts, though.
tkinter specifically does not look very pretty without some effort. I would much rather use GTK or QT. The problem is GTK support on windows is limited, and QT has a weird license model.
Qt is available under LGPL and GPL. What exactly is weird about that?
Up until 2005 or so Qt had indeed a relatively complex licensing scheme where the available (i.e. the license of Qt) and compatible (i.e. the license of the application, due to their GPL exception allowing applications to use MIT, BSD, ...) differed by what was then Qt ports (e.g. Qt/X11, Qt/OSX, Qt/Windows). After that they always had a uniform licensing model for Qt, were the licensing was independent of the platform.
I wanted to like Kivy but it was more clear how to get asyncio support running w/ tkinter. The Kivy folks say they will go to py 3 only soon and support asyncio officially soon but I am in a good place with tkinter.
I am also thinking about a 2-thread architecture which may work well for Kivy since it is so heavily Cythonized.
Also if it's not built in JS, it's not cool these days
To me, it feels like if you want to be cool these days, you look down on JS/JS devs.
JS has plenty of issues, but it's undeniably successful - isn't it more beneficial to either improve the problems or figure out why it continues to be successful despite them and adapt that in your language of choice rather than dismiss the success as being "cool"?
I've developed in a few languages, with JS being the latest, and while I do in fact enjoy it (mostly), it's not because I'm cool. I'm almost never cool, and being a JS dev involves people telling me that remains the case in tech forums regularly.
</rant>
All of my bitterness aside, your point about GUI development is completely correct. I've been happy to see CSS slowly taking lessons from desktop GUI layout and hope for more in the future.
The true hipster developer needs to be able to sneer at JavaScript with true derision while also having JavaScript be their go-to language for everything. Holding incompatible views at the same time about mostly inconsequential things is, after all, the true essence of being a hipster...
I’m incredibly partial to Qt and love the framework (particularly the ability to style it and its C++/Python bindings). But even after making a small GUI application I can see why some would prefer more simple to use frameworks, whatever the resource or performance costs may be.
Ease of use? What's easier, MS Visual Basic/Embarcadero Delphi, or the application-oriented parts of HTML/CSS/JS? Even Python (which is freely available) is not exactly hard, and there are plenty of native apps using e.g. WxPython. It's not "ease of use", it's more like webdev "brogrammers" wanting to have their cake and eat it too.
Um because a lot of them already know HTML/CSS/JS (because they've worked on websites). This the the major reason why Electron is popular - the barrier to entry is very low. That combined with the fact that users don't complain, just makes it a "pragmatic" choice.
I haven’t heard anyone outside of the hn circles moan about slacks usage.
- I'm a JS/TS developer, with it I can make CLI apps, websites, Electron apps and mobile apps. This means I can also use the same set of UI widgets I'm familiar with across all platforms, I can't do that with any other native UI toolkit so far, maybe the situation will change with the advent of WebAssembly, but so far JS has basically been the only language capable of providing this.
- I don't think I've ever used a Java GUI app that didn't look like crap and wasn't a game, I've also never made a GUI app in Java, so this is just a guess, but maybe it's just easier to make prettier apps with web technologies.
I've no idea how good Xamarin is at doing the things that it does, but even if I hadn't invested X into my web-based components Xamarin would still force me to reimplement them again in case I need them in my website. That's not cross-platform enough for me, Electron in better in this regard.
Personally, I liked it back in the Win95 days when everything used the native toolkit and I could change its appearance significantly through a simple control panel [0]. Back then, if I wanted a "dark mode" I just adjusted colors to make things darker, but with modern GUI bullshit it's a newsworthy item when someone adds "dark mode" as a feature.
Customizability-wise I actually prefer Electron apps to native ones, with a few lines of CSS I can remove stuff I don't need and tweak the UI a bit, I'm not quite sure you can do the same as easily for native apps.
Also you mentioned dark mode, an Electron app could support dark mode too, taking as an example macOS native apps they also have to explicitly support dark mode, so I'm not sure what you lose in this regard by non going native.
I would argue that going full-native win95 style has more downsides than benefits, for most people simply being able to change the wallpaper is enough.
That's a fair point. GUIs have tended towards being less customizable, not more, and that's a huge failure in my eyes. However, the customizability of Electron applications is really a side effect of the fact that it runs on top of a web browser. I find it difficult to count that as a point in its favor.
Looking at it from that perspective, there are native GUI systems that load XML files for their GUI that could also be called customizable by your standard.
Native apps use system colors by default. Electron apps tend to use static colors.
If you want to create custom elements I assume is simpler to do it in html with a couple of nested divs, background images and some css rules and some trickery and most probably your custom widget is not accessible and missing some nice features. As an example I know toolkits(Qt,Flex4) that can render huge tables of data, allow customization and are very efficient and you don't need third party libraries for that.
So yes +1 cross platform GUI toolkit
If we could just get a modern UI lib w/ a C FFI you'd see a node wrapper and the complaints would reduce (yes I am aware of lots of efforts and could enumerate them all, but many are lacking).
It looks like Python is your only option if you want a community of any sort who is actually doing GUI development with a scripting language (Perl/Python/Ruby)
I prefer functionality over appearance, but I'm just a crusty old RDBMS DBA so I'm not sure my opinion can count for much.
For me?
Because every API I access returns JSON, and because half those API have a JS package sitting somewhere in NPM.
Bonus, a large % also have typescript definition files laying around.
So my choice is either:
1. Deal with JSON in native, and create my own wrappers for every API out there, because next to no one publishes C/C++ libraries anymore.
2. Give in to the JS behemoth.
tl;dr ecosystem.
You have to parse it anyway, and in either case (native or JS) you'll be using a pre-built facility for that. Plenty of "native" languages can have good JSON support these days, and the "create a wrapper for the API" part is trivial if there's one available already, even if it's JS.
In JS you can just access the fields. With a lot of APIs just being HTTP endpoints, call fetch, get JSON, see if you like how it works.
Move over to a better NPM library that wraps it later on if so desired.
But for prototyping stuff, JSON+JS is stupid fast. JSON store DBs suck for a lot of reasons, but getting something working in them is incredibly easy.
Getting that something to "real product" is probably end to end more work than if a better tech stack was chosen. You win some and you lose some!
I think an updated, nicer ttk would help considerably, as well as a bigger widget library, but there is little information on improvements to Tk as a whole (I can’t even find enough examples for asyncio...)
Anyone have good references for either?
Because it very much feels like so, especially with tkinter. And it's not only the toolkit, it's the OS integration, and installer and so on. Because making a cross platform app with Electron is relative low effort and you get very good results. Most of the other options are not even close.
Though I feel like even if that happened people would still complain about it, mostly motivated by web technologies encroaching on the desktop space, threatening other developers “turf”, so to speak.
Just run them, and drag'n'drop directories with the application's source code onto the electron window, or create desktop shortcuts that run "C:\somewhere\electron.exe C:\your\app\dir".
Better then nothing.
You can probably unbundle thirdparty apps, becuase what electron apps are, are basically "electron" + "other code/resources". But I've never even seen someone else's electron app distribution package, so I don't know how hard/easy it would be. And I wouldn't trust it anyway, if the code is transpiled/minified/unreadable.
I run all my electron apps using a shared runtime.
Compared to Safari, Chrome’s performance is like a fat pig hogging your memory and devouring your battery life.
I think splitting out services from the browser makes it easier to focus on notifications and use window management to change contexts. It is confusing and frustrating that Apple has not allowed saving websites to apps yet.
Sharing libraries is definitely more efficient but at the cost of isolation and versioning issues. Similar to some of the reason vms and containers are used.
Over time I have come to appreciate self contained apps and deal with redundant bytes at a lower level.
On the other hand, requiring a shared runtime has been one the key reasons that a lot of cross platform apps failed in the past. How many times have others decried the fact that they had to install Java or Adobe AIR or XYZ in order to run an app they needed.
You mean like eerr, chrome - and the web :P
That should not be a significant issue in 2018 - all popular operating systems have same page merging support now and at least latest Win10/macOS also have transparent compression of memory pages.
Discord is an intelligent start up that was able to pivot from a chat client to a games marketplace with a one-click update. Their use of the erlang VM shows that they make considered tech decisions based on tested technology. I think their use of electron, at least from this users perspective, was a great decision. I realize they are just one example of electron apps, and I'd have a harder time defending a file-unzipper or some madness using Electron, but it no doubt has its uses. To suggest otherwise would be premature optimization at best.
Noted, and that's a fine use case for the Browser engine + HTML + CSS + JS/WASM tech stack - but how many native apps need that sort of rich view?
Both Slack / Discord use around 400MB including all processes on my machine, tho it certainly varies with what is on screen. In comparison to the gmail tab I have open in Safari that is using 1GB, 400MB isn't bad.
Heck my Digital Ocean dashboard tab is consuming 155MB of memory right now (WTF DO?)
That said, I am blown away whenever I install an "old school" native Win32 app. The 90s APIs may have sucked to program for, but the end results stood the test of time.
Windows 2000 or higher Internet Explorer 6.0 or higher 128MB RAM/512MB for enhanced multimedia features (TOTAL RAM in the system!!!!!) Macromedia Flash Microphone and speakers/headset for voice/audio chat
(Creative Cloud is using 234.9MB and that's nothing more than a damn launcher!)
Now it is 164MB + 104MB + 85MB! And these measurement were not under high memory pressure! This isn't small by any means, still a total of ~350MB for a simple tool, but it is similar to Telegram which is a native Mac App. The two WhatsApp helper were previously using 700MB each!
And the major major improvement is compressed memory. Previously it didn't compress much at all. It was the same 700MB. Now it is 4.6MB + 5.2MB + 8.5MB, that is total of 18.3MB!!!!
I have no idea what happened, but in terms of compressed memory that is nearly 99% reduction in memory!
( Actually I am really interested in what happened, I wish they have changelog or blog post on the fix )
Right now (20181223T1031Z) WhatsApp (87.5MB) + WhatsApp Helper (149.9MB) + WhatsApp Helper (171.7MB) are using a total of 408.5MB.
Everyone's system is different. Everyone's WhatsApp is different. Everyone's memory usage will be different.
Back when I had four megabytes of ram I wouldn’t have been furious over a 50kb editor. 200mb isn’t a lot when most developers are working on systems with 16gb or more of memeory.
If a dev is working on a less capable machine I guess I can see why this is a problem, but a rather simple one to solve, close Slack, it’s a distraction to focused work anyways :)
Yes, I hate Electron with a passion. It's a slow, wasteful framework for lazy developers who can't be bothered learning Qt or something else non-silly. IMHO.
The issue with memory consumption is definitely there.
But the issue for us is that if you're doing ANYTHING with 'content' you just have to use the web platform.
You need CSS, HTML and with pdf.js we have somewhat first class PDF support (though a few features are missing).
If it's a calculator app, then sure. Don't use Electron. It would be too bloated.
One feature in Polar that simply wouldn't be possible is support for web content caching.
We support downloading web pages for offline usage to allow annotation and to prevent bit rot.
It wouldn't be possible without some sort of web control but having full chromium (plus a webserver) means that you can setup a near perfect clone of the web but on the desktop.
Who are all these masochists using Tkinter? There are a ton other APIs to consider, and even more if one wouldn't mind updating an old one to be current (think XUL). I think this is the second or third thread where that particular toolset has been named as if it were the only alternative to Electron
I hate Electron too but is everyone really so new to the game that they do not remember desktop programming?
There's Swing, GTK, QT, JavaFX (maybe), WinForms....
embarassed hand raise
It's not that bad, just pretty bad.
https://medium.com/commitlog/electron-is-cancer-b066108e6c32
Try using the global search feature on Slack and tell me how that already existed in IRC circa 1995.
Isn't that particular feature mostly implemented server side?
On the other hand, yes, I agree that modern messengers has a lot of features that my IRC clients missed (voice comes to mind). Also they are easier for mainstream users to use and administer, and, compared to old IRC, safer in a number of ways (although I'd add that we are seeing a number of new threats now).
I use Discord and like it, but it is incredibly slow at starting, switching rooms, and even just loading new messages.
But the most aggravating thing is that I can't type a message on mobile if I don't have internet connection. It requires connection to load the input field. Affects me every day in elevators. Most native apps just lets you write your message and sends it when connection is back.
Fine, Discord is useful, but I must respectfully disagree that their app is good. And it is definitely possible to make natively.
Telegram on mobile is Android native, while Discord is based on "React Native". Telegram for desktop is based on Qt while Discord uses Electron.
I have a theory that the loudest complainers about this are the leftovers of the computer ricer era, who liked to display a bunch of metrics on their screen that mostly amounted to fluff. Electron solves real problems.
Signed, someone who's built and shipped native apps on the various platforms, and groans anytime he has to do a basic chart or whatever because it'd be 10000x easier in a web browser.
Edit: furthermore, the browser handles caching things like images and what not, which bloats up the memory in Electron. There is a way to force the browser to flush that stuff out, but nobody does it. If you have a local image cache for a native app and you don't flush it, you will get the exact same situation.
It seems to me that most apps are written in Electron for two reasons: it lets you write apps in JavaScript that are conceptually very similar to web apps, so you're not learning a new weird-to-you language like C# or Swift, and it lets you go cross-platform with far less effort--you're writing one app rather than three. But this doesn't mean that you're not making tradeoffs in both performance and usability when you choose to go this route.
There may come a point in time when a well-written native app won't trounce an Electron-based app in terms of memory footprint, startup time, and integration with the host platform. But that time is not now, and it's silly to pretend otherwise.
It's also silly to pretend that users will notice or care, assuming a well written electron app. Again, look at VS Code. Now assume that the app is aimed at a non-technical audience who aren't going to be examining their resource monitors and who would never describe anything as a Mac citizen. If the customer doesn't notice or care, then the superiority of native apps does not exist.
I wish and hope that MS moving Edge to chromium is to provide a single host level run time for PWAs. It's a space they have flirted with and seem to be inching towards more quickly.
Also note that there is nothing keeping developers from adhering to Mac UI conventions that I know of. That's not a fault of Electron at all.
tl;dr - If Javascript and electron are winning it's because others are continually _failing_.
I presume this is true for other platforms/toolkits as well, and it's a tradeoff that doesn't get talked about as often as it probably should be. I'm not using a Mac because I woke up one day fifteen years ago and said, "You know, I'd love to pay a lot more for hardware than I probably should just so I can get minimalist industrial design, too few ports, and dubious keyboards." I use them because I like Mac UX conventions. I've talked to many people who actively prefer Windows UX conventions, or KDE or Gnome. I am not thrilled with the notion of a world where everything is a pseudo-native PWA.
Which is the case with Chrome itself too...a pretty unpleasant experience on the Mac if you have finger memory or want to use your apps together. Sigh.
This application's purpose is to show text and little pictures (and occasionally process a few low-bit rate audio streams).
It is amazing that modern application developers are turning well solved problems for 90s computers into tasks modern computers can barely process.
The only way I think a common runtime could work is if Electron used the Runtime of the Browser. If every browser exposed an API to run JavaScript and Render HTMl using the browser's Engine that'd be great.
Unfortunately (or fortunately, depending upon your point of view), the JVM world has moved to a model of embedding a JVM with each app, as it can be less problematic for developers (and lets Oracle remove a bunch of subsystems from the JDK, reducing their development and maintenance).
On the up side, though, newer releases of Java provide jlink, so that the JRE can be stripped down to exclude subsystems that aren't used by the app. Also, several JVMs still support class data sharing, so if multiple instances of an app are launched, they can share some common class data.
VSCode is pretty much the best Emacs there is right now. Uses JS, has good package management, allows changing settings per "workspace" including enable/disable plugins, has great git support, pioneered LSP, and more.
I literally want to hate VSCode, but there isn't much to hate and any weakness it has can/should/likely-will be addressed by a plugin.
However, it is not as responsive. By that, I mean sub-second stutters, nothing game breaking, but enough to affect the feel.
Note: coding in C++, using the LSP plugin on Sublime, and the standard language support on VSCode. Building and source control done separately on the command line. I use "modific" on sublime to see the differences, and the built-in support for VSCode.
Every interaction ends up lagging like molasses, whether it is text input, window resizing, startup time etc.
We have video games that run 3D environments with gigabytes of geometry and textures at 144hz yet people are making simple text editors and interfaces with a dozen simple components (like the ethereum wallet) that run xwindows streamed over a 56.6 modem.
(My angle on this — I do high-performance 2d/3d animation work in the browser and in electron, with extensive testing of latency, energy usage, frame rate stability, etc)
I think most of the times if an Electron app is not snappy enough then the developers didn't spend enough time optimizing it, take a look at VS Code vs Atom for instance, I haven't used Atom in a while so maybe the situation in different now, but both are Electron apps, VS Code is fast and Atom is (was?) not.
VSCode also uses lazy loading so doesn't initate everything at once you click the launcher icon but does it progressively.
But a couple of years ago even simply writing inside Atom without using any extension felt sluggish to me.
TypeScript gets downcompiled to JavaScript anyway, so I don't think that's directly a contributing factor, but maybe because of the type system they can spend less time debugging and more time optimizing.
Because, you know, Microsoft.
The file searching code is in Rust (IIRC) and runs as an external process, but that is about it.
I think the main issue is the developers, some apps don't use so much memory where others seem to use too much for the features they provide, IMO most JS developers do not understand how GC works and how you can by mistake keep objects alive.
There is also the issue where you do not have a default UI toolkit and some frameworks like angular are bad for performance(I mean how in angular codes I seen data binding trigger tons of unnecessary updates but maybe some will blame the developers using it wrong)
The inevitable thing that always gets brought up is memory usage.
It's really not insanely bad if the app is important. I wouldn't use it for a calculator but if it's an important app allocating 150MB of RAM seems worth it.
The biggest change here seems to be the build system and the upgrade to Chrome.
The Chrome updates are what's important here. Since Chrome is evergreen if your behind a few versions the standard libraries in NPM just stop working.
I got bit a while back when when they were a bit behind in releases.
This laptop has 16GB, why are people hemming and hawing over 150MB???
Soon you have to micromanage your computer resources instead of purely focusing on work.
And yes, obviously if your computer is less powerful you can do less with it. Are you trying to argue that computers are classist because they don't work the same for poor people?
The 2nd point is simply that unless you're only targeting upper class and tech savvy users, 16 free Gb of RAM will not be your baseline.
Why not? If the hardware still works fine, unless we're doing something intrinsically more complex, i don't see a reason why it shouldn't work :S
It used to matter a lot more, when those people were learning, so now it has to still matter!!!111oneoneeleven
More resources should mean that I can do things that were not possible before, or that I can do more things at the same time and not that I can do less because someone is to lazy to learn something new.
Okay? Having a lot of memory does not mean a program should be wasteful, nor does it mean everyone has that.
This isn't 2008, we don't need to care about 150MB like we used to.
how do people write shit like this and not realize how blatantly user-hostile they are??
Most computers nowadays have 4/8GB, it's not that much memory compared to how much Electron uses.
And in any case, less RAM usage usually means less cache thrashing which in turn means acceptable performance.
It can be also used to quickly test an idea before dedicating platform specific resources.
I hope the team adds more features keeps Electron alive.
My big complaint isn't the resource usage, it's how the applications never feel right on any platform.
and ... honestly, almost everything that caters to a niche doesn't really try to be native, as that would often create an inferior product for that specific usecase.
though there are very bad examples as well. all these chat apps like discord, slack and rocketchat for example.
Web apps are universally worse in their UX than native.
I'd much rather learn 1 stack well, write the app once, and spend time _optimizing_ it rather then _reimplementing_ it.
- I can use the same UI components that I use for making websites and easily share code between all platforms. Maybe this will change in the future with the advent of WebAssembly, but right now no other stack gives you this.
- Bundling a cross-platform auto-updating app is wonderful. I just have to configure electron-webpack [1] and everything is taken care of. In the past I've made a password manager with GTK3 + Python, bundling it was a real nightmare and I don't think the situation improved much in the last few years.
- Sometimes, like when you're going to need a HTML renderer anyway, using basically a browser for rendering the UI can actually be an advantage, a couple of examples:
Example 1. Evernote needs to render their notes, basically arbitrary HTML, and the macOS app uses Safari's engine for this. Now they have to check across all platforms if their notes are always rendered the same, even for rendering a simple note they show you a spinner, and the native UI is arguably ugly anyway. In comparison my soon-to-be-released Electron note-taking app [2] looks more native to me, it's faster, requires less resources, and I get cross-platform support basically for free.
Example 2. I was using Ship [3], an app for managing GitHub issues. The native parts of the UI were written in Objective-C, the issue/comments part were written using web technologies, and their server was written in C#. What you get is an app that doesn't work across platforms and sharing code between all the parts of your application is basically impossible.
- Lastly I'm by no means an expert on other cross-platform UI toolkits, but some of them try to mimic the native widgets and do an awful job at that, as a result I don't have any Java GUI app installed because they all looked like crap to me, how many do you have installed on your desktop?
[1] https://github.com/electron-userland/electron-webpack
I propose that using web components for desktop/mobile applications is not a good thing.
It may not be, but it can be the difference between a developer releasing something that has real value to end users versus not releasing anything at all.
One could say that building an Electron app is an example of doing things that don't scale.
Agree, every platform has it's distinctive look & feel and as a user I expect that my apps follow this for 100%. Recently I checked out Flutter, with the 1.0 release i thought it's worth to play around with it. The first thing i did, was installing their demo app on my iPhone they showed on the release event. Within seconds I noticed that there was something wrong. They tried hard to reimplement the bounce effect during scrolling on iOS, but it just didn't feel 100% right.
I totally understand, that not every user out there has this sharp eye for things like that and that there is definitely a business value going cross platform, but this is not something I would be proud as a developer. It's the cheap root for the developer ending up in a cheap experience for their users. Share your business logic between platforms if appropriate, theme it for your CI if needed, but do the UI as expected.
(Arguably that's a problem with Flutter too because it isn't "native" nor "web", it doesn't entirely meet the expectations of web users currently either.)
For better and worse, the web is a ubiquitous platform, and I think getting to be just about the only platform that matters today, regardless of the remaining fan wars between the "native" platforms.
https://amp.businessinsider.com/time-spent-mobile-browsing-v...
https://amp.theguardian.com/technology/appsblog/2014/apr/02/...
Even though they are old, the trend at the time was clear: people are spending more time in apps (most of which are probably native) than on the web. The idea that the web is universal and what most people spend their time on isn’t a fact you have established.
Web technologies are loved by developers for their speed and ubiquity. But as a user, I strongly prefer the feel of mobile apps for my day to day interactions. I find the web, particularly on mobile, to be a mess. The interaction models are all unique and confusing and typically not well implemented, while native UI widgets work well and are understood.
I don't have numbers to back it up, I have a lot of anecdotal evidence I've seen, but it does look like there seem to be at least as many people that don't care what widgets an app uses, so long as the app works, as there are people such as yourself that even notice native UI widgets and care about them (deeply and vocally, as often the case may be).
I know of no other framework that gives me this power.
We use websites with different UIs every day, can you imagine if we were also complaining that Facebook doesn't feel "native"?
There are definitely awful Electron apps, but that's usually because of the developers, not because of Electron.
However, most importantly for my day job, it's not good for security. Adopting Electron requires me to accept the same structural weaknesses that led to all of the NPM malicious commit issues that have cropped up lately, and with Electron it runs as me, the user, not inside a browser sandbox. As a dev in a security team, not inadvertently creating attack vectors is literally part of my job, so that combination of factors is scary. In hindsight... I'm putting Discord in a sandbox.
Other native languages/SDKs/frameworks don't have this issue if only because so much of them come from first party entities and it's very viable to cut implicit trust to the repositories.
That makes Electron not a viable option for anything related to my day job unless it's guaranteed to be running in a VM, closed off from everything else. When some of the Node.js permissions related stuff gets put in, I'm going to like Electron much, much more than I do now.
You could actually not use any external modules in your main process and have the renderer process sandboxed [1], node integration [2] can be disabled too.
[1] https://electronjs.org/docs/api/sandbox-option
[2] https://electronjs.org/docs/faq#i-can-not-use-jqueryrequirej...
Unfortunately, that only covers the rendering code, and it still backtracks a lot of the reason putting JS into a native environment is convenient in the first place. But it's a lot better than the "nothing at all" I thought it was before.
If you are so unlucky to be stuck on an ancient laptop with not enough ram, spinning disk, and an OS that doesnt't do the right things with virtual memory (non stop swapping for no good reason), that's going to be noticeable and annoying. Been there, done that, and it sucks.
If that is the case and you are a professional developer, get some decent gear, set it up properly, and stop whining. If on the other hand you are an end user, adjust your expectations accordingly to the fact that you are running old crappy hardware and don't try to install everything and the kitchen sink; or alternatively just be patient. Most users need nothing else than a browser running these days.
That's the kind of tricks that the DOM (so web and also Electron) were supposed to make irrelevant.
Write an app "naturally" with Electron, and it will likely be slow because of the DOM <-> data impedance mismatch. That's what slack is guilty of, but the ability to do so is Electron's claim to fame.
Same for their Javascript engine. Node could be running on Mozilla code instead of V8 if Mozilla had been more developer friendly.
There's more to Electron than that, but this might make it more feasible.
EDIT: seriously, it could run its own local server for privileged OS integrations, giving you an IPC API over REST.
You see endless 'concerns' about Electron resource usage. What you don't find are complaints that it's unstable, or that it only works on some desktops, or that it's hard to understand or use. It's solid, it works on all desktops and it's about as easy to use as such a thing can be for contemporary full stack developers.
For better or worse I think the whinging about resource usage isn't going to hinder Electron much.
Chrome now supports native notifications on Windows/macOS and even apps without full PWA support seem to work fine by just creating a shortcut and setting it to open as a new window without the browser's UI.
With so many Electron apps in the wild these days, it seems like a great opportunity for the standards bodies to comb them for good ideas for greater platform-wide adoption. (What are people doing in Node processes in Electron that would be tough to do in {Service, Web} Workers? What APIs for deeper native integration would be of benefit?)
For some time you could do that with any web page in Chrome, with "the create a shortcut" option. But now Chrome opens them in a new tab, not in a dedicated window.
Resource usage aside, there's far too much control of a given app being given to the Chrome team.
Who cares if it's secure but sucks so much that I'm not using it anymore?
Is the performance really that bad? Plenty of successful applications are using it. Is there a fix in the horizon?
If you think Electron works for what you need I would say use it and just ship, once you have more resources reevaluate if it is or is not working.
Chromium itself is a memory hog and apps like Slack routinely take up to a gigabyte of memory. For a fucking chat app.
How many Electron apps does the average developer run on his machine now? I'm back-end developer and I still need four or five Electron apps running to do my job.
All in all they are taking up between 4-7Gb of memory. That's just absurd to me, and we are all on 2017 MacBook Pros with 16Gb RAM. Combined with Docker, IntelliJ, Robo3T etc, I'm pushing up against my RAM limit frequently, because Electron apps are all a bloated mess. Every single one of them.
It's even worse if we start getting multiple end-user apps are written with Electron, because the average consumer machine doesn't have a lot of memory like developer machines tend to have.
This kind of development shouldn't be encouraged in my opinion.
I'm quite sure that you got that backwards. Your dev machine may run Electron apps fine with 16GB RAM, but a huge majority of average folks are on 4GB and often less. And they're already running Windows 10 (or at best OS X) and a web browser with a bunch of open tabs!
VS Code is electron, I use VS Code every day without noticing any issues. I think the complaints about electron are moot.
But this is such poor logic. We can notice these things, while regular users just suffer not knowing why their battery drains so quickly, unable to pinpoint the problem.
No, it’s not. It’s at most a trade-off. Some developers will doubtless make this their hill to die on, but I suspect it really has nothing to do with performance or battery life, and it’s likely motivated by resistance to web technologies being used on desktop vs what they’re used to.
Also I’d like to see some actual battery life benchmarks for electron, because I don’t imagine that it’s a huge deal, but benchmarks would prove the matter. It also ignores actual desktop users or users who just use mains power all the time.
Now imagine if they were all electron based and therefore consuming 1GB+ each?
Also we need to take into account that it feels slugish and they are not as responsive as other apps, and i guess it has to do with JS VM reaching the tipping point of what it can do and optmize..
Anyway, my main point is that the big problem will happen when you stack those things.. than a computer that should be more than enough, just isn't.
Even the user with low tech awareness, will close the app and feel his computer is working better.. and they will blame the company who makes the app for making their computers feel slugish in the end.
The problem is that is built around V8 tied up to Node.js, so i cant see how it will get any better giving V8 is a state-of-the-art VM already very optimized and using little resources as possible. Also you are tied to blink/webkit which together with V8 will consume a good chunk of memory and you as a dev will be unable to optimize further, giving you can use anything other than JS and blink.
> We’re also not talking about replacing every native app with electron.
Of course not. But the problem here is the trend. Companies will see how cheap it is to just reuse cheaper human resources being used to the company web dev, and how fast you can prototype an app.
The other companies who create better products because they care more, will have a hard time competing with the cheap sketchy software that cost less to build, and the worse products will likely win.
Its "the worse is better" all over again.
They’re not cheap sketchy products, you keep mischaracterising electron apps so that you have a point.
Let the market decide. If the native apps are superior, then customers will choose them more often and companies will feel the pressure to use them. Unless of course customers don’t care, as I believe, then any argument about their superiority is meaningless.
I still have a point even if/when the electron based ones have more quality or are better from the consumer point of view, because my point was not about the final quality of the finished product, but about scale and economics. Im not saying that every electron app will be inferior, this is illogical and unsustainable..
Rather im arguing that the whole model that the Electron represents will flood our desktops and even phone with cheap, memory hog apps, even when some of than are great, collectively they will be a nightmare to our computers. Users will blame the OS, or they will figure it out when they close the Electron apps, seeing their computers working better (And i guess when they get to this they will blame the company that created the product, and the bad word might start to spread).
Even with all the computational power we have now, we will have a even worse user experience than we had in the 90's with very limited computers compared to nowadays.
> Let the market decide. If the native apps are superior, then customers will choose them more often and companies will feel the pressure to use them.
My point being in the end, you wont have any options, and in some cases great products might vanish.
Im very critical of all things Apple, but this is one of the things i think Steve Jobs got right, and no wonder Mac OS and now iPhone worked out as a shield for great products that would not survive in the "worse is better" environment of Windows and the Web.
They are also great, accessible, popular, etc.. But if they were the only game in town a lot of great products would not have survived and others would not have been created. Thats what i fear about if the Electron trend gets too much hyped.. We will move fast and break a lot of great things in between.
If it gets popular, but not the monopolistic kind of popular, then its great, and good that its there as an option. But in tech we use to jump from hype to hype. (And you also can see what im trying to elucidate here by following whats happening in the NoSQL vs SQL database front)
I think you do get close to the real reason for this negativity when you say that you're afraid of it - I suspect that electron is threatening to many developers exactly because it has so much potential. It dramatically lowers the bar for access to desktop development, works on all platforms, and if it really catches on (and this is probably worst of all) it renders much of their native development experience useless.
The criticisms that it doesn't automatically look and behave natively and that it is more resource intensive are true, but I don't think they really matter. Developers here seem to be deliberately overstating the case against it in an attempt to make it go away.
Anyway, the argument doesn't matter all that much either. Electron is such a good value proposition from a development standpoint that it'll continue to see growth, and with it further optimisation, and eventually it or a web tech orientated successor will end up being pretty big.
The big thing about Electron which most developer discussions miss is that it enables low-cost multi-platform development, especially if you already have a web app. In this age when people would like to pay as close to 0 as possible for software, this is important. I have a SaaS app and people keep asking me about apps for iOS, Android and native Mac/Windows. There is no way I could afford to develop+maintain for even one of those platforms. Of course most people who ask about this would like to get the additional platforms for free :-)
Electron makes it possible for me to re-package my app as a native one, with certain benefits (easier file uploads, access to printers and peripherals, etc), and with a reasonable cost.
Everyone here knows that Electron is the cheapest way to wrap a web app. It's obviously the fastest way for someone with web but not desktop experience to create a minimum viable desktop app. It isn't the only option for low-cost multi-platform development.
You have good reasons for producing a hybrid app instead of a native app. It's questionable whether Slack does.
VSCode and Discord to me are notable exceptions, whereas most other Electron apps feel pretty sluggish. They must be doing something right that other devs using Electron are not.
That said, I do still prefer the performance of native apps. Even though VSCode is fast for an Electron app, when I switch back to Sublime Text, I still realize the performance gap is there (especially for launch times, when I'm opening a bunch of small files at once)
Sure, the bundle size is large and the memory footprint is ~200Mb but those should not be limiting factors if you have a computer from this decade.
Of course, it means you have to deal with cross-browser issues, but I guess webdevelopers are used to this anyway. I'm also aware that these projects don't provide all the APIs that Electron provides, but many apps that are really just a wrapper around a webapp this is totally fine IMO.
I can also imagine there's some potential for sharing the same engine across multiple apps, though I'm not sure if they actually do this.
Like many websites in tabs in a browser, sometimes... it's easier to just kill the tab or window, and re-open it. Usually a sign you've done something wrong in your UI handling code.
https://www.reddit.com/r/javascript/comments/6f8u2s/githubs_...
I guess the good news is that this level of dysfunction should take care of the other Electron issues all by itself if we just wait a little while.
the official site just has a logo: http://electronconf.com/
- Huge distribution size. Your code is 1% at most. 99% is redundant. I want 10 meg at worst hello world dist size. - This is more a problem in JS ecosystem in general: No good enough standardized or not way to do the frontend part of the app. Angular is not good enough, neither is React or anything else. Though it is gradually getting better.
Isn't this already outdated by months?
Has anyone played around with flutter.io? Is it similar to electron?
https://medium.com/flutter-community/flutter-on-desktop-a-re...
You can laugh, but that day is coming and I fear getting armies of college grad hipster-coders creating unreliable slow layered software until we have nothing but "Material" UI flat buttons and cursor lag when typing simple messages in a simple application. AHHHH