lastleaf/maomi

maomi: A rust wasm framework for building pages with components

maomi is a MVVM-like framework for web development

maomi is a MVVM-like framework for web development. Write your code in rust and compile to WebAssembly!

Still in early development. Do not use it in productional stage.

Features

  • Targeting WebAssembly, with powerful rust static checking!
  • Declarative UI updates (MVVM-like)
  • Optional server-side rendering

Guide & Sample Code

Declare a Component

template!(xml for HelloWorld {
    <div>
        {&self.a}
    </div>
});
struct HelloWorld {
    a: String,
}
impl<B: Backend> Component<B> for HelloWorld {
    fn new(_ctx: ComponentContext<B, Self>) -> Self {
        Self {
            a: "Hello world!".into()
        }
    }
}

Make a Placeholder in HTML Page

<div id="placeholder"> THE COMPONENT WILL BE PLACED HERE </div>

Bootstrap a context

let mut context = maomi::Context::new(maomi::backend::Dom::new("placeholder"));
let root_component = context.new_root_component::<HelloWorld>();
context.set_root_component(root_component);

Compile it

Make sure your code is also WebAssembly-ready, and compile it with wasm-pack build , then webpack .

More full examples at examples

Information - Updated Apr 10, 2022

Stars: 7
Forks: 0
Issues: 0

Repositories & Extras

Rust web application

Diesel (ORM) is used to work with the database

Rust web application

Base web app for Rust web projects

Started with the static_index example here:

Base web app for Rust web projects

Simple Rust Web Service

This is the readme file for a Medium article I published on creating a

Simple Rust Web Service

Rust Web assembly game 1024

The game logic has been developed by Rust Programming Language

Rust Web assembly game 1024

Portfolio Website in Rust w/ Rocket

This is a WIP portfolio website using Rust with the Rocket web framework, along with Postgres for the database

Portfolio Website in Rust w/ Rocket

rust-actix-react-web-starter

A bare Rust web app that uses Diesel and License

rust-actix-react-web-starter

rust-web-fullstack

Toy projects while learning rust web development

rust-web-fullstack

rust-web-services

This project implements the same API surface which was implemented in the Pluralsight course &quot;Creating Web Services with Go&quot; by Alex Schultz, with Rust using...

rust-web-services

rust-web-boilerplate

__ is distributed under the terms of the MIT License

rust-web-boilerplate

rust-web-app-example

Web App Example written in rust

rust-web-app-example

rust-web-server-wasm

compile rust source to wasm

rust-web-server-wasm
Facebook Instagram Twitter GitHub Dribbble
Privacy