243 points · by adamnemecek · 5y ago · 168 comments
https://dev.to/tauri/announcing-tauri-beta-more-efficient-cr...
Specifically:
1. Can I place it into a native window handle (e.g. HWND on Windows)?
2. Can I create a new window, but use the parent application's event loop without modification?
Thanks
See https://github.com/tauri-apps/wry
Edit: s/IE or Edge/Edge
If your html/css/is has to work correctly in EdgeHTML, Safari Webview, and Blink, you are limited to the lowest common denominator features.
Electron with Chromium has the largest feature set out of all of those.
I don't know the extend of WebView in Electron is it something common?
Are you asking for them to make an entirely different product?
If anyone is interested, it would be much easier to create those bindings to Rust. I'm super interested (and i would probably create a Rust SDK anyway) and there's a lot of other bonuses that neither Electron or Tauri can offer (as i target it not to be "just" a web-based app platform, but something that also had the soul of web browsers, by forming networks, addresses, etc).
If anyone is curious, there is more disclosure in another answer on this same thread.
i would love to give new all of those cool new languages that need a platform to thrive: Rust, Zig, Crystal, (and while not new) Python, a chance to have a 360 ecosystem, so we can stop being hostage of just Javascript being used.. and no, WebAssembly is definitely not it, as in the end it will give Javascript access to FFMPEG and the likes making it more prominent and ubiquitous
If it’s an electron alternative, is it too much to ask to show an image of a webapp running on a desktop (preverably a variation of every OS) front and center on the landing page?
I’d like to see it working immediately, without needing to watch any videos.
I agree it’s confusing and not clear on the homepage or from the hacker news title. I was expecting something like an electron framework using servo.
Not that I don't also acknowledge the need for that, but my application is dramatically faster in Firefox than Chrome, yet we're stuck packaging a suboptimal experience in the desktop app because Chromium is our only option.
I might as well just ship a website at that point, almost everything that makes Electron appealing comes from shipping your own rendering engine.
If every little desktop widget loads its own browser engine, most of that RAM will be spent on redundant copies of Chromium.
If your Electron app is something that you expect users to run almost exclusively, then no problem. If it's just another little client app for some service, please consider a solution that would reduce its memory footprint.
It makes sense to use frameworks like Electron if they enable new capabilities for your app, and Electron is very good at that, bundling Node.js with it, which allows you to share code between frontend and backend and tap into the same ecosystem of packages, plus chances are you already know Node.js, Tauri is enabling 0 of this, at least presently.
Actually better results even, because under macOS for example the webview is provided by Safari, but if you are using Chrome/Firefox as your browser of choice and you are using a Tauri app now you are using 2 browsers effectively, while if you ship a website you can use that website with whatever browser you prefer.
That doesn't make sense to me, you are still using a browser at the end of the day. Sure you can save some memory by not bundling Node (at the cost of making even reading a file much more difficult), but that's not orders of magnitudes.
Have one, real Multithreaded +, more efficient backend, will reduce memory and offer better performance.
Wails is also an alternative that does just that. Shared Web UI engine + Go compiled backend.
Im working on something not quite the same thing but that deal with all this, and being able to ship with a web rendering engine and not using whatever its on the system is actually better giving all the power, bindings, compromise you can make that you are unable when you can only deal with a abstract wrapper to every web rendering engine out there.
Lower memory footprint but with much less features and a generic "no sir, cant do such a thing.." as a answer to users that will need important features to ship applications with this.
> why would I want to trade control over how my app is render for ~100MB of disk space?
it depends how much you respect your users
That's irrelevant, just because I can't do some things on iOS doesn't mean that I shouldn't do them under desktop OS' too.
Just one example: file system watching, if I need to do that with Electron I'll just use `chokidar` and have it working in no time, plus I can share whatever frontend code with the backend too, good luck doing the same with Tauri (given the current state of things anyway).
> it depends how much you respect your users
I don't know what kind of users you've got but mine care about me iterating quickly on the app, care about having new features, care about having a faster app. Most of them would consider trading any of that for ~100MB of disk space stupid.
As I said, if disk space is all you care about you might as well just ship a website.
Tauri's website is way, way worse. Tauri uses unnecessary jargon where Electron's site uses simple, more direct language.
Electron:
> Build cross-platform desktop apps with JavaScript, HTML, and CSS
Tauri:
> Build smaller, faster, and more secure desktop applications with a web frontend
"web frontend" vs. "JavaScript, HTML, and CSS"
Electron and Tauri have icons with labels.
Electron:
> Web technologies, Open Source, Cross Platform
> Automatic updates, Native menus & notifications, Crash reporting, Debugging & profiling, Windows installers
Tauri says:
> Brownfield, FLOSS, Bundle
> Security, Patterns, Cross-platform
https://tauri.studio/en/docs/about/intro
> Tauri is a toolkit that helps developers make applications for the major desktop platforms - using virtually any frontend framework in existence. The core is built with Rust and the CLI leverages Node.js making Tauri a genuinely polyglot approach to creating and maintaining great apps.
Electron doesn't have an equivalent "about" page, but instead has this paragraph on its home page:
> It's easier than you think: If you can build a website, you can build a desktop app. Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. It takes care of the hard parts so you can focus on the core of your application.
"virtually any frontend framework" "polyglot" vs. "takes care of the hard parts"
FLOSS also means a different thing from Open Source because of the "Libre" aspect.
I don't see why being different is considered bad here, as its whole shtick is that it's an alternative.
this means your app has hundreds of javascript versions to target
Shout out to all of the hardworking people behind Tauri. ♥
I think problem is that it is over polished and slick not unpolished.
I'm a bit surprised the new website doesn't mention this at all. The Github repo does.
maybe make this text a bit more explicit? I'm guessing maybe you're using a message passing layer to keep the processes separate?
Can we just stick with "best tool for the job"?
Rust for performance-critical systems and, say, typescript for front-end? Using a single language for everything is a wet dream that always ends up in complexity and more work as you're fighting the "native" ecosystem.
You don't need to offer a perspective on everything, and I prefer the critiques I read to be well-founded.
Isn't typescript contract?
This is not really about JS, if I want to replace JS I'll pick a language with similar characteristics that make it successful. Similar to how you replace C++ with rust, another language that gives you control of memory. For app developments they are simplicity and a focus on domain modelling with a good type system (this is typescript teritory), NOT memory safey.
And don't tell me that rust's type system is powerful too, yes, but it's also complex and the focus isn't domain modelling. Like C++ and golang's type systems, it's there to aid the compilers/borrow checker, not developers.
Example of such language in my other comment: kotlin, F#
> the focus isn't domain modelling, like C++ and golang's type systems
Could you please explain what you mean by this? I've honestly not heard this argument before so I'd be interested what domain modeling Rust doesn't encourage/support that, e.g. Go does.
One difference is to be able to ditch Javascript and use a native language(Swift is the first one) to talk directly to webkit.
The other difference is that the apps are "managed" as Chrome manages the renderer process, so in the end you have one manager process and one service process for each app and many process for the UI apps.
The problem with Electron is that for each app, it will need many processes, and if you have more than one Electron app running, it will eat all the resources.
With the architecture proposed, it will be more light as there will be just one instance of the manager processes, and unlike Electron they would not be isolated as they are all centrally managed, also the fact that it wont need to use JS, will also put less pressure on memory resources.
It also uses RPC so that every app have a API that can be callable by others. This in turn can make it form a "network of apps" where the applications can consume the apis of the other apps installed. The RPC service is local first, but can fetch things in the "cloud" if the application needs to.
For me this is my take on what "Web 3.0" should look like.
I have a 0.1 version here and i'm just finishing the final touches before launching it..
Edit: Also i forgot to mention that the distribution of the application and resources(database and files) is over torrent with DHT routing, so you can share a unique address and serve your own applications over internet without depending on domains or a third-party hosting it for you.
Do you need / want any help?
Then for each application: You have a "service process" which is instantiated and is always running, this process asks for the manager to create its rpc service server. Then every rpc call is routed to it.
This application service process is already coded by the developer so he defines what every api does and also how it respond to resources like pages, images, videos, etc.. (it also uses RPC by default to route resources.. but its through HTTP/2 giving its gRPC/Protobuf)
This process, totally in control of the dev code also can hijack its own application launches, so its in charge of app launching and killing (from its own scope)
Then theres the UI process which is akin to renderer and its also coded by the dev, where the renderer is in Swift so totally customizable (Imagine being able to control the C++ renderer events, lifetime, frames, etc.. of the chrome renderer process; in this case you do, with Swift), giving you have a lot of power.
The developer control, codes and ship the service and the ui app. Once its installed, even without any UI, all other applications can consume its services over its RPC api, because there is a 'service process' running and serving those requests (imagine being able to deal with twitter or a google search api (all local and with the same tech) from your app that is specialized in something else)
> Do you need / want any help?
Yes of course! How can i reach you?
And you can always just use some of the other GUI toolkits that have been coming out recently.
Tell me what it is, show me what it looks like, provide a "Hello, World!" API example for opening a window on the front page. Stop contributing to landing pages that jerk the consumer around.
I want people to be direct about how my projects need to improve, because I know how it doesn't meet my standards, but I don't know how it fails to meet other people's standards, which is more important if you're concerned with adoption.
See my other post in this thread for an example.
They've got a point. Time to cut through the hype, get straight to the point and show some screenshots to catch their eyes.
If you can't manage that, the tab gets closed with in 5 seconds. Even if it has the Rust buzzword. (Because that trick always works on HN)
But of course, there is not much to see, it's just a window with a web view inside of it.
https://guijs.dev/ https://github.com/samirdjelal/bidirectional/ https://github.com/mmpneo/simple-obs-stt
> ...the Tauri-team incubated and maintained WRY, which creates a unified interface to the system webview (and other goodies like Menu and Taskbar), leveraging WebKit on macOS, WebView2 on Windows and WebKitGTK on Linux.
Besides, all of the relevant engines are WebKit variants, so you're not targeting Trident or Gecko or anything.
Bear in mind that a lot of popular "apps", like Slack, Discord, etc., are web apps anyway, so there's a decent chance that the "support more than one of them" problem is already solved anyway, meaning you don't have to spend any more development time but you get huge increases in performance and responsiveness.
Answering my own question, https://github.com/tauri-apps/wry , so looks like it loses one of the advantages of Electron in that you control the exact browser in use. Maybe that's incorrect. Who knows? Web site appears to not exist to provide such important details.
https://github.com/tauri-apps/tauri/blob/dev/ARCHITECTURE.md could lose a few thousand words, but this seems to be the real starting off point
It's not for "people like me," it's for everyone. In terms of volume of traffic you're going to get, no one else cares about this stuff.
Here's an example of one of my projects where I do just that: https://www.planimeter.org/grid-sdk/ Literally! I tell people what my team has built. I show them a screenshot. I then provide API examples. Mine could be better if I provided screenshots per API example, too. Everyone can improve.
Your audience is technical, they don't want a non-technical pitch. Tell me it's faster than Electron, show me RAM usage comparisons, etc.
Even though the project itself sounds very promising, because "Rust" and "Electron alternative".
But how can I know if it really is an Electron replacement if I'm not even sure if I can create native context menus or integrate it into the SysTray?
It's not that the site is 'marketing speak', it's just that it's a 3/10 on communications.
Even two sentences at the top would help.
I've spent a minute on it and I'm not sure what it is.
It's a way to make apps, but it doesn't have a front end? I don't even know what that means.
Similar idea with news. The objectives of profit and conveying meaningful information aren't necessarily aligned.
Disregarding the subjectivity of 'meaningful,' the advice 'know your target audience' is good from both a product design and marketing presentation stand point.
Also, I liked the way they presented their roadmap.
That's the first paragraph on the About page. Landing pages have multiple purposes and need to address different types of viewers, not just the neckbeards. The marketing speak is likely more for convincing IT manages this is a legit project and does not have common "deal breakers".
If this is the case, it's an excellent reason to not use Tauri. Making their decisions based on what IT managers want to read rather than what developers need to do their job? Good luck with that, might work in some bubbles but the rest of the world is trying to be productive.
yarn add @tauri-apps/cli
yarn tauri init
yarn tauri build
I'll admit you'll probably have a couple extra configuration steps in there. But I found it much easier to get started than with Electron and the resulting app seems pretty slick.