liveBook · Manning

Yew

As explained in Refactoring to Rust

Yew is a Rust framework for building web applications and web components that compile to WebAssembly.

Yew is a Rust library for building web UI components that compile to WebAssembly, bringing Rust’s safety model into client-side applications. Its component design follows Model–View–Controller: state forms the model, messages represent actions, and the view renders current state. section 9.5

A Rust component can be exposed through wasm-bindgen, built with wasm-pack, linked into an npm workflow, and mounted from a JavaScript or React application.

How Refactoring to Rust covers it

How deep it goes
Explains component state, messages, lifecycle methods, rendering, asynchronous updates, and JavaScript mounting through concrete listings.
Examples
Demonstrates a paginated feed component with fetching states, rendered entries, a More button, and an App.jsx mount.
What you can do after
Build it from scratch as a Rust WebAssembly component and mount it in a JavaScript application.
How it connects
Connects Rust, WebAssembly, Model–View–Controller, React, JavaScript, npm, and asynchronous data fetching.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Refactoring to Rust. The section links point to the parts of the book it draws on.