5 Rust WebAssembly frameworks for your next app
Rust is fast, which makes the language a viable option for building WebAssembly programs. There are plenty of Rust libraries and frameworks to help you out, with support for the tools you use to build web apps.
1. Sycamore Library
To use Sycamore, you’ll need a recent version of Rust—the wasm32-unknown-unknown target. You will also need Trunk to create and bundle your application. Since Sycamore is new, it will be risky to use the main branch library in production unless you resort to an older version.
2. The yew frame
You can get started with Yew using the Trunk or WASMPack app bundle. Check out the documentation for how to get started, interact with the HTML and DOM APIs, and transpile your Rust code to WebAssembly.
The Yew project is very popular, with over twenty thousand stars on Github and five thousand users. Yew is stable, but the project is not production ready and the codebase is changing, so you may experience errors and outages.
3. The Percy Library
Percy is a collection of Rust libraries for building WebAssembly-powered front-end web applications. Percy supports server-side instant rendering. The project excels in creating single-page applications (SPAs) suitable for search engines.
Percy provides a html! macro to generate virtual DOMs. You can render them into DOM elements in the frontend or use them for operations in your app’s backend.
Percy is still very new, and although the library is not production-ready, the project is very popular, with over two thousand stars on Github.
4. The starting frame
Plant is a WebAssembly-powered, battery-powered comprehensive framework for building fast web applications in Rust. The Seed framework provides a template system that uses macro syntax instead of Yew’s JSX-like syntax. It also has a built-in status management system to improve productivity.
Seed is new and pre-built components like date pickers are rare. Although Seed does not currently support server-side rendering, the project aims to include it soon. Otherwise, Seed is complete and you can create production-ready web applications with it. Seed also uses the Elm architecture with minimal configuration. You can build and bundle your apps using Trunk, Web Bundler, or Seeder.
You can also use Seed for the backend of your web application. Seed provides functionality to create REST or GraphQL APIs with routing and authentication support and AuthO integration.
The philosophy of the MoonZoon project is to create a very simple tool without any particular terminology, artificial barriers or dogma. By using it, you can focus on building web applications as you want. You will need to have WASM-Pack installed to build the front end. The backend of a MoonZoon app runs on Actix-web and Warp, two popular Rust backend frameworks. MoonZoon also provides authentication functionality.
MoonZoon documentation is not hosted at this time. To use the tool, you can view the markdown files in the documents folder via project GitHub repository.
You may have interacted with WebAssembly
WebAssembly was first released in 2017, and the World Wide Web Consortium (W3C) made WebAssembly a web standard in 2019. Since 2019, companies like Cloudflare, Google, and Dropbox have used the technology in production.
Google Earth uses WebAssembly, Cloudflare uses it for Cloudflare Workers, and Dropbox uses WebAssembly for a codec on its website.