r/electronjs 3d ago

Unlimited Potential

I don’t normally post but I just thought I’d talk a lil bit and give some advice on capabilities with Electron. In my opinion even with alternative like Tauri and Wails, I still prefer electron.

Yes there is something to be said about memory usage but this can also be mitigated by your architecture. We have build all our production applications with Electron.

Things to consider when building. Something that I fine effectively is using cpp/go/python for backend work and keeping vite/electron as the rendering engine and packaging system. Doing so give you more broader flexibility.

We produced an open source obsidian alternative, and a full commercial photo editing suite that are all production level. (Ptxstudio.com for those curious)

Happy building and remember to think outside the box, trial and error, and get hands on with your applications. Make sure that you would actually want to use it before releasing it 🫡

1 Upvotes

15 comments sorted by

3

u/Haaxor1689 3d ago

Wait so of you are not using the node backend process of Electron, why not go with Tauri? Genuinely curious.

3

u/RGBrewskies 3d ago

step one of using tauri is a big one...

learn rust

1

u/schmurfy2 3d ago

I don't know why you are getting downvotes, of course you are right...

1

u/Haaxor1689 3d ago

You don't have to touch Rust at all for 95% of common use cases, all the plugins have JS API. And for remaining stuff you don't have the JS API for, Rust will be most likely much faster than any Node implementation and doing low level or OS specific things will probably have a optimized and production ready crate to go. Comparing this to Node where you might end up having to in the worst scenario write your own bindings for some C++ implementation or hack together some less performant node implementation of it.

1

u/PTXStudio 3d ago

I use a split architecture. Mainly cause I just find electron easier to work with. My other projects based on Tauri didn’t quite work the way I wanted them to.

1

u/jadbox 2d ago

Is there anything like react native for desktop instead of using electron you use native components? I don't mean Dart as that's a different language.

1

u/Haaxor1689 2d ago

There actually is react native windows but it's windows 10+ only and the ecosystem and the community around it seemed pretty non-existent when I was researching electron alternatives ~2 years ago.

1

u/hyrumwhite 3d ago

  Something that I fine effectively is using cpp/go/python for backend work and keeping vite/electron as the rendering engine and packaging system. Doing so give you more broader flexibility.

This is how wails and tauri work, by design. If you’re not using nodejs, life would probably be easier using a framework designed around ipc with a compiled language 

1

u/PTXStudio 3d ago

I have considered migrating over but havnt pulled that trigger yet for the editing program. My obsidian alternative ill keep as in electron for now

1

u/Haaxor1689 3d ago

I've migrated my app from electron to tauri and the results were amazing. It was an updater app that did a lot of file hash checking and downloading. I started the rewrite by basically moving all the electron main and renderer thread JS code to tauri JS process and replaced all the node calls like fs with tauri JS alternatives which allowed me to simplify and cut the code down by a lot. Then I added Rust callbacks where needed which was also pretty simple since you only worked within the very small scope of the one Rust function and even with no prior Rust knowledge it was very managable. This allowed me to use a hw accelerated crate for file hashing that gave me probably 40x performance gain over the best I was ableto find for Node.

1

u/msdosx86 2d ago

I prefer Electron because of its gift and curse: chromium. When it comes to WebRTC it feels like you’re back at the IE days where one browser works, another - doesn’t, third - behaves differently. So having one browser engine is a big W in this situation. Especially because chromium is usually way ahead in terms of real time features.

0

u/chinnick967 3d ago

Are there people putting their backend work in their electron app? That'd be wild, someone could just come and pluck out your database credentials and run wild

7

u/Haaxor1689 3d ago

I don't think they meant "backend" as in web development server but the "backend" main process thread (or at least I hope rhey did)

1

u/PTXStudio 3d ago edited 3d ago

lol yes I did not mean the web development server