What Yew Does
- Components — function and struct components
- html! macro — JSX-like syntax for Rust
- Hooks — use_state, use_effect, use_context, use_reducer
- Virtual DOM — efficient diffing and patching
- Agent system — web workers for background tasks
- SSR — server-side rendering support
- Properties — typed props with derive macro
- Events — click, input, submit, custom
- Trunk — build tool for WASM projects
Comparison
| Framework | Reactivity | SSR | Maturity |
|---|---|---|---|
| Yew | VDOM | Yes | Most mature |
| Leptos | Signals | Yes | Growing fast |
| Dioxus | Signals | Yes | Multi-platform |
| Sycamore | Signals | Yes | Smaller |
FAQ
Q: Is the WASM bundle large? A: About 200-400KB gzipped, depending on dependencies. Bigger than a React bundle but faster at runtime. wasm-opt can shave another 20-30%.
Q: JS interop? A: Call any Web API via wasm-bindgen and web-sys. You can also use the gloo library to simplify DOM/fetch/timer operations.
Sources
- Docs: https://yew.rs/docs
- GitHub: https://github.com/yewstack/yew
- License: Apache 2.0 + MIT