Two-way bindings between Webview and Rust Yew
See original GitHub issueHow can i call the invoke_handler from a Yew application? I want to communicate between Yew and Webview. I already tried adding javascript to Yew through stdweb and then calling external.invoke("foo")
. But this doesn’t work.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:19 (6 by maintainers)
Top Results From Across the Web
web-view - crates.io: Rust Package Registry
It supports two-way bindings for communication between the Rust backend and JavaScript frontend. It uses Cocoa/WebKit on macOS, gtk-webkit2 on Linux and ...
Read more >Tutorial | Yew
In this hands-on tutorial, we will take a look at how we can use Yew to build web applications. Yew is a modern...
Read more >What's the state of Rust GUIs? : r/rust - Reddit
Real different you should be talking about 1/2 way bindings, uni-directional flows, flux, MVC, MVVC, MVP and many other acronyms. Those can't ...
Read more >Rust libraries | Everything I know - My Knowledge Wiki
Rustea - Easy-to-use TUI crate for Rust, based off of the Elm ... Wry - Cross-platform WebView library in Rust for Tauri. webkit2gtk...
Read more >Moxie: Incremental Declarative UI in Rust - Hacker News
Any discussion about incremental UI should include Yaron Minsky's talk about Jane Street's OCaml framework, incr_dom from 2016: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also took a stab at it (taking a lot of inspiration from the discussed approach): https://github.com/hobofan/yew_webview_bridge (also available on crates.io)
A few notable points:
Message
wrapper type which carries asubscription_id
andmessage_id
, which allows for association of responses to their initial messages (this is handled by the service).send_message
fromyew
, it returns aMessageFuture
with the response fromweb-view
(which can be used to trigger a component update with the includedsend_future
helper).Putting this here for anyone who might find this in the future: https://github.com/mbuscemi/webview-yew-minimal