I propose that using web components for desktop/mobile applications is not a good thing.
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).
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.
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"?
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.
There are definitely awful Electron apps, but that's usually because of the developers, not because of Electron.
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.
- 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
[2] https://imgur.com/a/ZQd8Vad
[3] https://www.realartists.com/blog/ship-20.html