Rocket.Chat.Electron icon indicating copy to clipboard operation
Rocket.Chat.Electron copied to clipboard

Would Tauri be a viable alternative to Electron ?

Open Nono-m0le opened this issue 6 years ago • 15 comments

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

Nono-m0le avatar Jul 10 '20 13:07 Nono-m0le

@tassoevan This wouldn't be a nice solution for the upgrade issue windows client are facing ? (see #1205 or more recently #1670 ) ?

Nono-m0le avatar Jul 27 '20 12:07 Nono-m0le

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.

Vkat14 avatar Jul 28 '20 17:07 Vkat14

@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 avatar Sep 02 '20 22:09 tassoevan

@tassoevan @ggazzo @cazetto hello, team! That table looks very impressive image 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?

ankar84 avatar Sep 14 '21 05:09 ankar84

Not intended to be done for now.

jeanfbrito avatar Aug 04 '22 21:08 jeanfbrito

@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 :)

ThatOneCalculator avatar Jul 25 '24 02:07 ThatOneCalculator

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.

jeanfbrito avatar Jul 25 '24 11:07 jeanfbrito

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.

ThatOneCalculator avatar Jul 25 '24 13:07 ThatOneCalculator

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

ThatOneCalculator avatar Jul 25 '24 13:07 ThatOneCalculator

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.

jeanfbrito avatar Jul 25 '24 13:07 jeanfbrito

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.

ThatOneCalculator avatar Jul 25 '24 15:07 ThatOneCalculator

I gave the current version a try, it seems to be in a very broken state sadly.

ThatOneCalculator avatar Jul 25 '24 18:07 ThatOneCalculator

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)

rocketchat

ThatOneCalculator avatar Jul 25 '24 19:07 ThatOneCalculator

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.

jeanfbrito avatar Jul 26 '24 13:07 jeanfbrito

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

ThatOneCalculator avatar Aug 01 '24 01:08 ThatOneCalculator