News for hackers. Stuff that matters.
Re:Electron Fiddle: The easiest way to get started with Elec... by zhs on Saturday February 25, 2023 @08:54PM (#34942300)
Honest question, when solutions like https://github.com/tauri-apps/tauri exist out there that promise smaller build sizes and similar developer experiences, are folks still using Electron to build new apps?
Re:Electron Fiddle: The easiest way to get started with Elec... by nassimsoftware on Saturday February 25, 2023 @09:35PM (#34942501)
A reason to keep using Electron rather than Tauri is when you need to make sure the UI is going to be displayed the same way on each platform.

Tauri uses the OS's native webview which means that there can be differences in how the DOM is displayed. It's not the same browser engine being used for each platform.

Re:Electron Fiddle: The easiest way to get started with Elec... by mysterydip on Saturday February 25, 2023 @09:10PM (#34942378)
I've heard of electron, but not tauri. Maybe it's just not known enough to be included in the decision?
Re:Electron Fiddle: The easiest way to get started with Elec... by david422 on Saturday February 25, 2023 @09:10PM (#34942383)
Same. I figured I could be out of the loop but ... so are other people.
Re:Electron Fiddle: The easiest way to get started with Elec... by timcobb on Saturday February 25, 2023 @09:10PM (#34942377)
Yeah Tauri is in Rust, whereas I want to write the backend and frontend in the same language (TS) and share code
Re:Electron Fiddle: The easiest way to get started with Elec... by heapwolf on Sunday February 26, 2023 @02:40AM (#34943818)
Rust is a non-starter for the majority of web devs. That’s why Tauri had remained niche.

Maybe try https://github.com/socketsupply/socket

Re:Electron Fiddle: The easiest way to get started with Elec... by Ygg2 on Sunday February 26, 2023 @03:21AM (#34943974)
> That’s why Tauri had remained niche.

> try https://github.com/socketsupply/socket

Points to an even less popular niche.

Re:Electron Fiddle: The easiest way to get started with Elec... by heapwolf on Sunday February 26, 2023 @04:33AM (#34944269)
It was just open sourced, if your pointing out how few stars it has. It also hasn't been officially announced. But HTML, CSS, and JS are far less niche than Rust.
Re:Electron Fiddle: The easiest way to get started with Elec... by bitfracas on Monday February 27, 2023 @02:35PM (#34960855)
Correct. This is objective.
Re:Electron Fiddle: The easiest way to get started with Elec... by Ygg2 on Tuesday February 28, 2023 @12:14PM (#34971866)
I'm pointing the inconsistency of the argument.

If you want popularity, there is already Electron.

Re:Electron Fiddle: The easiest way to get started with Elec... by doodlesdev on Saturday February 25, 2023 @09:00PM (#34942328)
Unfortunately despite Tauri being very performant, small, and having good UX it looks like most projects are still using Electron. I've built a prime number calculator which draws a graph in the webview using Tauri [0], this has was part of a series of projects of mine that calculated prime numbers and displayed them to compare performance of browsers and backend languages. The application does all the calculation in Rust and I got to say I will never ever go back to even considering Electron again.

I believe the reason why people look to still be using Electron is simillar to why people use React. Sure it's a bit bloated, a bit hard to master, it has some design flaws, but it's well adopted, and hundreds of successful companies use it in production. Meanwhile Tauri is rust the new kid in the block.

[0]: https://github.com/DoodlesEpic/GraphPrime

Re:Electron Fiddle: The easiest way to get started with Elec... by aliencat on Saturday February 25, 2023 @09:04PM (#34942347)
One problem with Tauri is that it doesn't bundle Node runtime, meaning that you can't take advantage of the npm packages that works outside of a browser environment. It does allow you to use Rust packages, but that's another story than Javascript.
Re:Electron Fiddle: The easiest way to get started with Elec... by schemescape on Saturday February 25, 2023 @09:21PM (#34942442)
Yes. As a user, I’m rooting for Tauri, but as a developer, I could probably build my app faster using Electron. Unfortunately, past experience tells me that companies usually optimize for ease of development instead of performance, most of the time :(
Re:Electron Fiddle: The easiest way to get started with Elec... by zamadatix on Saturday February 25, 2023 @09:01PM (#34942335)
There is something to be said for a unified frontend and backend that closely mirror the existing browser API just extended. It comes with it's downsides too, where Tauri obviously shines, but really I see Tauri and Electron as two different approaches not direct competition. Last I checked Rust was still the only native backend too, that changing may help its story. Of course there is always the ecosystem size difference too but that normally sorts itself out with time.
Re:Electron Fiddle: The easiest way to get started with Elec... by stu2b50 on Saturday February 25, 2023 @09:09PM (#34942374)
It's not really the same developer experience. Because it's a browser JS engine it's much less powerful than electron, and you need to write more rust as a result. For many people that's probably not a demerit but for others it will be.
Re:Electron Fiddle: The easiest way to get started with Elec... by aerhardt on Saturday February 25, 2023 @11:24PM (#34943030)
I’ll reply to your question with a question: once VSCode has proved one could build hyperscale complex apps that perform well, would you be fast to bet for less proven tech?

I’ve had a great experience using VSCode on occasion (I’m a JetBrains guy), and loads of other people, including some great programmers, rave about it. I’ve similarly had a fairly solid experience with Spotify desktop across different platforms.

I’m asking genuinely, is it such a subpar choice when there’s such proven success cases?

Re:Electron Fiddle: The easiest way to get started with Elec... by matt_holden on Saturday February 25, 2023 @11:40PM (#34943084)
Also: Figma, Linear, Notion, Slack, Superhuman, Pitch, Loom. All Electron.

I’ve never understood the hate Electron gets on HN, when it powers so many great products that users love.

Re:Electron Fiddle: The easiest way to get started with Elec... by TexanFeller on Sunday February 26, 2023 @12:00AM (#34943191)
The ones of these I've actually used like Slack are doggie doo. Aside from using way more resources than a chat app should, last I checked basic UX was not close to on par with native, like right mouse clicks didn't do anything but bring up the built in browser menus.
Re:Electron Fiddle: The easiest way to get started with Elec... by operatingthetan on Sunday February 26, 2023 @12:46AM (#34943390)
>like right mouse clicks didn't do anything but bring up the built in browser menus.

You should try this in slack again...

Re:Electron Fiddle: The easiest way to get started with Elec... by chrisweekly on Sunday February 26, 2023 @03:51AM (#34944087)
That UX decision has nothing to do w/ Electron.
Re:Electron Fiddle: The easiest way to get started with Elec... by operatingthetan on Sunday February 26, 2023 @02:28PM (#34948525)
If someone brings up a single example they should ensure it aligns to their criticisms, as a rule.
Re:Electron Fiddle: The easiest way to get started with Elec... by clumsysmurf on Sunday February 26, 2023 @12:21AM (#34943277)
I don't mind using an Electron app. The problem is, they are multiplying too fast. I currently use: 1Password, VS Code, Discord and / or Element, Obsidian, and Postman. They use most of the machine's resources doing nothing at all.
Re:Electron Fiddle: The easiest way to get started with Elec... by shp0ngle on Sunday February 26, 2023 @02:05AM (#34943714)
Slack took great pains to make the client not be a memory and CPU hog.

Still better than Teams though. (Which is also in Electron.)

Re:Electron Fiddle: The easiest way to get started with Elec... by pantulis on Sunday February 26, 2023 @06:57AM (#34944869)
You can also see the pains the Evernote team took from the initial Electron-based 10 release until it became usable again. But you could also feel the product moving again after stagnation on a gazillion native clients. It was the right albeit mostly final engineering decision they took.
Re:Electron Fiddle: The easiest way to get started with Elec... by pqs on Sunday February 26, 2023 @07:05AM (#34944896)
It surely was the right decision, but it came too late.

Also, still the app is almost worthless on my Android phone. Too slow, despite large improvement.

Re:Electron Fiddle: The easiest way to get started with Elec... by bboygravity on Sunday February 26, 2023 @03:09AM (#34943926)
I don't think you realize how slow those are, how slow they make your entire machine (eating the RAM for no good reason) and how insanely fast similar apps could be if written in something that doesn't involve massive bloat.

Electron is also how Microsoft essentially broke Skype (on purpose?) IMO.

For me Electron just stands for lazy companies/devs who are not interested in producing something elegant that runs as fast as possible.

Re:Electron Fiddle: The easiest way to get started with Elec... by eecc on Sunday February 26, 2023 @03:44AM (#34944060)
Honest question: where does all the RAM go? If a chrome tab eats about 200 MB ram, shouldn’t an electron app consume about the same? After all Electron is just an SPA with all the assets packaged with the browser engine. Like the zip’d web archives of yore
Re:Electron Fiddle: The easiest way to get started with Elec... by 0x073 on Sunday February 26, 2023 @05:01AM (#34944370)
Chrome engine is build for browsing the web multiple windows multiple tabs etc.

If you drive with a empty truck with trailer it uses more oil than a car.

Chrome is not designed for this. There are other engines like https://sciter.com that are work for single apps, but probably scale bad if they are misused as a browser.

Re:Electron Fiddle: The easiest way to get started with Elec... by lozenge on Sunday February 26, 2023 @08:43AM (#34945465)
I just opened Chrome to a news website and got 400MB of usage on the "GPU Process", 150MB on the "tab" process, and 100MB on the "browser" process. In Electron the webpage doesn't have access to native APIs like the system tray, so that's done by exchanging messages with an extra process.
Re:Electron Fiddle: The easiest way to get started with Elec... by esperent on Sunday February 26, 2023 @03:52AM (#34944094)
> I don't think you realize how slow those are, how slow they make your entire machine (eating the RAM for no good reason)

You're on a forum full of software developers, I think you can give us credit for knowing exactly how much resources the apps we use take up.

Personally, I frequently run VSCode, Slack, Zoom, Chrome, and occasionally Loom at the same time on a machine with 8gb ram and it's fine. Until one of these new platforms like Tauri or Socket.sh catches up, the trade off for developers being able to develop once and run on multiple platforms is entirely understandable and clearly acceptable to most people.

Re:Electron Fiddle: The easiest way to get started with Elec... by qorrect on Sunday February 26, 2023 @11:01AM (#34946494)
Fully agree on all points, I've never had a performance issue with Electron.

I have had Slack fill my home directory with logs once , long time ago. But that wasn't an electron problem.

Re:Electron Fiddle: The easiest way to get started with Elec... by Kiro on Sunday February 26, 2023 @05:51AM (#34944596)
Cool. I'm a single developer releasing software for free which is only made possible by Electron and wouldn't exist without it but I guess I'm just lazy.
Re:Electron Fiddle: The easiest way to get started with Elec... by qorrect on Sunday February 26, 2023 @11:02AM (#34946503)
You're lazy and you should feel bad! /s
Re:Electron Fiddle: The easiest way to get started with Elec... by detrites on Sunday February 26, 2023 @03:50AM (#34944082)
"Powers" being a relevant word here. People love to call out various tech/choices for needlessly sending our energy into a black hole, has anyone run the numbers for Electron's negative impact versus a non-wasteful solution?
Re:Electron Fiddle: The easiest way to get started with Elec... by 2h on Saturday February 25, 2023 @11:39PM (#34943073)
> VSCode has proved one could build hyperscale complex apps that perform well

did it though? It might perform "good enough", but its still an order of magnitude worse than native solutions. the only reason to ever use Electron or similar is for rapid prototyping. once you have an MVP, you should immediately work towards a native solution. people seem to forget that part, out of laziness or ignorance.

Re:Electron Fiddle: The easiest way to get started with Elec... by simonw on Saturday February 25, 2023 @11:52PM (#34943154)
What's your theory on why the VS Code team haven't migrated to native solutions for their app?
Re:Electron Fiddle: The easiest way to get started with Elec... by AlotOfReading on Sunday February 26, 2023 @12:13AM (#34943251)
They do have a native solution you might be familiar with, "Visual Studio". It took them a solid decade to port it even from 32->64 bit (finally released last year). Hard to blame them for some institutional PTSD around the whole idea of native apps.
Re:Electron Fiddle: The easiest way to get started with Elec... by Renaud on Saturday February 25, 2023 @11:56PM (#34943176)
You have to define ‘worse’ because raw performance isn’t really everything and vscode’s popularity proves it.

Feature set and extensibility have clearly won here. At a certain performance point, it’s good enough and what you can do with it matters more.

I’m not sure you could achieve the sane flexibility in a more native, “bare-metal”, development environment. Possible, yes, but it would probably not be as successful as developing for it would be somewhat harder.

Vscode is “fast” enough. Its extensibility and its ecosystem are what makes it so popular and successful.

I’m not sure you can build the same without trade offs.

Re:Electron Fiddle: The easiest way to get started with Elec... by jeremy_wiebe on Sunday February 26, 2023 @12:13AM (#34943252)
I use VS Code daily and I have never had performance issues. That obviously doesn’t apply to all folks.

Also, it seems presumptuous to prescribe what appropriate solutions are for all people of all time. There are many, many places where an electronjs would be just fine.

Re:Electron Fiddle: The easiest way to get started with Elec... by yjftsjthsd-h on Sunday February 26, 2023 @12:49AM (#34943405)
> Also, it seems presumptuous to prescribe what appropriate solutions are for all people of all time. There are many, many places where an electronjs would be just fine.

And many where it wouldn't. It seems more presumptuous to me to demand that users have machines with that much memory and CPU to spare.

Re:Electron Fiddle: The easiest way to get started with Elec... by zztop44 on Sunday February 26, 2023 @02:33AM (#34943798)
No one is demanding anything. VS Code exists. Lots of other code editors also exist. Many are native. Choose whichever one you want.
Re:Electron Fiddle: The easiest way to get started with Elec... by Ygg2 on Sunday February 26, 2023 @03:17AM (#34943958)
I did use it and find it subpar to JVM based IDE (namely Jetbrains). Yes, both are memory hogs, but Jetbrains feels smoother.
Re:Electron Fiddle: The easiest way to get started with Elec... by eastbound on Sunday February 26, 2023 @04:16AM (#34944177)
> once you have an MVP, you should immediately work towards a native solution.

All of the chat apps that worked towards a native solution have died. Most of the other apps too, but all of the chat apps. Going native, despite being satisfying for the user, carries a maximum cost in terms of internal organization (several departments in the company for each target OS), HR (developers that can’t be recycled in other departments), marketing: “Wait, does HipChat MacOS has the same features as HipChat-on-the-mac-but-in-browser? Wait it doesn’t matter, HipChat is dead.”

Re:Electron Fiddle: The easiest way to get started with Elec... by gbear605 on Sunday February 26, 2023 @09:45AM (#34945910)
Telegram, which is easily the best chat app by software quality, has native apps on all platforms (well, QT on desktop, but that’s close enough). iMessage is native as well, and widely used, though it has admittedly fewer target devices. Those are the two I use daily, so I definitely don’t live in your Electron world, and I’m happy for it.
Re:Electron Fiddle: The easiest way to get started with Elec... by madeofpalk on Sunday February 26, 2023 @10:30AM (#34946267)
What are the 'native solutions'?
Re:Electron Fiddle: The easiest way to get started with Elec... by nocommandline on Sunday February 26, 2023 @12:07AM (#34943218)
Electron is very well known & has a large footprint - lots of existing tutorials, extensions/plugins/libraries, regular bug fixes. There are also lots of existing large Apps that can serve as reference. If you Google - building cross-platform desktop Apps, most of the results will point to electron.

If you already know JavaScript (lots of people do) & are trying to quickly get your App up & running, then it can make sense to just go with Electron rather than trying to learn a new language like Rust.

Both reasons were why I picked electron to build https://nocommandline.com

Yes, Electron Apps are big but in the grand scheme of things, they might not matter so much for now (laptops are being built with bigger memories, Apps are being improved to manage memory).

Re:Electron Fiddle: The easiest way to get started with Elec... by tomkarho on Sunday February 26, 2023 @05:26AM (#34944480)
Here's a couple

- Not everyone wants to learn Rust but want to use the same language throughout their stack

- Tauri is still new which means it is not considered "tried and true"

- More developers know how to use Electron or at least know enough Javascript to learn which means larger talent pool = cheaper and easier to replace developers if need be

- Last I checked (was not recently I admit), the build time for Tauri was abysmal

- I would argue very few gives a damn about smaller build sizes unless the problem space actually requires size to matter

In short, Electron is established tech and "good enough" while Tauri is the new kid in the block. It takes time for it to carve a space for itself. With all the Rust hype going on, I don't doubt it will happen.

Fun fact: I actually embarked on a project recently where my plan is to build the app in Electron first and once I had a change to learn Rust, I'll probably try to migrate the Electron app to something like Tauri.

Re:Electron Fiddle: The easiest way to get started with Elec... by croes on Sunday February 26, 2023 @06:21AM (#34944712)
If the OS webview gets breaking changes your tauri app breaks too.

Electron bundles the browser therefore the size.

Re:Electron Fiddle: The easiest way to get started with Elec... by CJefferson on Sunday February 26, 2023 @06:52AM (#34944846)
I tried using Tauri (about 6 months ago, so things maybe have improved), and found lots of inconsistencies and issues between platforms. It did work well on my "dev platform", but then things often misbehaved on other platforms.

I'm not sure many people are refusing electron apps due to the size, but they would definitely reject a buggy app that didn't work on their platform.

Re:Electron Fiddle: The easiest way to get started with Elec... by mmgutz on Sunday February 26, 2023 @07:05AM (#34944897)
Tauri and similar are only as good as the webviews on the system. My trials with webview based alternatives showed they use slightly less ram as electron at startup, but later use more memory and perform worse in FPS. (Linux)

Not really seeing an advantage other than a smaller binary.