I kind of wonder why it took this long for someone to try this approach. It just makes a whole lot more sense on the surface.
Interesting thing I just thought about: since users don't get to choose their system webview, I wonder if this has the potential to broaden browser diversity a little bit?
On Windows the default webview engine is still not the new Chromium but old Edge (WebView2 has to be installed separately), Safari has a fair amount of issues and gtk-webkit can be very quirky as well.
This is not so significant if your app has a web version and you have to deal with it anyway , but thereare a fair amount of Electron only apps. Or even with a web version, the desktop app often has special features not present on the web.
But webviews are as much a moving target as browsers and often behave differently from the regular browser version in a myriad of ways, so you need an even bigger testing matrix.
Webviews are also hard to properly secure and don't provide the extensive APIs of Electron, which you often have to bake yourself in a wrapper written in, eg, Rust or C++.
I say all this as someone who hates how resource hungry Electron apps are and groans each time about yet another one on my machine, but I understand why it is so popular.
> Webviews are also a moving target so you need a big testing matrix
I say this as a front-end web app dev who would most likely be affected by this kind of shift: it might be slightly less convenient, but I wholeheartedly think it's worth doing, on several levels.
People built web apps 15 years ago in the dumpster-fire that was web standards at the time (and frankly, web tooling too). Browsers, even the good ones, didn't update themselves automatically. Most of the world was still on IE which was actively hostile to web standards for the sake of lock-in (and users weren't even on the same version of IE!). There was nothing like Babel to smooth over the rough edges, there were no polyfills. And even the standards that existed, when you got the opportunity to use them, mostly sucked.
I think, given all that, we can deal with supporting recent-ish Chromium and the latest Safari, if it means bolstering web diversity and saving an order of magnitude in RAM and storage.
Even worse, an OS update after you ship your app can spontaneously break it on end user's machines without you knowing or being able to do anything about it.
At least with the web, when new browser versions come out, you can fix your site since users essentially "install" it every time they refresh the page. But an installed app that runs on top of a spontaneously updated framework is the worst of both worlds.
Or you would need some common runtime which is shared across the OS, and somehow use IPC to it. Then you can potentially save some more memory. But I don't think this exists. And I'm also not sure how much you really would save.
The advantage of using the system webview is that you can update this component, in case there are any vulnerabilities or so.
Good, then developers might start to develop against standards instead of handpicked browsers. Or if they use a future (unstable) standard that is their own headache (as opposed to user’s; which are subsequently in practice forced to use chromium derived browser).
An app developed against a single browser (as opposed to the web standard) should be considered what it is, an ugly hack, and developers that do it should only do it for their own private apps never to be published until it is standard compliant.
Many Windows installers package one or more Visual Studio Redistributable packages into the installer. Is that not possible for these installers?
Give up pixel-accuracy and fine-grained control of your app's UI layer, and just treat it how people like Peter Norvig and Chris Lattner treat their home pages.
There isn't any browser with even 0.1% share that can't render those things.
You also don't really have to go as far as those guys do, leaving the font 14-point Times New Roman and using HTML 1 tables. You can add some style, fonts, etc... just don't add anything that would make it _not work_ if somebody opened it in Netscape Navigator 4.
There is definitely a big downside, in that your app won't look all dope and modern. For many apps that is a deal breaker. Also, some UIs really do require a higher fidelity UI. Not all UIs are just like, buttons and menus (although a lot are).
But there is also a big upside: durability, in the sense that your app's UI will work on most 10-year old computers, and most computers 10 years from now.
https://developer.microsoft.com/en-us/microsoft-edge/webview...
Old one is, of course, kept for compatibility reasons.
That way, you're building with cross-platform in mind but still have the option to pick a stable target if you need it, compared to solutions like Electron where you don't have that choice.
Somehow I doubt the ideal solution is to bundle a web browser with every app. Electron feels like a prototype that went out of control.
Historically, it worked terribly on Windows.
On Windows, if you used the OS WebView, your Windows 7 users would be forced to use IE11 to run your app, even if they had a newer/better browser installed locally. On Windows 10, you'd get whatever random version of Edge was installed, or the new Chromium-based Edge.
In 2021, we're in a new era for Windows WebViews, thanks to Microsoft shipping WebView2 at the end of 2020, which ensures that the OS-provided WebView will be a modern version of Chromium. https://docs.microsoft.com/en-us/microsoft-edge/webview2/ Tauri supports WebView2 and I bet it will work a lot better than historical approaches.
Support is still pretty dicey on other platforms, though. macOS doesn't have anything like WebView2, so if you want to support a five-year-old version of macOS (which isn't that old in desktop terms), you'll be forced to support and test your app on a five-year-old version of Safari. (The user might have upgraded to a two-year-old version of Safari, but they might not, if they prefer Firefox or Chrome, and that's now your problem.)
The easiest and best way to improve the user's experience on old OS versions is to provide your own copy of Chromium, like Electron does.
At that point, if you've shipped an Electron app for macOS and Linux, maybe you just wanna ship an Electron app for Windows and call it a day?
Having said that, if you can keep your OS-version support matrix tight, Tauri might work OK for you.
https://gs.statcounter.com/windows-version-market-share/desk...
https://gs.statcounter.com/os-version-market-share/macos/des...
Really depends on your market I guess and how much legacy webview browser support you need.
Or really how much you'd need to add polyfills like `@babel/preset-env` to keep the JS equal.
We use WebView2 on Windows, Safari on macOS and WebKit2GTK on Linux. Not shipping a whole Chromium installation on each install and update reduces the installer and on-disk size a lot!
Like other replies have mentioned, it's not a new idea
DeskGap uses the native OS Webviews. https://github.com/patr0nus/DeskGap/
Electrino (4 years old) was an experiment where they forked Electron and removed Chromium to replace it with the native OS Web views. https://github.com/pojala/electrino
Quark is a fork of Electrino: https://github.com/jscherer92/Quark
There's also a way of building desktop GUIs using Deno, which uses Deno Webview, which is a binding for the same webview library that Tauri uses.
https://denotutorials.net/making-desktop-gui-applications-us... https://github.com/webview/webview
System webviews will always have different features, break things, and are entirely uncontrollable by the software distributor. This means your software will not be resilient to the future.
You cannot access the JS engine the same as you can V8 in most webviews. This means you can't interop with C libraries without some performance destroying hack like copying everything into the JS space through sockets.
This also means something as simple as reading a file has to, again, cross the sandbox in an inefficient way. You'd have the browser, it's javascript engine, and your own runtime in node or python or however too.
Electron develops patches that make chromium more performant and feature ready for desktop.
Electron conjoins the chromium and node v8 event loop to take advantage of libuv - again a performance improvement.
The decision of webviews and electron is based on what you're trying to do. If it's simple html/JS that's pretty much self contained then sure.
The current generation of web developers who grew up within the Chrome ecosystem has zero interest in spending time on cross browser support.
Even if the user had to install 4GB of chrome runtime they'd still argue it's better than them making it work in Chrome, Edge-Chrome and Safari WebKit.
Not saying everyone, maybe my companies hiring process is screwed but every developerbar 1 that I've worked with over the past 4 years has been the same and even getting them to test in one other browser than Chrome is honestly like pulling teeth.
Infuriates me as someone who's first job was CSS+HTML supporting IE 5.5-7.0, Firefox, Opera and Safari.
The amount of times I've heard "Can't we just tell them to use Chrome?" when talking about users is getting absurd.
The lack of understanding that a few hours of their job being slightly more difficult can add up to saving literal lifetimes of time saved or entire data centres of disk space when you extrapolate the savings across your user count. I know its maybe cheap to roll out a Steve Jobs quote but this one still resonates with me.
"Well, let's say you can shave 10 seconds off of the boot time. Multiply that by five million users and thats 50 million seconds, every single day. Over a year, that's probably dozens of lifetimes. So if you make it boot ten seconds faster, you've saved a dozen lives. That's really worth it, don't you think?"
https://www.folklore.org/StoryView.py?story=Saving_Lives.txt
The scary power of Google.
As others have mentioned, this is not the first time someone has tried. As for why people might not go for it:
- Electron is Chrome. Webview is: Cocoa/WebKit, gtk-webkit2, and Edge (or is that Edge and Edge/Chrome). Yes standards have progressed a ton but there's still inconsistencies and it's nice not having to worry about them.
- Electron is JS, so your app is 100% in a single language. In Webview. With these alternatives you now have to use 2 languages. Not the end of the world, but again, nice not having to deal with.
https://github.com/webview/webview
...has a fairly long history. It's great for extremely small application packages (when I tinkered around with it on macOS a few years ago I brought it down to 26 kilobytes).
The usual argument against the idea is that Electron gives you a fixed Chromium version to work against, while the system webviews are a moving target with different underlying browser engines.
Perhaps a similar approach to https://github.com/webview/webview ?
"Tiny cross-platform webview library for C/C++/Golang. Uses WebKit (Gtk/Cocoa) and Edge (Windows)"
One significant difference regarding webviews is Neutralino on Windows is using an outdated WebControl (MSHTML/Trident based) and this one seems to be using at least WebView (EdgeHTML based) or even WebView2 (Edge-Chromium) if available, both of which are a major improvement.
the interesting history of these sorts of frameworks is that Google actually created a framework that did this and stopped development on it. the code is still on GitHub. And there's a bunch of other frameworks that use a variety of different languages not just rust as the application language that also have this idea of not bundling chromium but instead using the system webview for rendering HTML and JavaScript.
You can find a bunch of different approaches in lists like "alternatives to electron." There's some on GitHub.
I took a slightly different approach where instead of using the system web view which I thought you know is going to be inconsistent across systems and it's not going to support the latest HTML JavaScript and security features I used the assumption that the user already has chrome installed which works in a high number of cases or can download and install it if that's not the case. predictably I suppose some people express to satisfaction that it was not using Firefox. using Firefox becomes more possible and more likely I suppose as firefox's support for the dev tools protocol achieves parity with chrome support for that.
Which is why many many people tried this approach long before Electron came along. Electron has been successful largely because it deviated from this: it swallowed the bitter pill of bundling the heavy duplicated webview in order to ensure a consistent development target.
I believe there are dozens of projects using Webview and market themselves as a lightweight "Electron". The development for these apps takes longer (as you need to test for different webview versions/vendors) and the end product is worse as some features are shimmed or you just choose to not support them due the effort required. Of course this depends by project.
I've developed a media player and considered webview. Soon enough I've found the limitations of safari, ie webview and even firefox webview on audio/video codecs is a blocker. Next was indexeddb and some random performance issues. It didn't took long to realise that it's hard to compete with native apps using Electron but its even harder using different webview versions.
I will consider webView again when WASM gets native DOM access and audio/video decoding becomes available (performance wise) in WASM.The BS of the browser tech world compounded over time and a million edge cases eventually eats up all the one-codebase, cross-platform savings.
Or something that compiles to the compatible HTML code for those platform with 100% accuracy.
Unless that happens, you are dealing with godzillion number of edge cases in hundreds of different System Browser.
But even if such language or subset of feature exist, it will still not be as good or as be limited compared what is possible on top of current Electron. Which means from a user perspective, the Dev is optimising for something they rarely cares about; download size. Given memory CPU and Memory usage to electron.
What we need is a subset of HTML features that are known to work across all major browser. From Firefox, Safari /WebKit on other MacOS, and Chrome.
What, you mean like standards? Web standards?Elevating a new stack is a good consolation prize.
it didn't - there is already a few projects like that, with Neutralino being the most notable.
On Linux it's going to pull in GTK which means a not great experience on KDE (even though KDE does have WebKit hooks like GTK does).
Right now many web apps can brush off doing QA in Safari (and Firefox for that matter). Most regular websites don't have issues, but most of those don't need any vendor-specific fixes in the first place. I've used multiple complex web apps that just break unceremoniously unless you're using Chrome.
If web apps that are complex enough to warrant a desktop app are forced to support Safari, that lifts awareness for the entire web/JS ecosystem. That's a win, if it plays out that way.
> having all the fun of web development against multiple browsers
The difficulty here has gone sharply down since all major browsers are evergreen now (and IE is all-but-gone). Not to mention the availability of tooling like Babel.
As far as I know that's not accurate and the default webview on Windows is still the old Edge based one, not Chromium.
The plans here are somewhat unknown I think, but right now you have to force the user to download and install (or bundle an installer) for WebView2 or Edge beta channel if you don't want to support old Edge.
Gtk-webkit is also quite different from Safari, you can't assume they are just the same.
It looks like Tauri uses system webviews, which use a lot less memory, but the burden is then on the developer to make sure that they build essentially 3 (maybe more) UI's on platforms that might change under their feet. That's why the Electron approach is simpler - it trades of performance for uniformity of experience across the major platforms.
But I'm wondering if it really has to be this way. Do modern browsers really need 2G of RAM in order to send and receive messages in a chat box (looking at you, Slack).
Possible, see Sciter.JS : https://github.com/c-smile/sciter-js-sdk
10 times more compact than Tauri, 20 times less than Electron.JS
Yet it has Rust API ( https://github.com/sciter-sdk/rust-sciter ), that if someone need "Made with Rust" label :)
And it works even on Windows 2000, do you remember that thing? See: https://sciter.com/necromancing-sciter-on-windows-2000/
Needing to rewrite with other UI/JS frameworks to account for quirks gives me pause.
Is this really different from the current state of web development? Front-end developers have to test against Chrome, Firefox, and Safari, at a minimum. For apps that are basically installable websites (like Slack, which has a perfectly functional webapp) this doesn't seem like that far of a stretch.
Do many companies actually do this though? I've only ever been with companies that test against Chrome. The one time at FF bug was found, that company told that client to switch to Chrome.
I know there was a kerfuffle about Airbnb and Groupon only doing Chrome as well.
https://www.reddit.com/r/AirBnB/comments/dv7v6n/customer_sup...
https://thenextweb.com/dd/2017/11/28/please-build-websites-w...
Maybe in theory all platforms are considered, but in practice many companies just do one and the others mostly just work.
Now most of the time changes aren’t even needed. Besides maybe the odd Firefox or Safari thing.
That's basically the history of Flutter. The initial goal was something like "Web: The Good Parts" and the results of that experiment led them to where they are now.
There are a few working examples, and they have dramatically lower memory footprint and are quicker to start than full fat browsers.
My first target was https://github.com/AkashRajpurohit/clipper, a neat little clipboard manager. The owner was gratious enough to officially list my project under the "Clones" section of his readme =D The result was a 6mb file, compared to the original 165mb Electron app.
The second attempt was https://github.com/girkovarpa/temps-lite, an aesthetically-pleasing weather app which was motivated largely by the fact that the original was broken and abandoned yet still had people who wanted to use it. According to the open issues and forks trying to resurrect it, anyway. The file size savings were similar to the former, and they start virtually instantly. Unlike the Electron apps which have a bit of delay and then a blank window before they finish starting up.
> The goal of the Kaleido project is to make static image export of web-based visualization libraries as universally available and reliable as it is in matplotlib and ggplot2.
> To accomplish this goal, Kaleido introduces a new approach. The core of Kaleido is a standalone C++ application that embeds the open-source Chromium browser as a library. This architecture allows Kaleido to communicate with the Chromium browser engine using the C++ API rather than requiring a local network connection. A thin Python wrapper runs the Kaleido C++ application as a subprocess and communicates with it by writing image export requests to standard-in and retrieving results by reading from standard-out.
> By compiling Chromium as a library, we have a degree of control over what is included in the Chromium build. In particular, on Linux we can build Chromium in headless mode which eliminates a large number of runtime dependencies, including the audio, video, GUI toolkit, screensaver, and X11 dependencies mentioned above. The remaining dependencies can then be bundled with the library, making it possible to run Kaleido in minimal Linux environments with no additional dependencies required. In this way, Kaleido can be distributed as a self-contained library that plays a similar role to a matplotlib backend.
1. https://medium.com/plotly/introducing-kaleido-b03c4b7b1d81
That's why is not always the best approach to appeal to whats people are saying.
Here on HN this was the #1 thing that people used to ask or complain for when the topic was electron.
"They should just integrate with the system browser" was the common saying. But the the burden would be on the developer,who would not only be back to the hellish scenario of multiple browsers implementations but also having to deal with a very skinny SDK to work with.
In the end of the day, the applications deployed on Electron will win, because they will allow developers to do much more and without the application breaking here and there because of the gimmicks of each platform.
When hearing what people say, you must have in mind the kind of the crowd you are listening to. Here on HN for instance is mostly Apple users, mostly developer types, and that's the reason why they ask for the platform browser, after asking for the platform UI, because that's how apple platform users will tend to think.. and the memory thing is the fact that most here are developers.
But that's far from being representative of the whole world of users. So, you might appeal to the particular crowd here on HN, but once you are out there "in the world" you will have a hard time facing contenders that are more resourceful than you, and the worse of all, is that it is by design. You cornered yourself into it because you forgot you are in a bubble..
Not really. Targeting the web platform and not aiming for perfect compatibility or looking the same isn't that hard.
Nowadays Mozilla it seems they don't even export the old ActiveX, let alone to have their own webview equivalent.
You _are_ measuring the total RAM usage, right? Something like `free -m` right before starting the application, and then after it warms up?
Every time I see these "electron is not heavy, it only uses X MBs of RAM", it turns out that the author looked at a single electron process (out of typically 5-10), and then only measured RSS, completely ignoring shared memory.
Tauri may be it, but the desktop SO needs this moment, I don't want to see 50 years on and Electron is still being used.
I've had some nice experiences using PyInstaller to create desktop apps.
To be clear to everyone: Electron and React Native are not alike. Electron is a big web browser. React Native work completely differently: It neither renders, computes, or runs the same. React Native uses the Hermes engine, puppeteering native components.
We got Electron, and other browser based toolkits.
Slack looks nice but feels quite broken. For example, its non native context menus are beautiful, but do not dismiss properly, do not support single-click selection, do not support spacebar to pick, do not support type-select...
When I use Slack I am constantly frustrated that things don't work the way my other Mac apps work.
Yes, I hate Electron, but the alternative is not QT; it's something like Sciter.JS with real Web API compatibility (or perhaps a stripped down WebKit2 which is much less resource-heavy).
That's how I understand it, anyway.
1. Non C++ devs don’t want to write C++/participate in the C++ ecosystem at all. While there are plenty of QT binding libraries for other languages, they seem to be of varying and unpredictable quality.
2. QT has potentially difficult licensing: https://www.qt.io/licensing/
Disclaimer: I’ve never used QT.
However, the library components offered under LGPL3 are all you need to ship a perfectly good desktop app. The GPL3 licensed stuff listed in the comparison chart on the page you linked are typically the utility applications like Qt Designer which you won't need to ship with your application anyway.
It's unfortunate how the company backing Qt is going about this. But it's a great framework overall.
(At my last firm, we shipped several apps via Qt and it's always been a joy to use.)
Meanwhile 16GB of memory is becoming common and 1TB SSDs cost less than $100. So taking up a little bit more space saves me time and money and reduces the cost to ship to my customers. Oh well.
Oh if only that was enough. My Safari is currently using 25.33GB¹ and and it regularly goes over 30.
> 1TB SSDs cost less than $100
Ah, if only it was that easy.
¹ (According to iStat Menus; it's harder to see in Activity Monitor due to the separate processes.)
Granted, it's not that often, but it feels like a lot of apps relying on it just ship their own copies of the runtime. Still saves resources if multiple apps use the same runtime version, but...
Check if the app is supported by an existing runtime, if not download it and make it available globally, otherwise use the current runtime and download only the app
#!/bin/bash
ELECTRON_RUN_AS_NODE=1 exec electron9 /usr/lib/code/out/cli.js /usr/lib/code/code.js "$@"
But most Electron apps prefer to bundle the whole runtime with their app.Sure, there are apps that get updated regularly, but not of all of them are like that, for example some company could implement some internal tool that doesnt have to get updated for years and runtime updates would present a risk with no benefit.
On electron you get closer to native apps in terms of network and OS access so I believe the PWA are and Electron are quite different platforms.If not, then no.
Electron apps are usually quite heavy because they bundle Chrome. Tauri doesn't and instead relies on webview, which uses a different browser engine dependent on your platform, with all the incompatibilities that come with it.
Isn't windows system webview now a chromium fork? This should make incompatibility on the major platforms now much less of an issue.
More seriously, there are far more folks familiar with browser frontend technologies than the myriad of desktop frameworks, rife with their own challenges.
There’re two hard problems there.
One is how to render vector graphics and fonts. So far, only web browsers do that in a cross-platform way. Windows has it’s Direct2D and DirectWrite, while Linux has nothing comparable, unfortunately.
Another higher level one is how to build easy to use GUI library on top of that. Have not approached that one. I have a few ideas but did nothing so far to address them, lately I’m too busy with other projects.
Count of pixels in displays was improving way faster than RAM bandwidth or CPU performance. Currently, this does not matter much on desktops, matters somewhat on laptops, and critically important for many mobile and embedded platforms.
When you want to render anything at all at native display resolution and refresh rate, GPU stuff is the only option that works well enough.
What is wrong with separate client and server?
But for development purposes yes there is the complication of having to acquire and install a certificate to your server which your browser will trust without questions. So yes, that is (at least) one factor making PWA development more cumbersome than it should be.
If size than not that much as Tauri is based on Node.JS that is 56 Mb executable by itself.
Yet Node.JS is pure C/C++ code. It is not clear what does "written in Rust" mean at all and what benefits Rust provides in that setup.
For the comparison: my scapp.js.exe ( https://github.com/c-smile/sciter-js-sdk#demos ) that is Sciter.JS packaged as standalone exe without dependencies is of size 5.3mb - at least 10 times less than Node.JS, Tauri and ElectronJS.
That exe includes HTML/CSS, QuickJS (ES2020) engines and essential portions of Node.JS runtime: https://github.com/c-smile/sciter-js-sdk/blob/main/docs/md/m...
So is the question above, alternative in what sense?
Before people are getting hyped around this, this is alpha software and not production ready.
My cpu fans spin up everytime Slack is open.
Sounds promising. I’d love a web view front end for Python as an alternative to tkinter.
Something that is also cool is that Rust runs really well on the web (via WASM), which opens the door to building projects primarily with Rust and deploying them to the web with a web front-end. It will not suit every case, but in some cases it might save you from asking users to download a separate app that bundles a web browser engine.
https://visualstudiomagazine.com/articles/2021/02/17/net-6-p...
C# will then be compiled to WebAssembly.
Looks like they're making good progress!
> Go, Nim, Python, C++ and other bindings are possible with the stable API.
I think something like this might actually have a lot of potential, specifically because it's much easier to create bindings for other languages with Rust than with JavaScript.
You're stuck with a NodeJS runtime to run an Electron app, even if you "compile" it. You could theoretically make bindings to another language, but you'd still be dependent on that NodeJS runtime. But this could theoretically be compiled to a relatively lightweight DLL and interfaced with using practically any language you want.
The page logic would still need to be JavaScript, of course, but that's just the nature of webviews for now.
Loading Node in the renderer is a broken pattern that is full of compatibility issues and security vulnerabilities. Electron have come to realise this too and seem to be pushing towards ContextIsolation and explicitly defined bridges between the "backend" node process and the renderer.
For others https://en.wikipedia.org/wiki/Brownfield_(software_developme...
Also the first comment by brunsolf might be worth considering as the first description.
https://www.destroyallsoftware.com/talks/the-birth-and-death...
Cousins of electrons and their RAM requirements are a steep reminder that the DOM is cancerous and will have to evolve and suffer from deprecation.
Or maybe introduce metrics and good performance practices?
I'm writing my frontend in JavaScript with Svelte, and able to make impressively smooth RPCs to the Rust backend with Tauri's API. Really nice work.
Edit: actually that's something quite important to add perhaps that the headline doesn't make completely clear - it's not merely 'written in' Rust, but like Electron gives you Rust (resp. Node) to use.
I'm personally a big fan of the "Lockdown" [0] pattern, which avoids spinning up a local server and has a far more conservative security model.
Sublime to the gorblimy in one sentence!
I am a bit bias, I am the author of a security-focused Electron template.
I'm all for web tech, but that's what makes Electron no better than a browser.
Revery seems like a much better solution.