- cross-posted to:
- mobiledev@programming.dev
- cross-posted to:
- mobiledev@programming.dev
I fucking hate Electron
If given a choice between an electron app and nothing, I choose the electron app.
same. still dont like them tho
I choose nothing.
Or a website
I’ll talk nothing over a terribly implemented Electron app that devours system resources and brings every other Electron app down when it inevitably OOMs.
You hate electron or you hate developers who make inefficient electron apps? Some examples? (Serious question, because I make electron apps)
There’s no such thing as a efficient electron app. First electron apps have 80MB of overhead since electron needs to bundle a whole ass browser. Also in runtime this requires 120MB of ram.
If you really want to use webviews to make an app use Tauri.
The literal most popular IDE amongst software developers is VS Code that’s built on Electron.
I know. I also use VSCode. However I just hate how much ram it uses. I had a Laptop with 4Gb of ram and I could not open VsCode on that thing when I had literally anything else open because the system would freeze.
Just because VsCode uses Electron doesn’t mean that Electron is not bad
Tbf, it’s typically language servers and extensions causing cpu and memory footprints. If you were to open a dumb txt file, I doubt you’d encounter issues. The app itself is pretty light. I say this as a neovim user who has managed to make its memory footprint balloon _
Can confirm. No matter how lightweight your IDE claims to be, if rust-analyzer uses 1GB RAM per project you have open and takes 30 seconds to start up, then that’s that.
Source: learned Neovim having been promised it would be a lightweight alternative to a more mainstream IDE that would also speed up programming with keyboard shortcuts. By the time I added enough plugins to make it usable, only one of those two things was even debatably true.
Idk my vscode hardly ever uses more than 1-2 gigs.
My NeoVim (which can leverage VSCodes plugins) uses about 60MB for an entire project.
And doesn’t have the stink of Microsoft and its associated user tracking.
What language are you using? For me the rust-analyzer background process takes 1GB on average by itself
Yes. Thats a fuckton for a code editor. I also have an operating system that needs ram too. And if I open a browser it’s over
I think parsing code and all the dependencies will require way more than 120MB of RAM so for VS Code the overhead doesn’t matter that much. For smaller apps 120MB of ram is insane.
lite-xl with LSP gives you most of the features of vscode (they’re both lsp) at a tiny percentage of the system resources
In my experience LSP actually consumes quite a bit of resources. I’m using nvim with LSP and it’s definitely not tiny percentage of what other IDEs are using. The editor is light, LSP is not.
I love vs code but that does not mean electron doesn’t suck
This comment feels like it just stepped out of a time machine. I can’t remember the last time I fretted over 200MB of overhead/memory usage.
I’m in no way judging you, merely commenting on how different our use cases and expectations are.
This is a problem. Computers got faster over time and one would assume apps would also open faster. But no, developers that don’t care about their application’s performance (or companies, most of the time it’s not the developer’s fault) cause us to wait longer. Microsoft recently tweeted that they managed to get Microsoft Teams startup time down to 9 seconds from 18. I mean what the fuck.
How much Rust do I need to know to use Tauri?
Last I checked, almost none. They provide a JS API for common functions, so as long as you’re keeping things relatively simple you might not have to touch much Rust at all.
Huh, that’s neat. From their docs it does seem like aside from some scaffolding, I shouldn’t need to write much Rust.
Mainly electron itself. For example the discord app (which uses electron) is less memory efficient (and much more restrictive etc.) than just a separate Firefox instance. It also had many problems with being up to date, but that’s due to the discord devs deciding they want an own, custom electron, based on an outdated version. The main problem with electron for me stems from the chromium base, as basically any large app based on chromium (discord, spotify and steam) has massive flickering and performance problems on Wayland+Nvidia. A special combination, but still a factor for a ‘cross platform’ framework.
On the other hand, stuff like Signal never had any problems on my machine.
So, just use the stock electron, optimally the system one [electron binary], and see if you can enable wayland compatibility natively (otherwise we need to use environment variables etc., which works moderately at best).
So, just use the stock electron, optimally the system one
What? The system what?
The “system electron” 🥹
I meant the system electron, as there are standalone electron packages
System electron?
Do you mean installing electron from your distro’s package manager?
Developers who make inefficient apps. Most apps are sadly utter garbage
Capitalism forces developers hands into taking the cost-cuttingest approach to everything over doing it right.
Often times there’s just no reason to package a web app into an app container.
PWA needs more support.
At least Google does this one. Mozilla & Apple like to lag on the PWA front. Sucks that Mozilla dropped SSB before it ever even launched. Apple only just this year announced supporting the Notification API which ended up stonewalling a past project since it was a required feature for our app.
Yes
A pile of HTML + JS is the only cross platform GUI toolkit that’s practical to deploy.
I’m not really happy about it myself, but realistically there’s not any other option than just bundling a website into a wrapper.
And to pre-empt any replies; your proposed solution must support Windows, Linux (X11 and Wayland), MacOS, iPhone, Android, Chromium and Firefox.
Java, of course. /s
3 billion devices can’t be wrong!
Real talk; if Java didn’t have their head up their own arses, it would have been the real solution. But Oracle does what Oracle does.
Do not anthropomorphize Larry Ellison.
And to pre-empt any replies; your proposed solution must support Windows, Linux (X11 and Wayland), MacOS, iPhone, Android, Chromium and Firefox.
If you are a website, that’s easy, you are actually making the correct choice with Electron insofar that you want a browser.
If you’re doing an application not a webpage, then we’re walking W+L+Mac+Phones, that’s more tricky. I’m assuming for a second you want a usable UI (otherwise we’d be using Electron again :P ) so we’re talking two applications at least, one for mobile, one for desktop + maybe iPads.
And then it’s usually already too pricey to bother:
- Web frontend devs are far cheaper than application developers.
- Might as well just do a website, runs in everything. Only need to develop once.
- Updating is immediate with a website, don’t have to do any deployment/upgrade/downgrade plans.
I think Flutter and Avalonia both tick all those boxes.
Does Avalonia support Wayland? Last time I checked it wasn’t complete yet.
Just checked, and unfortunately no, Wayland is still in preview.
If you count browser engines, don’t forget Webkit.
Why is Firefox a ‘platform’? I’m assuming chromium is for chromeOS devices, but I don’t know of any device that just runs Firefox.
they probably meant web versions of the app that run both on chromium and gecko (firefox) browser engines
As Communism said, yeah I was ment a web application. No need to spend dev time working on a different version of your app if you can just reuse the web version.
deleted by creator
Avalonia and Uno Platform if you are working with C#
Chromium and Firefox are web browsers, of course they only support HTML+JS. That’s what they were designed for.
of course they only support HTML+JS.
WebAssembly is becoming more popular, which lets you run code written in languages other than JavaScript in a browser. It’s not possible to do everything yet, so you still need some JS code and a bridge between the WASM and JS, but it’s getting there. Emulators that run in the browser often use it.
I don’t think, there’s currently any plans to introduce a non-JS API for accessing the DOM. It would just take an insane amount of implementation work + documentation.
But frameworks can generate access code for you, so you don’t actually need to write any JS yourself. Rust is quite far ahead in this regard, thanks to the
wasm-bindgen
library.
I know the guy working on makepad is trying to solve this problem along with vr headsets, Apple tv, etc. It’s really painful because of dependency bloat messing with build times so he ended up rewriting a bunch of things 🤷♂️.
Raylib.
qt?
JUCE is weirdly capable of non-audio related UIs and runs on all these platforms.
“Here’s a website that you needed to install on your phone to see!”
They want you to install the app so they cand send you notifications/ads.
Yup. That plus steal all your contacts and anything else they can get direct or indirect permissions for.
using a phone to browse the internet
i seriously hope you guys don’t do this
Definitely! I work at a computer 8-10 hours per day, 5 days a week. The last thing I want to do when I’m done working is sit at computer some more. I do almost all of my browsing on my phone. Firefox Mobile Nightly, plus NextDNS, plus Nord VPN, plus uBlock origin, plus a fake user agent string. I’m pretty secure on my phone.
Bruh. Phones are just essentially ARM + Linux pocket PCs.
I though the same but I tried Tauri and it makes sense. Unlike electron you’re not shipping the entire browser with your app and the the low level stuff is just rust so the integration is nice and easy. And using webview for UI? Why not? The reactive libraries are actually nice to work with, it’s easy to customize, you have all the tools to inspect/debug your code. It’s definitely better then trying to fit GTK into rust.
I’m using Tauri to play around with Rust. I like it so far.
I always thought it uses far fewer resources than electron.
What are you using from UI? JS or also Rust?
oh JS too, which kinda throws me off because I’m not bad with Web Dev, but I’m not good either and my UI looks like a bad web page than a good desktop app.
I’m actually trying to keep it simple and write my own launcher like Alfred, Albert, Kupfer but I want it to launch my own custom scripts that I can load in a directory as well.
Yeah, UI is hard. I try to use good component librarian as much as possible but actually making it look consistent is difficult.
For the UI I’m using leptos. It’s actually very nice and using rust on both front and back means there’s couple less things to worry about.
If you don’t like webapps, make native UI frameworks easier to use and cross-platform…
lol they did, that’s what webapps RUN ON. TBH I don’t get the original complaint. Lots of people have bad webapps; back when native apps were the norm, lots of people had bad native apps. It’s not really a problem with the runtime framework.
They run on them, but its not that easy compared to a web app. Why isn’t everyone programming in machine code? Every other language literally runs on it. There is a reason we use abscractions.
Steve Jobs in 2007:
The full Safari engine is inside of iPhone. And so, you can write amazing Web 2.0 and Ajax apps that look exactly and behave exactly like apps on the iPhone. And these apps can integrate perfectly with iPhone services. They can make a call, they can send an email, they can look up a location on Google Maps.
And guess what? There’s no SDK that you need! You’ve got everything you need if you know how to write apps using the most modern web standards to write amazing apps for the iPhone today. So developers, we think we’ve got a very sweet story for you. You can begin building your iPhone apps today.
Admit it, the man was a visionary… XDDDDD
Just in case: /s
He was late to the party. Everyone by that time was trying to make applications and web development converge. Mozilla had an entire framework derived from the web.
By the year, I think this was before there was even an App Store (first generation iPhone was launched at the end of June, 2007). Jobs really believed in web apps, but the original iPhone had no power to handle them correctly, and a lot of the APIs that we have now were unthinkable at the time. I was just trying to be funny, really. :P
Jobs, whether or not he truly believed in that, gave the potential of web apps and HTML5 as the reason an App Store wasn’t needed. And definitely the reason Flash wasn’t needed.
Exactly.
You mean, it’s all Electron? 🌍👨🚀🔫👩🚀
Spend 500 hours re-engineering your application for each platform
Just using ten year old proven technology that’s built on a universal backwards compatible framework
I, too, love me some Qt… but I thought this discussion was about electron.
You say that, but it seems every major electron update will break your app.
Sure. But that’s one point of failure relative to the N points tied to each major update to a “supported” platform.
At least webviews don’t (yet, Google be trying) have the ability to request attestation & ban me for not using the stock, bloatware OS every device comes with. Bonus that I get to keep my data inside the browser’s sandbox; it’s the easiest way to be safe with proprietary software.
If only my bank could get the memo & make their website not suck (it legit checks for Netscape Navigator 4 in the source) so I can be at peace with microG+LineageOS in the phone space (all the banks here do it & I already switched once until my bank, slowly but inevitably ‘modernized’ their app).
But my beloved Netscape! How will I possibly learn a new browser? I’m too old to learn!
We switched to Flutter, works great for IOS and Android, but the website is trash.
I tried Flutter and hated it. It was buggy (there’s thousands of post on the internet saying that you have to do ‘rm ios/Podfile && flutter build ios’ and similar. the build breaks often and standard solution is ‘turn it off and on again’), the components library is too verbose and not nice to work with, the support was bad (as in open a bug report with example repo and they would react after 6 months) and everything that’s not ‘hello world’ was complicated or impossible (like writing tests). I’m definitely not using it again.
We had a third party do the development, it worked out really well. At some point I’ll need to learn it when we take it over.
Tauri uses the OS’s built in webview libraries as opposed to bundling a whole browser engine like electron. It’s still not as good as native in terms of size and speed, but it should be a lot better than electron.
If you’re going to create a desktop app in JS, React Native is better as it can use native UI elements. It does mean that the UI code may differ a bit between platforms, but you can still reuse most of your code between platforms.
Otherwise, C# with Uno Framework or MAUI looks promising for cross-platform dev.
C#
Uno
MAUI
promising
meanwhile microsoft themselves migrate away from that in favor of chromium/electron in Teams, Outlook and whatever else they ship
Microsoft use a lot of different technologies. It’s a large company and generally at big tech companies there’s no company-wide mandate about frontend frameworks/libraries. They use React Native in a bunch of things, including in Office, the Xbox app, and some of the apps that ship with Windows. They have a lot of apps written in C++. They have some Electron apps too. They have web apps using React, some using Angular, and some using custom frameworks.
deleted by creator
Cross-platform apps - The Linux experience:
deleted by creator
I’d rather wine about it than use an electron app
I do use some Electron apps, but I also can’t say I enjoy it much.
No, but when I have the choice between a platform-specific software I like and a cross-platform software I don’t, I usually go with the former.
I’ve used Linux for much longer than Electron even exists, and I’ve learned to live with what I have available.
Yes & no is my take. Usually no Linux support means a free software app is born to replace it which is awesome–or better, a previously-obscure or deserves-revitalization free software application gets its moment in the sun (rather than reinventing shit that already works cough Matrix). …The downside is when employers/client/etc. demand you use some proprietary sludge so luckily you have Electron app to get over that hurdle–tho 90% of apps in this category largely should be fine in PWA form instead of needing Electron.
I’d rather just have it working properly inside a browser, instead of it telling me that it has this neat cross-platform app, which turns out to just be Electron. On mobile that can be fine, but I dislike it on Desktop, personally.
Do excuse me if this is false, I have never actually worked with Electron on the developer side myself, however I don’t believe it offers anything you couldn’t do through a normally provided website. I know for example Discord only allows screen sharing in the desktop app, however I’ve also seen websites which allow screen sharing, so that seems more like an arbitrary restriction than anything. I mean, in the end it’s just a dedicated Chromium install for one single website, so where is the need to force the website onto your pc?
UX-wise, having a standalone “app” you can open and CMD-tab to is superior to “which of these 50 fucking tabs I have open is that app I was using…”
But, Electron also wraps your “website” and provides APIs to OS-level stuff like the camera, files, etc. It’s really quite elegant and probably the way of the future. It will absolutely get more performant as it matures.
It can do stuff that running in your browser can not. Since electron runs both the client-side code and the server-side nodeJS you can communicate between the rendering engine and the back-end for tasks that a web browser alone wouldn’t allow you to do, like accessing and navigating your local file system for example. Or if the app has a lot of assets and it needs to work offline, you can have the nodeJS backend download the files and encrypt them and have the front-end query the nodeJS and to get the decrypted assets and use the whole web app offline completely with a local database that you may sync with a webserver at some point later if or when internet connectivity is restored.
For most apps its overkill, but Electron and NodeJS can do pretty much anything a native app can do (just slower and while using a LOT more resources than a native app) but can be done entirely by someone experienced in web frontend development and nodeJS.
I am glad that atleast it ends there. It could have been worse.
Though calling them “cross platform” when all you’re doing is opening a website in a browser is IMO a bit rich. Is lemmy cross-platform, too?
If at least they had native UI elements on each platform, we’d be getting somewhere. Fitting design and all.
It’s not just “opening a website in a browser”. The UI itself is displayed in a WebView, but Electron (and Tauri etc.) also have code running outside the WebView which interfaces with native APIs etc. Just for a simple example - a normal browser application couldn’t open a file on your drive before without showing a dialog (and it still can’t without getting permission first), which Electron etc. can.
And this code is absolutely cross-platform. So how is it rich to call an application with a cross-platform UI and cross-platform functionality “cross-platform”?
Would you prefer new terminology? Like platform-neutral UI? The way I see it there’s CLI, GUI, and WebUI. When discussing platforms for the first two, were discussing the OS, but for the last the platform is the browser.
I honestly don’t care what the user interface is as long it’s efficient at getting done what I need it to do.
deleted by creator