element-hq / element-desktop

A glossy Matrix collaboration client for desktop.
https://element.io
GNU Affero General Public License v3.0
1.16k stars 267 forks source link

Consider switching from electron to tauri #771

Open niwla23 opened 3 years ago

niwla23 commented 3 years ago

Hi, This issue only applies to the desktop version, but the issue tracker is disabled on that repo so I asssume this tracker should be used.

I would suggest switching from electron to tauri once it is out of beta. Reasons for tauri:

Here you can find a more detailed comparsion of both frameworks: https://github.com/microsoft/vscode/issues/118308#issuecomment-800078214

ShadowJonathan commented 3 years ago

I don't think the core team will go ahead with a proposal like this, as electron has proven itself quite reliable, and tauri is something new.

If you can illustrate a working Element Desktop using tauri, without much maintainance overhead, with considerable performance improvements, only then I think will tauri be fully considered as an alternative.

SimonBrandner commented 3 years ago

I believe there are two main things to consider:

  1. Migrating all of the code would be a pain
  2. I am not very sure if Tauri supports things such as screen-sharing which are quite essential

Though I believe that if a community maintained version appeared and it supported all the features, some sort of migration wouldn't be impossible

mo-rijndael commented 2 years ago

I've built element-web using Tauri, looks like it works perfectly. Going to try to port element-desktop

ShadowJonathan commented 2 years ago

Also; once possible, i'd like to see a feature-by-feature and benchmarking comparisons of the two, so that the element teams can see the tradeoffs themselves, this'd make the choice easier.

HKalbasi commented 2 years ago

My results on testing element web on tauri vs element desktop on electron:

Bundle size:

Ram usage:

And tauri is considerably slow and laggy (300 ms lag between mouse click and screen update). I believe the problem is that chrome is better than webkit-gtk, so on windows result should be more close (And I expect tauri outperforms electron on windows) because windows webview2 is based on chromium.

t3chguy commented 2 years ago

Does your bundle size comparison for tauri include the native bits of Element Desktop namely seshat & keytar?

HKalbasi commented 2 years ago

No, I used element web for simplicity, as mentioned above. How much do you expect it would increase?

For the record, here is what I exactly done. You can replicate it in a little amount of time:

  1. Download element web tar from https://github.com/vector-im/element-web/releases/tag/v1.9.8
  2. Start a new tauri project via npm x create-tauri-app, select vanilla option
  3. Unzip element into dist folder of the project
  4. Build the project using npm run tauri build
  5. There will be an appimage and a deb package. I runned the appimage one, logged in to my account, and measured the ram usage and speed.
t3chguy commented 2 years ago

The extra element-desktop bits are 36MB when extracted from the deb image

HKalbasi commented 2 years ago

So... we should close this?

Roxiun commented 2 years ago

@HKalbasi

Bundle size:

* tauri: 21.4 MB deb package, 87.7 MB appimage
* electron: 82.4 MB deb package from official repository

Ram usage:

* tauri: 430 MB (I love to see that I done something wrong)

* electron: 227MB

And tauri is considerably slow and laggy (300 ms lag between mouse click and screen update).

Running this with your same instructions (no other config) and building on macos has given me slightly different results. I haven't experienced any lag with tauri so far in electron. And with Cinny its been awesome

Bundle Sizes:

@t3chguy

Does your bundle size comparison for tauri include the native bits of Element Desktop namely seshat & keytar?

I also used element web. Although on macos i get the following prompt when using Element-web built with tauri:

Screen Shot 2022-09-17 at 6 25 59 pm

Does that mean that it actually does store the data in secure enclave as mentioned in vector-im/element-desktop#773

I've been looking for something better than an electron app for a while. I used to use the iPad catalyst app but tbh that really doesnt work well on a non-touchscreen device, and I dont think it makes sense spending time on porting a swift version solely for mac

t3chguy commented 2 years ago

Tauri Bundle (Apple Silicon) 25.7mb Electron Bundle (Universal) 445mb

Any chance to compare apples to apples (Universal v Universal)? Otherwise this is kind of misleading

I also used element web. Although on macos i get the following prompt when using Element-web built with tauri:

That'll be tauri using the keychain for its WebCrypto implementation, if you lack encrypted message searching then that's because you didn't bundle the native matrix-seshat. Keytar will also access the keychain but won't say anything about WebCrypto.

Does that mean that it actually does store the https://github.com/vector-im/element-desktop/issues/773 as mentioned in https://github.com/vector-im/element-desktop/issues/773

You'd need to consult tauri docs for what it does with this WebCrypto Master Key, that isn't part of Element. It likely won't secure localStorage and IndexedDB though.

alfredonodo commented 1 year ago

Any update about this?

Titaniumtown commented 1 year ago

Would love to see this happen!

proJM-Coding commented 2 months ago

My main 2 reasons for not using element is electron and I can use something more lightweight. I don't plan to use element unless there is a tauri build or it moves to tauri. It has been 3 years since we were told:

tauri is something new Are there any updates on this now that tauri is much older? Would love to see even a build of it.