Skip to content

DioxusLabs/wasm-bindgen-wry

Repository files navigation

Wasm bindgen wry

An (largely) api compatible version of wasm-bindgen that uses wry to run the generated javascript code while your code runs natively.

Why?

Wasm-bindgen is a fundamental tool for interacting with javascript and the dom, but it only works if you are compiling to wasm. If you want access to native apis like threads, file system, or networking you have to either go through an ipc boundary or give up on using wasm-bindgen. This library lets you use wasm bindgen from native code which lets you both:

  • Use wasm-bindgen compatible libraries like web-sys, js-sys, and gloo!
  • Use native apis like threads, file system, and networking!

Demos

The paint example from web-sys running unmodified from a native thread:

paint.mov

A modified version of dioxus web (that doesn't use the sledgehammer optimizations) running on a native thread:

dioxus-todomvc.mov

Yew's todoMVC example running unmodified from a native thread:

yew-todomvc.mov

Leafelet.js bindings:

out.mp4

Tiptap bindings:

wysiwyg.mov

About

What if wasm-bindgen with no wasm?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages