Expand description
§Tauri Runtime Verso
Use Verso as the backend for Tauri
§Usage
To get started, you need to add this crate to your project, and use default-feature = false
on tauri
to disable the wry
feature
[build-dependencies]
tauri-build = "2"
+ tauri-runtime-verso-build = { git = "https://github.com/versotile-org/tauri-runtime-verso.git" }
[dependencies]
- tauri = { version = "2", features = [] }
+ tauri = { version = "2", default-features = false, features = ["common-controls-v6", "x11"] }
+ tauri-runtime-verso = { git = "https://github.com/versotile-org/tauri-runtime-verso.git" }
In your build script, add the tauri-runtime-verso-build
script, which will download the pre-built versoview
to versoview/versoview-{target-triple}
Note we currently only have pre-built
versoview
for x64 Linux, Windows, MacOS and arm64 MacOS, also the download might take a bit of time if you have a slow internet connection
fn main() {
+ tauri_runtime_verso_build::get_verso_as_external_bin().unwrap();
tauri_build::build();
}
Then add the downloaded executable to your tauri config file (tauri.conf.json
) as an external binary file
{
+ "bundle": {
+ "externalBin": [
+ "versoview/versoview"
+ ]
+ }
}
Finally, setup the code like this:
fn main() {
- tauri::Builder::new()
+ tauri_runtime_verso::builder()
.run(tauri::generate_context!())
.unwrap();
}
§Tips
§Devtools
Since Verso doesn’t have a devtools built-in, you’ll need to use the one from the Firefox, first put in this in your code
// This will make the webviews created afters this open up a devtools server on this port,
// setting it to 0 for a random port
tauri_runtime_verso::set_verso_devtools_port(1234);
Then go to about:debugging
in Firefox and connect to localhost:1234
there
§Cargo features
- macos-private-api: Matching with Tauri’s macos-private-api feature, required if you use that
Structs§
- Event
Proxy - Runtime
Context - Verso
Runtime - A Tauri Runtime wrapper around Verso.
- Verso
Runtime Handle - A handle to the
VersoRuntime
runtime. - Verso
Webview Dispatcher - The Tauri [
WebviewDispatch
] forVersoRuntime
. - Verso
Window Builder - Verso
Window Dispatcher - The Tauri [
WindowDispatch
] forVersoRuntime
.
Constants§
- INVOKE_
SYSTEM_ SCRIPTS - You need to set this on [
tauri::Builder::invoke_system
] for the invoke system to work, you can skip this if you’re usingtauri_runtime_verso::builder
Functions§
- builder
- Creates a new [
tauri::Builder
] using theVersoRuntime
- set_
verso_ devtools_ port - Sets the Verso devtools port to ues for the webviews, 0 for random port, note this only affects webviews created after you set this
- set_
verso_ path - Sets the Verso executable path to ues for the webviews,
must be called before you create any webviews if you don’t have the
externalBin
setup - set_
verso_ resource_ directory - Sets the Verso resources directory to ues for the webviews, note this only affects webviews created after you set this