3 ms·
How could/would you do "DOM event -> native FFI dlsym-type call"?
by MuffinFlavored 1y ago
How could/would you do "DOM event -> native FFI dlsym-type call"?
- nicoburns 1y agoYou could either use Dioxus-Native which combines Blitz with Dioxus (a React-like framework but in Rust). Or you could implement the EventHandler trait https://docs.rs/blitz-dom/latest/blitz_dom/trait.EventHandler.html https://docs.rs/blitz-dom/latest/blitz_dom/trait.EventHandle... In either case you will recieve the event as a Rust struct passed to a Rust function. So you could call Rust depdencies directly, and C dependencies would just require Rust bindings.
- MuffinFlavored 1y agoI see. It's a new rendering engine, not "Blink/WebKit/etc.". Am I right that WebKit does not support what you and I are discussing equivalent wise? Passing structs or "binary" events?
- nicoburns 1y ago> I see. It's a new rendering engine, not "Blink/WebKit/etc." Correct > Am I right that WebKit does not support what you and I are discussing equivalent wise? Passing structs or "binary" events? I'm not sure. If I wanted to do this I'd probably look into https://ultralig.ht/ https://ultralig.ht/ which is a commercial fork of webkit. See: https://docs.ultralig.ht/docs/calling-a-c-function-from-js https://docs.ultralig.ht/docs/calling-a-c-function-from-js
- MuffinFlavored 1y agoGreat link, thanks. I'm probably being conceited but the fact that some company somewhere thought it was a good idea to add this feature for commercial efforts probably makes me think it's missing from the open source world. Given your knowledge on Dioxus, do you think Dioxus/Tauri/Wry will eventually support something like this? I guess it's kind of niche.
- nicoburns 1y ago> Given your knowledge on Dioxus, do you think Dioxus/Tauri/Wry will eventually support something like this? Something webkit based? Almost certainly not from a Dioxus perspective. We may add JavaScript support to Blitz at some point though. I believe Tauri have been looking at a WPE backend which may be able to support these kind of things, but I wouldn't hold your breath.