DEV Community

Cover image for Leaving electron.js to the past.
Akash Pattnaik
Akash Pattnaik

Posted on

Leaving electron.js to the past.

So, I recently started using tauri because electron.js was no longer working on my pc... I was amazed to see the release build size of the tauri app.
It was way smaller than expected.

Size Comparison

Electron.JS Tauri
62.5mb 4.32mb

These are the sized of installers for windows. The project was just a basic hello world displaying page.

So as you can see, Tauri is the next desktop framework for webdevs... Electron.JS is nothing compared to Tauri.
Tauri by default provides various templates for new projects like vanilla.js, react, svelte.js, vue.js and a lot more in the future. The tauri devs are also working on bringing Tauri to Android and IOS.

Tauri depends upon Microsoft Edge Runtime2 and not bulky core apps like Electron.JS depends on chromium.

Getting started with Tauri

This is for windows only, get your OS instructions on tauri.studio

This will make your ready for developing in tauri...

For Further Understanding, Check Out The Docs

Latest comments (29)

Collapse
 
tgkprog profile image
Tushar Kapila

Informative. Did not know the binary will less than 6mb

Collapse
 
mareksamec profile image
mareksamec

That still does not solve the main issue for me as a user. That is mainly big memory and CPU footprint of having essentially new browser process for every damn app I need to run.

I know it's maybe easier for the devs and you can have the apps run on Win, Mac and Linux, but the battery life and performance tax is there. And I'm not even talking about electron apps ignoring system preferences like dark mode and having issues to properly interface with peripherals like headsets etc.

Collapse
 
akashpattnaik profile image
Akash Pattnaik

that, sadly is true.
But, there are other ways of solving this solution, like building the entire app in languages like C++ or C. This might reduce the CPU usage and memory footprint but for sure is a burden on the developers.

Collapse
 
patrickweb profile image
Just Patrick • Edited

The main problem of electron is memory usage and after trying Tauri I realized that it doesn't solve this issue. The webview process that it relies on consumes almost just as much memory usage. Bundle size isn't that big of an issue with people downloading gigabytes of adobe and editing software, most people don't have as big of an issue on that.
With that said, I am yet to find the big selling point of Tauri.

Collapse
 
rohithaditya profile image
Rohithaditya

Haha Electron is also slow af....

Collapse
 
urielsouza29 profile image
Uriel dos Santos Souza • Edited

Alternatives!

NW.js (Similar to electron, provides Source code protection)
DeskGap (bundles a Node.js runtime and leaves the HTML rendering to the operating system‘s webview)
Neutralinojs (chromium module is replaced with either user’s web browser or built-in browser component. Node run-time is replaced with a lightweight web server which exposes native OS functionality)
Proton Native (does the same to desktop that React Native did to mobile, based on github.com/parro-it/libui-node)
React Native Desktop (Cross-platform React Native Desktop port based on Qt framework)
Vuido (creating native desktop applications based on Vue.js, based on github.com/parro-it/libui-node)
NodeGui (powered by Qt5, NodeGui-React, Vue NodeGui, Svelte-NodeGui)
reactxp (library for cross-platform app development using React and React Native)
quasar (Vue.js based framework, which lets web developer to quickly create responsive websites/apps)
nidium
electrino
graffiti

Sciter.JS (Is a 5MB HTML/CSS/JS (ES6) runtime aimed as a direct Electron replacement)

github.com/sudhakar3697/electron-a...

Collapse
 
devlopr profile image
Aditya Mishra

Lol, try Neutralino JS.

I was working on a Sprite Editor using web technologies, I tried electron but electron simply eats my memory like piece of cake. I tried tauri but I didn't have any prior knowledge in rust so I left, then I tried Neutralino JS, and my Neutralino app release build weighed only 850KB, in which 700 KB was my JavaScript bundle.

Tho Neutralino is currently not mature enough like Tauri or electron, but it has a great potential.

Collapse
 
imagineeeinc profile image
Imagineee

i am very intrested in tauri and have high hopes for it and would like to switch to it, and later with the androida and ios support, the only reason i am reluctant is the fact there isn't a solid backend api, and its complex to setup for beginners web developers, though I am a rust developer so I have the toolchain installed for me.

And because I am a rust developer, i'd personaly use their wry engine, a striped down version of tauri,

if I ever want to build a rust powered app in which I have full control of the application backend.

Collapse
 
akashpattnaik profile image
Akash Pattnaik

That's true, it can be very confusing for webdevs to interact with the rust API of tauri. tbh, I am backend dev and I myself found it quite difficult to use the RUST API. But the pro's of Tauri are they have a great community. The discord community of tauri really helped me a lot.

The setup part will be hard to implement in existing projects, else new projects are pretty fast forward.

Collapse
 
veresp87 profile image
Peter Vereš • Edited

Clearly you are just posting a big statement with a big title without basic knowledge of what are you talking about. Stating that this is the next framework just because of saving few megabytes od space is nonsense.

Collapse
 
ansonh profile image
Anson Heung

Tauri ships with much less bloat than Electron for a simple Hello World program, but I think it's still too early to say that Tauri will definitely replace Electron. Nonetheless, it's very exciting to see a new alternative to Electron :)

Collapse
 
abdullaniyaz12 profile image
Abdulla Niyaz

More like throwing a frustration at electron xd,

Collapse
 
akashpattnaik profile image
Akash Pattnaik

thats exactly the case cause my pc doesn't work with electeron.js.

Collapse
 
newdev0 profile image
Devesh Pal

Nice to meet ya!

Collapse
 
tbogard profile image
Erick Rodriguez

Here my problems with Tauri and it is the lack of backend: Tauri doesn't show options for you to build a business layer to manage subservices in your app. Copying a file? Saving a encoded audio from your app based on your configurations? Tauri can't do it. In comparison, electron has a main process that behaves like a backend with communication with your frontend.

I would change to Tauri if it offers a solid robust API for a main process, which don't have.

Collapse
 
akashpattnaik profile image
Akash Pattnaik

That's possible, use the RUST API, just create your functions in rust and invoke them with window.__TAURI__.invoke('functionName')

Collapse
 
timleg002 profile image
Timotej Leginus

You don't need to invoke every command globally

Thread Thread
 
akashpattnaik profile image
Akash Pattnaik

Yeah, i was just giving an example, they have a pretty well documented docs at tauri.studio .

Collapse
 
stevepryde profile image
Steve Pryde

Couldn't you just code that up in rust and expose it as commands? Isn't that the intended use case? I thought electron changed recently to be more client/server and it became much more strict about communication between the two, for security reasons

Collapse
 
duridah profile image
durid-ah

I hope that's part of their road map before hitting 1.0