tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
84.66k stars 2.54k forks source link

Use Servo as the web-view #579

Closed IngwiePhoenix closed 4 years ago

IngwiePhoenix commented 4 years ago

(Sorry for skipping the template, but it did not match what I wanted to talk about.)

It's not too long ago that I looked at the Servo browser engine: https://github.com/servo/servo

It always seemed like a perfect fit for an alternative to the Chromium-Engine being used just about everywhere (due to Electron, React Native and friends). Since Tauri uses the native WebView, it doesn't have a lot of control over the underlying versions and possibly not all available APIs are accessible either.

Using Servo would allow for a much fine-grained control over the web-view and streamline a lot of the JavaScript APIs being present (there are differences between IE10/11 and WebKit). It would also allow for a much more streamlined work, as Servo itself is also written in Rust, meaning that dead/unused symbols could still be removed during optimization stages - thus being "three shakeable" in it's own way.

SpiderMonkey - as used in servo - might not be the fastest JS engine in comparsion to JSC and friends, but since it would be tightly integrated into Tauri, I would assume it would also be much more easy to control it. It's version, it's default APIs and alike.

Also, there would not need to be any HTTP stuff involved routing to a localhost server - instead, Servo could be extended with a customized protocol, allowing for a better FS access on resources and alike..

What is your stance on this?

nothingismagick commented 4 years ago

We spent a lot of time discussing shipping servo entirely, or even a stripped down servo (just using some specific parts) - but, we weren't comfortable with the distribution size of binaries that ship an entire and very large Servo.

We also thought about shipping a "base tauri windowing daemon" that would provide a windowing environment, so you'd download the "tauri app-browser" - but we're a very small team with limited resources.

Ultimately, we decided to focus on using webview for the forthcoming stable release, and then we'll definitely look into other options with v2.

And FYI: We already have a solution that needs no localhost server (the so-called no-server mode).