Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use electron alternatives #4

Open
SamuelScheit opened this issue Aug 8, 2021 · 27 comments
Open

Use electron alternatives #4

SamuelScheit opened this issue Aug 8, 2021 · 27 comments

Comments

@SamuelScheit
Copy link

https://github.com/sudhakar3697/electron-alternatives

Why electron-alternatives?

There are better lightweight alternatives for electron:

  • 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)
  • electrino (simple system built-in web-view)
  • Tauri (Build smaller, faster, and more secure desktop applications with a web frontend)
  • Sciter.JS (Is a 5MB HTML/CSS/JS (ES6) runtime aimed as a direct Electron replacement)
@insertish
Copy link
Member

insertish commented Aug 8, 2021

While I don't want to personally be using electron, most alternatives have at least one or two flaws with them.

  1. Use native web view, while in theory this sounds like a great idea, certain systems could have insanely outdated browsers backing the web view and in some cases features just straight up break because of the browser being used in particular. For example, WebKit is super inconsistent between platforms and systems, on my system personally most web pages fail to render properly. Although, this is still a great approach for Windows where the web view is commonly backed by a Chromium engine, but then we would need a separate build. (this affects DeskGap, electrino)
  2. Lack native capabilities, both electrino and Sciter.JS look like nice alternatives but both list the lack of a Node.js backend. (though if it comes in the near future, I would definitely look into them again, electrino may not provide all the electron APIs we need either)
  3. Straight up don't work. I've tried both Neutralinojs and Tauri, haven't managed to get either one to work properly.
    (it may work now but other issues stand)
  4. Don't have a stable ecosystem. Electron has thousands of developers on it already and there's a few native features the app provides which are provided through electron specific libraries, while this could be done manually, it will require extra time.

I think for the time being, leaving this to end users to create alternatives is probably the best idea, there is already a 3rd-party web view backed app available and I can probably expect people to make native apps as well, someone mentioned they wanted to build a Qt app.

@insertish insertish added this to Needs Triage in Release Tracker Sep 12, 2021
@shawny43
Copy link

I heard there a way to build your app by using Servo, an open source web engine made from the makers of Firefox and powered by Linux Foundation.

https://servo.org/

@insertish
Copy link
Member

I think it's still early days for Servo, a lot of major things are missing and the app refuses to run in Servo anyways.

@insertish insertish moved this from Needs Triage to Stalled / Drafts in Release Tracker Oct 9, 2021
@Genbuchan
Copy link

Best practice is uses os built-in native UI toolkit for example macOS Cocoa. But this choice will increase development cost.

However this choice will be best if you prioritize accessibility, performance, optimization per platform. 🚀

@Rexogamer
Copy link
Member

Realistically, maintaining separate clients wouldn't be possible for us at this stage - it'd also likely introduce various inconsistencies across platforms. However, using an Electron alternative may be possible at some point and is something we may consider doing in the future :)

@cyrneko
Copy link

cyrneko commented May 27, 2022

Best practice is uses os built-in native UI toolkit for example macOS Cocoa. But this choice will increase development cost.

However this choice will be best if you prioritize accessibility, performance, optimization per platform. rocket

And then Linux entirely falls into the water as there's no "One fits all" solution to Linux system webviews as far as I'm aware 🤷‍♂️

@FelixKLG
Copy link

I'm just going to bump this as I'd like to say that recently Tauri hit version 1.0 and is now in a stable release. I have a feeling that whatever issues you had then most likely have been mitigated.

https://tauri.app/blog/2022/06/19/tauri-1-0/

@shawny43
Copy link

Should go to React Native for Revolt Chat? This could help for mobile platforms and Desktop.

@ggtylerr
Copy link

I'd also like to bump since I've personally found out about Neutralino a few days ago and it works like a charm.

@insertish
Copy link
Member

insertish commented Jan 24, 2023

Just dropping a little update to this, someone did do a little preliminary test and I will probably try it out too but, it may be the case that we use Tauri for the new client that's currently being written if all goes well.

Should go to React Native for Revolt Chat? This could help for mobile platforms and Desktop.

React Native is great until it gets a bit more complex at which point it can be a pain to work with.

Edit: also also, this isn't for desktop but Infi is working on a native Android client we will be distributing going forwards

@ggtylerr
Copy link

Edit: also also, this isn't for desktop but Infi is working on a native Android client we will be distributing going forwards

Is there a public repo for it yet?

@Rexogamer
Copy link
Member

Rexogamer commented Jan 27, 2023 via email

@ggtylerr
Copy link

Understandable, have a good day 👍

(Also the stuff in your email that has the unsubscribe link is in your comment)

@toastxc
Copy link
Member

toastxc commented Jan 27, 2023

Apple's Safari remains one of the biggest problem for cross platform apps, and I don't think that will change anytime soon. That said I'm excited to see how Tauri implements mobile cross platform in the future but I don't see any viable alternatives to the status quo in the short term.

@SzczurekYT
Copy link

As Pakrohk suggested in #105 a native app would be a cool feature, especially for people on low end PC's (not me). I think that Flutter might be a good alternative to electron. With one codebase you get a native app for everything - windows, linux, macos, andorid, ios. If you used an object oriented language before Dart is pretty easy to learn, I would say it's java, but better. Also more static (you can't for example load new code at the runtime, but this isn't very important here).
I don't say Dart & Flutter are perfect, but they are definitely worth considering.
(Flutter is a framework for the Dart language)

@insertish
Copy link
Member

I think that Flutter might be a good alternative to electron.

The major issue with this is that we just don't have the time or team required to completely switch to a new framework and language. It would require replacing every part of the frontend and require having to rebuild all the components we use from scratch.

@SzczurekYT
Copy link

I think that Flutter might be a good alternative to electron.

The major issue with this is that we just don't have the time or team required to completely switch to a new framework and language. It would require replacing every part of the frontend and require having to rebuild all the components we use from scratch.

Yeah, unfortunetly this isn't easy.

@SzczurekYT
Copy link

Actually I want to try to recreate Revite just in Flutter and Dart as a proof of concept. Can I try to do that? Can I reuse the assets? If I understand the licensing stuff correctly I must license my project under GNU AGPL v3.0?
I will probably give up or get bored after few days rather then make something functional, but still I want to at least try doing this, might be a fun project.

@barnabwhy
Copy link

Socket Runtime looks somewhat promising, it has an option to use a node.js backend. It is quite new though I'm not too sure if it's as great as people say. It is probably worth looking into though

https://github.com/socketsupply/socket

@SzczurekYT
Copy link

Actually I want to try to recreate Revite just in Flutter and Dart as a proof of concept. Can I try to do that? Can I reuse the assets? If I understand the licensing stuff correctly I must license my project under GNU AGPL v3.0? I will probably give up or get bored after few days rather then make something functional, but still I want to at least try doing this, might be a fun project.

I started by trying to recreate the components lib, but quickly got bored of that, so no app sorry.
I also noticed that while Flutter is really nice tool, its' desktop support isn't very ironed out and lacks some features (for example right clicks aren't supported everywhere). I think it needs a bit more time before it will be ready for big desktop apps.
In the meantime Tauri looks promising so it's probably the best option right now (or some other electron alternative) as you don't need to switch the framework / language.

@ggtylerr
Copy link

ggtylerr commented Sep 19, 2023

I started work on my own client a while ago but I haven't been able to work on it much due to college and work. It's made in Python with PySide6, with Advanced Docking System as its layout and fman build system for building to a native client. I'm planning on releasing the source code once I get (at the very least) messaging and server/channel list working.

Also side note...

In the meantime Tauri looks promising so it's probably the best option right now (or some other electron alternative) as you don't need to switch the framework / language.

Tauri is good as a stop gap but it's definitely not a solution. You're still rendering it in chromium (at least depending on the OS), which could be helpful if multiple apps are using the system framework, but it's still essentially the same workload. (That being said, it's good for the original purpose of this issue, which is to use an alternative to Electron and not just using a completely different framework, lang, etc.)

@toastxc
Copy link
Member

toastxc commented Sep 24, 2023

I'm experimenting with Tauri WASM to see if its a good solution for web & desktop, it does still run using web technologies however there are many benefits to that as well.

@RayJW
Copy link

RayJW commented Sep 25, 2023

Tauri is good as a stop gap but it's definitely not a solution. You're still rendering it in chromium (at least depending on the OS), which could be helpful if multiple apps are using the system framework, but it's still essentially the same workload. (That being said, it's good for the original purpose of this issue, which is to use an alternative to Electron and not just using a completely different framework, lang, etc.)

Sorry to be that guy, but that's not fully true. You will only use the bundled WebView 2 engine, which is based on Chromium and only on Windows with Tauri. This is much more efficient than Electron because the native OS engine is running anyway, thus binary size and memory footprint decreases greatly.

[They are very small because they use the OS's webview. They do not ship a runtime since the final binary is compiled from Rust.](https://tauri.app/v1/references/architecture/)

Tauri is many times more efficient than an Electron app. They have a benchmark page in their docs which explains this in more detail, so I think to reduce the maintenance workload of different apps for different OS's Tauri would be a great option :) Also, Tauri v2 will support iOS and Android as well so for a small team like the one of Revolt this could be good because you only have to maintain one codebase for all platforms.

@shellheim
Copy link

shellheim commented Nov 16, 2023

The mentioned article now redirects to accenture.com. Here's the archive.org version so the future readers don't have to hunt.

@shawny43
Copy link

Should you can create revolt on gtk app or QT if nothing works?

@insertish
Copy link
Member

Should you can create revolt on gtk app or QT if nothing works?

In terms of native desktop apps:

  • fwiw there is someone building a GTK client currently (will eventually replace the repo at revoltchat/mutiny)
  • and the iOS app may be ported to macOS in the future

@insertish
Copy link
Member

Tauri is currently slated to be adopted with revoltchat/frontend#14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In Progress
Release Tracker
Stalled / Drafts
Development

No branches or pull requests