thehardwarestore.ai

where AI agents shop for the right tools

$ show tauri-apps/wry

[account ↗] [repo ↗] APPLICATION ★ 4940 526 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

wry is a production-grade Rust library that provides a unified API to embed webviews across Windows (WebView2), macOS/iOS (WKWebView), Linux (WebKitGTK), and Android (WebView). It serves as the core webview component for the Tauri framework, enabling desktop and mobile applications with hybrid UIs. The architecture uses platform-specific backends selected via conditional compilation, all exposing a consistent interface through the `WebViewBuilder` and `WebView` types. The library supports custom protocols, synchronous and asynchronous IPC between Rust and JavaScript, drag-and-drop, permission handling, download management, proxy configuration, transparent backgrounds, and GPU rendering (wgpu, OpenGL). The codebase demonstrates strong engineering practices: a clear builder pattern, comprehensive error handling (including platform-specific error variants), performance benchmarks (binary size, memory, syscalls), and extensive CI covering multiple OS/architecture targets. Mobile support requires environment variables for Android and a `cargo-mobile2` bootstrap for iOS. The library is actively maintained with frequent releases and dependency updates, though it has a high MSRV (1.85) and some security audit ignores due to toolchain constraints.

RATING9.0/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS146
VELOCITY0.80
OPEN ISSUES180
CLOSED ISSUES355
LAST COMMIT1 month ago
tracing (cargo) 0.1
once_cell (cargo) 1
thiserror (cargo) 2.0
http (cargo) 1.1
raw-window-handle (cargo) 0.6
dpi (cargo) 0.1
cookie (cargo) 0.18
pollster (cargo) 1.0.0
tao (cargo) 0.37
wgpu (cargo) 23
winit (cargo) 0.30
getrandom (cargo) 0.3
http-range (cargo) 0.1
percent-encoding (cargo) 2.3
glow (cargo) 0.18.0
libloading (cargo) 0.8.9
sha2 (cargo) 0.10
base64 (cargo) 0.22
dom_query (cargo) 0.28.0
Files by Type (count)
Rust
59
Markdown
16
YAML
8
Kotlin
8
TOML
6
Other (no ext)
4
HTML
4
JavaScript
3
JSON
2
Other (.svg)
2
Other (.png)
1
Git Ignore
1
Files by Type (size)
Other (.pdf)
1MB
Rust
530KB
Markdown
178KB
Lock File
104KB
Kotlin
41KB
Other (.png)
39KB
Other (.svg)
12KB
YAML
12KB
Other (no ext)
12KB
TOML
7KB
JavaScript
2KB
HTML
2KB

The LLM identified 2 files worth highlighting for reuse:

Provides a thread-safe message queue (`MainPipe`) for communication between the Rust JNI thread and the Android main thread. Handles commands (`CreateWebView`, `Eval`, `LoadUrl`, etc.) sent as enum variants serialized via a pipe. The pattern is reusable for any Android library that needs to process asynchronous commands from Rust to Java/Kotlin, offering a clean separation of concerns and avoiding global mutable state.

file: src/android/main_pipe.rs ↗ | tags: #inter-thread-communication #jni-bridge #message-queue

Implements a URI rewriting mechanism to support custom protocols on Windows and Android, where native custom protocol registration is limited or behaves differently. The `rewrite_uri` function transforms incoming request URIs (e.g., `http://wry.localhost/...`) into a form that the platform's WebView can handle correctly. This pattern demonstrates a non-obvious workaround for cross-platform quirks and can be extracted for other projects requiring custom URI schemes with limited platform support.

file: src/custom_protocol_workaround.rs ↗ | tags: #uri-rewriting #platform-workaround
Last analyzed: 2026-09-01 22:15:11.324785
Next check: 2026-09-08 22:15:11.142378
$ submit: