-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using wasm-bindgen, build with js-sys and web-sys #558
Comments
The I've figured out how to call the APIs I want to interoperate with using I'm a little confused... What is the easiest way to use async / await Rust support on top of js-sys web-sys in yew? |
I figured out some answers to my earlier questions.
Yes, stdweb is compatible with wasm-bindgen stuff like js-sys. I compile my yew project with:
With this in my #[wasm_bindgen]
pub fn run_app() -> Result<(), JsValue> {
yew::start_app::<Model>();
Ok(())
}
I mentioned last week that wasm-bindgen-futures 0.4.5 supports spawn_local(async move {
let branch = get_branch().await.unwrap_throw(); // vs unwrap?
branch_received.emit(branch);
}); |
See the referenced PR's. Shouldn't be too far away now. |
I have lots of experience with wasm-bindgen, and want to use yew for a web site, so I'd be happy to help if you've got any questions, or work that needs doing. |
Thats amazing! My experience with both wasm-bindgen and yew was very limited until now 😄. A code review would be very appreciated! |
@derekdreery everythings done from my side, a code review would be very welcome! |
I've been playing with yew with all the PRs merged and it all seems to work fine :). I'm planning to build a reasonably sized website with yew so I'll see how it works with the web-sys backend :). Code all looks good to me, only suggestion I might make is to consider |
Thanks! I tried it in #818. |
The rust / wasm community has adopted
web-sys
andjs-sys
as the foundational crates for building web applications.web-sys
is generated from WebIDL specs which ensures it will be both complete and up-to-date. Furthermore, once interface types became a reality, Yew will be better suited to take advantage of the performance gains.Since
wasm-bindgen
doesn't support asm.js and emscripten, the current plan is to continue support for those withstdweb
The text was updated successfully, but these errors were encountered: