Would Tauri be a viable alternative to Electron ?
Hi Team,
First of all, we highly appreciate the work done on Rocket Chat, so thank you for that.
This is not an issue but rather a question about the feasability to use Tauri instead of Electron for the desktop version ?
In my option, it could improve a lot of aspect of Rocket Chat (security, memory consumption, FOSS, etc ..)
You can find information on this interesting project here : https://github.com/tauri-apps/tauri
@tassoevan This wouldn't be a nice solution for the upgrade issue windows client are facing ? (see #1205 or more recently #1670 ) ?
This post needs more up votes. I don't understand how something as simple as install update never worked. Multiple posts on this and the rocket chat team never properly addressed it. And if you try to install it directly from the site, that file is not current either. The only option is coming to Git for it. Right now, the site offers 2.17.9
@Rocket.chat Team please look into this.
@tassoevan This wouldn't be a nice solution for the upgrade issue windows client are facing ? (see #1205 or more recently #1670 ) ?
As stated in https://github.com/tauri-apps/tauri#app-bundles
Self Updater (in progress)
I haven't evaluated Tauri yet (as well React Native Desktop), but it looks promising. Its alpha stage is discouraging though.
@tassoevan @ggazzo @cazetto hello, team!
That table looks very impressive
I could be great solution to lots of current Electron issues like https://github.com/RocketChat/Rocket.Chat.Electron/issues/1670 (broken auto-update issue) and https://github.com/RocketChat/Rocket.Chat.Electron/issues/2098 (huge amount of RAM usage)
Maybe it is time to move to Tauri?
Not intended to be done for now.
@jeanfbrito any chance this could be reconsidered? The current Electron is very resource-heavy (RAM, CPU, storage) and Tauri has gotten even better these last couple years :)
I dont think so @ThatOneCalculator . Remember that Electron is like a wrapper around the chromium browser. Tauri is like a wrapper around the OS browser, so each OS will have its on browser being used as the webview, so in Windows it will be Edge that is chromium too.
The resource-heavy is chromium, but not only chromium but depends on what you load on it.
If you open any application that is heavy it will get hungry and take resources.
We made a GSOC project using Tauri last year and Tauri lacks a lot of things that Electron already does and at the end of the day, the resource usage is the same as the same web application being open. https://github.com/RocketChat/Tauri.Desktop.App
Tauri application is smaller because it don't have the browser part integrated, it uses the OS browser view. Electron brings the chromium on the package, so it takes more space. But as always, any POC is welcome if you want to make it.
the resource usage is the same as the same web application being open
Was that only tested on windows? Since Safari on macOS and WebGTK (WebKit) on Linux are generally a lot lighter... I'll check that project out and give a bit of a performance comparison on my system (Linux) to see if there's a significant difference.
Also, in Tauri (or even Electron to a certain extent), you can cut down a lot on resources by actually having the application itself render the layout locally (instead of grabbing it from the server) – I'm not sure how much of rocketchat is server side rendered vs client side rendered but it'd definitely be interesting to look into that
Rendering locally consuming less resource than server side? I don't think so. Rocket.chat frontend is done all in react, it's all API calls to the server. You can take a look at the source code, it's all open.
Rocket.chat frontend is done all in react, it's all API calls to the server.
So it's an SPA that's client side rendered, yeah? Just making sure since React can also be served side rendered or partially hydrated.
I gave the current version a try, it seems to be in a very broken state sadly.
Here's results from a proof-of-concept I made based on https://github.com/thatonecalculator/google-chat-tauri
Features available:
- Tray icon
- Autostart
- Notifications
- Auto-updater
Resource differences:
Tauri: 66 MiB RAM, 0% CPU used Electron: combined ~372.3 MiB RAM, Electron uses 0.3% CPU
Side-by-side screenshots (left is tauri, right is electron):
(Looks the same, but Tauri is even a bit sharper with images)
Cool, I suggest that you open a server with a lot of channels and messages to see the total overhead.
You can try scrolling public channels on open.rocket.chat.
Full disclosure: memory usage seems to be inconsistent at best. Sometimes Tauri is far ahead, sometimes they're even, and sometimes Electron is better. This is all using the version loaded from the web, not sure how much better having it run locally would be.
At this point, might just be better to make a native GTK client like Fractal lol