Looks like a thin wrapper around Tauri. The README doesn't do a good job at explaining why one should use this over Tauri itself.
From what I understand, this project attempts to implement a subset of the Electron API so that the library can act as a "drop-in replacement" for simple enough Electron apps. If this understanding is correct, then I think Electrico has the potential to significantly boost adoption of Tauri.
For those who don't know: Tauri is a collection of Rust libraries that allow using an operating system's "native web view" (WRY) and a Rust backend for the process backing a web view (there is an IPC layer between JS and Rust). The overall result is that, on Mac OS and Windows, one can distribute native executables without needing to bundle either Node.js or Chromium. There is no startup cost of loading Node.js, since a native Rust binary is used. As for the web view itself, startup tends to be faster than Chromium, since the libraries for e.g. WebKit are usually pre-loaded by the OS itself. Tauri apps have near-instant startup time, and I've found it to be a joy to use. The only downside is that the backend must be written in Rust. Electrico seems to help soften the learning curve by providing JavaScript APIs mirroring that of Electron.
Isn’t that just a randomly abandoned version of something of uncertain origin, on average? Why would one want use it? I guess to save distribution space.
I don’t have a “top”-deps itch, but using an arbitrary webview sounds compatibility hell even to me.
From my understanding the main difference between electron and other WebView Containers (besides built-in APIs) is that electron runs your nodejs code in the same process as your browser code.
So there is no cross-process communication, true synchronous communication between browser and nodejs code, ability to communicate without copying memory and without serialization, etc. All these capabilities are essential if you do a lot of processing between the two sides. It is also why electron must bundle a browser (and its v8 engine) and can't rely on the OS browser like other solutions do (which might not be v8 or might be the wrong version of v8).
From my understanding this is not the case of any other WebView wrappers tech (Tauri, Wails). Which makes them unsuitable for some kinds of applications (invoking a function cross-process is extremely slow).
I am not sure how correct I am with these claims as I never did a lot of electron. If you have a deeper insight I am quite curious about the topic.
Isnt another downside that the javascript in the OS web view could be different and lead to having to support a significant number of different webview versions. If you ship chrome with your app, you get to choose the conformance.
Is it possible to have some kind of electron/tauri/,.. based runtime, but without the actual app? The users would need to install this runtime only once.
The apps would need to be installed separately.
The apps could be just the plain html/js/css/assets maybe packed within a zip, with a dedicated extension. The runtime would take care of the installation.
That way the devs could develop with their FE-stack of their choice and ship just the small packages.
Does this make sense?
It does sound a lot like what Progressive Web Apps (PWAs) are supposed to be. It's very close to how the original Manifest.json worked when given an html/js/css/assets list.
Only a couple of browsers supported that version of Manifest.json. Chrome developers thought it was too much of an 80/20 solution and decided to get deep in the weeds of the 20% instead of delivering the 80% solution while they worked. That's what got us the way too low level and hard to reason with Service Worker APIs for PWAs. It's over-engineered for the 20% of use cases in a way that makes "easy" 80% so much harder than it ever should have been. Chrome developers still randomly promise the web that the "easy high level API" will arrive any day now, but looking at the mess that is Workbox (their team's supposed-to-be high level building block library for Service Worker PWA APIs) it still doesn't look like it will happen any time soon.
It's more the shame because we briefly had a simple JSON manifest format for assets. That JSON format should have been easy to emulate in the Service Worker APIs if those APIs truly were meant to solve the problem, not just solving more interesting problems in a related space that a minority of use cases needed. Google doesn't currently have enough incentive to make PWAs easy to build, and as long as Chrome is the majority browser, Google is the major obstacle.
This doesn’t work. Developers move on to a next version for reasons out of their control. Now a user has a version hell, just like c:\python{all, sorts, of, versions}, and probably a versioned file extension. Bundling tens of megabytes is not a problem for the last ten years. Having everything you need right in your backpack is a good thing for everyone.
It could be feasible if software communities didn’t tend to underimplement features and then solve them by intertwining all sorts of dependencies and their maintenance policies. For example, for as controlled thing as typescript, there are at least four popular ways to “just run” projects, all with different quirks and issues (tsc & node, ts-node, swc-node, tsx). Although it was obvious that people would want to run and watch .ts files based on tsconfig.json, without an explicit compilation step.
I guess that sounds like the normal web/progressive web apps/web archives (especially with the push to more platform APIs in browsers)? Also, Tauri uses the system's WebView2/Webkit runtime, so it essentially works like this already.
This is a pretty standard type of architecture, it's essentially how anything that runs on a virtual machine works. Back when visual basic was popular, it actually surprised me that Microsoft never ended up bundling the VBDLL files with the OS itself allowing developers to ship significantly smaller installation bundles.
Those projects in general have Alot of problem, AND this is a wrapper on top of them.
>Wry also needs WebKitGTK for WebView.
WebKit have a lot more security problems and compatibility issues and are not as updated as chromium based, electron.
There's nothing wrong about chromium based engines like electron. They are just a little bigger for download a little slow to start but that's it. If your code is well developed they are fast and snappy.
Discord is one good example also vscode
WebKitGTK has some really bad performance issues. I've written an app using Tauri and it works very well on Mac and Windows, and it does nothing particularly intensive. On Linux the performance is awful. The Tauri devs acknowledge this and seem to have plans to move off it, but moving to another solution (basically packaging chrome like electron does) is obviously a lot of work.
Yeah, I tried Tauri for a bit, and this was the primary issue I quickly found as well. Generally you use these kinds of tools to be able to easily do cross-platform UI. With Tauri every single OS you target will use a different underlying web browser engine, which means you'll still be running into many platform specific issues.
Especially webkitGTK is just a drama, it's barely able to do layout for basic tables in a performant manner.
In my experience in the current implementation Tauri is not ready for production. I've seen some preliminary work by the Tauri devs to investigate if they could use some standardized webview engine, but that's still very far away.
I like this, as the author of LRCGET (which is made with Tauri), I hate debugging something that works on Windows (Microsoft Edge WebView2) but doesn't work well or doesn't work at all on Linux (Webkit2gtk) or macOS.
One of the example is audio playback. Chromium and in turn Edge WebView2 have great support, but make it work in Webkit2gtk is a big pain in the *s. I then decided to switch the audio playback feature to Rust side (using Kira and Symphonia) instead.
Having Chromium bundled eliminates all the pain about inconsistency between webview engines, and using Rust means we don't have to pay for the NodeJS size in our app bundle (plus better performance).
For Tauri, I think something like Servo will fit well as bundled browser engine. Hopefully some day it will happen.
I’m honestly just waiting for someone to add Rust bindings for Electron (instead of gluing Node to C++ in the main process, and using WASM for the renderer process instead).
Someone may ask why - simply to have options. Tauri is great but there are many users complaining (with justification) that relying on the platform webview sucks, especially on Linux.
In general, there’s no reason Electron can only have a Node API.
I still don’t understand why we’re using any of these Electron-style “apps.”
Ship a web application, or write actual native apps. Electron and that flavor of “app” development is the worst of all worlds.
Just like the JavaScript web frameworks have turned what should be small web applications into huge monsters — Electron has made what should be relatively small, high performance applications into these bloated resource hogs.
I get it, JavaScript developers want to be part of the fun and there is definitely a use case for tiny resource-constrained startups still changing product-market fit. But companies like Slack for instance — worth billions of dollars and can’t find a way to write a high performance desktop app in Swift for MacOS instead opting for Electron.
Think of the climate! All that extra power required to run these resource hog Electron apps on tens of millions of computers isn’t trivial, not to mention a neutered user experience that results from not taking advantage of actual native applications.
JavaScript isn’t the panacea people want it to be.
Electron makes it easy for companies but it makes it rougher for the victims.
And Tauri and all the others are simply different flavors of the same shit sandwich.
Go to app store on your iPhone, swipe refresh and see how heavy all those native SwfitUI apps are and we are talking only about app updates. You will barely find app less than 100MB and few that are even 300MB+. Didn't check if they are also as heavy on desktop. So that's at least regarding app size on environment impact native apps at least using SwiftUI not making it better - I would say they make it even worse since javascript apps can just autoupdate non native part without downloading whole bundle (and I think this is what slack and discord doing for some updates). SwiftUI apps are also not as fast as UIKit apps not sure about memory performance.
In practise I will take any JetBrains IDE or VSCode over native XCode IDE anytime - XCode is such a big heavy hog.
It's great that you mention the climate impact of Electron apps, because those bloated monsters truly are a huge problem; though I think you underestimate how much the Tauri team's focus has been on shrinking app size to alleviate the environmental impact made by the download of said huge Electron apps.
One of the things that actually made me interested in Tauri in the first place was their 1.0 Release[0] which included information on just how much CO2 output would be saved by switching from Electron to a similar Tauri app (600Mb vs 3MB)
Of course you're right that if, instead of using Web UI in the first place, companies went straight to native apps then there'd be even more savings to be made -- but there's trade offs to be made with regards to aligning OSs and reusing components and onboarding engineers and writing good cross-platform tests when working in native that just aren't there when working with a WebUI, and something like Tauri which has many of the upsides with fewer of the externalities of Electron should be applauded at least as a step in the right direction.
For me, writing JS is not great, but using HTML and CSS is what just resonates for me when it comes to building front end applications. If I need some device privileges that a browser cannot grant me, then I will use a HTML/CSS based renderer for that app.
Now, I have grand visions for an embedded servo renderer that can be driven using native compiles rust, not JS. But who knows if we will get that one day
This does make sense from a "crafting great software" perspective.
But building three separate codebases in comparatively niche GUI frameworks full of platform-specific quirks when you could achieve 95% of the quality with a single JS/TS codebase comes across pretty terribly as a business decision. It's hard to justify what is likely a 10x-ish cost multiplier with "it uses less RAM" or "the scrolling feels more natural". While large companies can afford it, the cost-benefit still doesn't look good to them.
koito17|1 year ago
From what I understand, this project attempts to implement a subset of the Electron API so that the library can act as a "drop-in replacement" for simple enough Electron apps. If this understanding is correct, then I think Electrico has the potential to significantly boost adoption of Tauri.
For those who don't know: Tauri is a collection of Rust libraries that allow using an operating system's "native web view" (WRY) and a Rust backend for the process backing a web view (there is an IPC layer between JS and Rust). The overall result is that, on Mac OS and Windows, one can distribute native executables without needing to bundle either Node.js or Chromium. There is no startup cost of loading Node.js, since a native Rust binary is used. As for the web view itself, startup tends to be faster than Chromium, since the libraries for e.g. WebKit are usually pre-loaded by the OS itself. Tauri apps have near-instant startup time, and I've found it to be a joy to use. The only downside is that the backend must be written in Rust. Electrico seems to help soften the learning curve by providing JavaScript APIs mirroring that of Electron.
Overall, nice project.
wruza|1 year ago
Isn’t that just a randomly abandoned version of something of uncertain origin, on average? Why would one want use it? I guess to save distribution space.
I don’t have a “top”-deps itch, but using an arbitrary webview sounds compatibility hell even to me.
DanielHB|1 year ago
So there is no cross-process communication, true synchronous communication between browser and nodejs code, ability to communicate without copying memory and without serialization, etc. All these capabilities are essential if you do a lot of processing between the two sides. It is also why electron must bundle a browser (and its v8 engine) and can't rely on the OS browser like other solutions do (which might not be v8 or might be the wrong version of v8).
From my understanding this is not the case of any other WebView wrappers tech (Tauri, Wails). Which makes them unsuitable for some kinds of applications (invoking a function cross-process is extremely slow).
I am not sure how correct I am with these claims as I never did a lot of electron. If you have a deeper insight I am quite curious about the topic.
cyanydeez|1 year ago
This seems very overlooked in your evaluation.
5kyn3t|1 year ago
WorldMaker|1 year ago
Only a couple of browsers supported that version of Manifest.json. Chrome developers thought it was too much of an 80/20 solution and decided to get deep in the weeds of the 20% instead of delivering the 80% solution while they worked. That's what got us the way too low level and hard to reason with Service Worker APIs for PWAs. It's over-engineered for the 20% of use cases in a way that makes "easy" 80% so much harder than it ever should have been. Chrome developers still randomly promise the web that the "easy high level API" will arrive any day now, but looking at the mess that is Workbox (their team's supposed-to-be high level building block library for Service Worker PWA APIs) it still doesn't look like it will happen any time soon.
It's more the shame because we briefly had a simple JSON manifest format for assets. That JSON format should have been easy to emulate in the Service Worker APIs if those APIs truly were meant to solve the problem, not just solving more interesting problems in a related space that a minority of use cases needed. Google doesn't currently have enough incentive to make PWAs easy to build, and as long as Chrome is the majority browser, Google is the major obstacle.
wavemode|1 year ago
wruza|1 year ago
It could be feasible if software communities didn’t tend to underimplement features and then solve them by intertwining all sorts of dependencies and their maintenance policies. For example, for as controlled thing as typescript, there are at least four popular ways to “just run” projects, all with different quirks and issues (tsc & node, ts-node, swc-node, tsx). Although it was obvious that people would want to run and watch .ts files based on tsconfig.json, without an explicit compilation step.
explodingcamera|1 year ago
vunderba|1 year ago
danenania|1 year ago
v3ss0n|1 year ago
>Wry also needs WebKitGTK for WebView.
WebKit have a lot more security problems and compatibility issues and are not as updated as chromium based, electron.
There's nothing wrong about chromium based engines like electron. They are just a little bigger for download a little slow to start but that's it. If your code is well developed they are fast and snappy. Discord is one good example also vscode
jemmyw|1 year ago
Deukhoofd|1 year ago
Especially webkitGTK is just a drama, it's barely able to do layout for basic tables in a performant manner.
In my experience in the current implementation Tauri is not ready for production. I've seen some preliminary work by the Tauri devs to investigate if they could use some standardized webview engine, but that's still very far away.
timeon|1 year ago
Discord constantly downloads huge updates and vscode uses too much memory (not counting LSP) for text editor.
fs0c13ty00|1 year ago
One of the example is audio playback. Chromium and in turn Edge WebView2 have great support, but make it work in Webkit2gtk is a big pain in the *s. I then decided to switch the audio playback feature to Rust side (using Kira and Symphonia) instead.
Having Chromium bundled eliminates all the pain about inconsistency between webview engines, and using Rust means we don't have to pay for the NodeJS size in our app bundle (plus better performance).
For Tauri, I think something like Servo will fit well as bundled browser engine. Hopefully some day it will happen.
mkl|1 year ago
I like how Linux is so important it gets two mentions, but Windows is left out. Presumably that's a typo though?
fredoliveira|1 year ago
unknown|1 year ago
[deleted]
yoav|1 year ago
Only supports ARM Mac at the moment but windows and linux support coming soon.
https://www.electrobun.dev
ijidak|1 year ago
throwitaway1123|1 year ago
mirzap|1 year ago
AbuAssar|1 year ago
lucasyvas|1 year ago
Someone may ask why - simply to have options. Tauri is great but there are many users complaining (with justification) that relying on the platform webview sucks, especially on Linux.
In general, there’s no reason Electron can only have a Node API.
fithisux|1 year ago
briandear|1 year ago
Ship a web application, or write actual native apps. Electron and that flavor of “app” development is the worst of all worlds.
Just like the JavaScript web frameworks have turned what should be small web applications into huge monsters — Electron has made what should be relatively small, high performance applications into these bloated resource hogs.
I get it, JavaScript developers want to be part of the fun and there is definitely a use case for tiny resource-constrained startups still changing product-market fit. But companies like Slack for instance — worth billions of dollars and can’t find a way to write a high performance desktop app in Swift for MacOS instead opting for Electron.
Think of the climate! All that extra power required to run these resource hog Electron apps on tens of millions of computers isn’t trivial, not to mention a neutered user experience that results from not taking advantage of actual native applications.
JavaScript isn’t the panacea people want it to be.
Electron makes it easy for companies but it makes it rougher for the victims.
And Tauri and all the others are simply different flavors of the same shit sandwich.
pzo|1 year ago
In practise I will take any JetBrains IDE or VSCode over native XCode IDE anytime - XCode is such a big heavy hog.
lost_womble|1 year ago
One of the things that actually made me interested in Tauri in the first place was their 1.0 Release[0] which included information on just how much CO2 output would be saved by switching from Electron to a similar Tauri app (600Mb vs 3MB)
Of course you're right that if, instead of using Web UI in the first place, companies went straight to native apps then there'd be even more savings to be made -- but there's trade offs to be made with regards to aligning OSs and reusing components and onboarding engineers and writing good cross-platform tests when working in native that just aren't there when working with a WebUI, and something like Tauri which has many of the upsides with fewer of the externalities of Electron should be applauded at least as a step in the right direction.
[0]: https://tauri.app/blog/2022/06/19/tauri-1-0/#environment
conradludgate|1 year ago
Now, I have grand visions for an embedded servo renderer that can be driven using native compiles rust, not JS. But who knows if we will get that one day
danenania|1 year ago
But building three separate codebases in comparatively niche GUI frameworks full of platform-specific quirks when you could achieve 95% of the quality with a single JS/TS codebase comes across pretty terribly as a business decision. It's hard to justify what is likely a 10x-ish cost multiplier with "it uses less RAM" or "the scrolling feels more natural". While large companies can afford it, the cost-benefit still doesn't look good to them.
adhamsalama|1 year ago
I think web apps/Electron apps may be a factor in reaching the year of the Linux desktop.