No description
Find a file
2021-05-16 02:58:57 -04:00
.vscode Feat: some code health 2021-05-16 02:06:02 -04:00
docs Feat: update docs a bit 2021-03-02 01:47:27 -05:00
examples Feat: synthetic events wired up (ish) 2021-03-04 18:12:24 -05:00
notes Feat: Clean up repo a bit 2021-05-16 02:55:16 -04:00
packages Feat: abstraction lifetimes work out nicely 2021-05-16 02:58:57 -04:00
.gitignore Feat: docs, code frm percy 2021-01-14 02:56:41 -05:00
Cargo.toml Feat: Clean up repo a bit 2021-05-16 02:55:16 -04:00
LICENSE Feat: wire up a very basic dom updater 2021-02-14 23:39:46 -05:00
README.md Feat: some code health 2021-05-16 02:06:02 -04:00

🌗🚀 Dioxus

Frontend that scales.

Dioxus is a portable, performant, and ergonomic framework for building cross-platform user experiences in Rust.

fn Example(ctx: Context, props: &()) -> DomTree {
    let selection = use_state(&ctx, || "...?");

    ctx.render(rsx! {
        div {
            h1 { "Hello, {selection}" }
            button { "?", onclick: move |_| selection.set("world!")}
            button { "?", onclick: move |_| selection.set("Dioxus 🎉")}
        }
    })
};

Dioxus can be used to deliver webapps, desktop apps, static pages, liveview apps, Android apps, iOS Apps, and more. At its core, Dioxus is entirely renderer agnostic and has great documentation for creating new renderers for any platform.

Things you'll love ❤️:

  • Ergonomic design
  • Minimal boilerplate
  • Simple build, test, and deploy
  • Support for html! and rsx! templating
  • SSR, WASM, desktop, and mobile support
  • Powerful and simple integrated state management
  • Rust! (enums, static types, modules, efficiency)

Get Started with...

Web Desktop Mobile State Management Docs Tools

Explore


Why?

CRUD applications are more complex than ever, requiring knowledge of multiple programming languages on top of annoying build systems and opinionated frameworks. Most JavaScript solutions require libraries to patch core language limitations like Immer for immutable state and TypeScript for static typing.

Certainly, there has to be a better way. Dioxus was made specifically to bring order to this complex ecosystem, taking advantage of immutability-by-default, algebraic datatypes, and efficiency of the Rust programming language. Because Rust runs in both the browser and the server, we can finally write isomoprhic applications that run everywhere, bind to native libraries, and scale well.

Don't be scared of the learning curve - the type of code needed to power a webapp is fairly simple. Diouxs opts to use unsafe (but miri tested!) code to expose an ergonomic API that requires understanding of very few Rust concepts to build a powerful webapp. In many cases, Rust code will end up simpler than JavaScript through the use of immutability, ADTs, and a powerful iterator system that doesn't require annoying "hacks" like Object.fromEntries.

Liveview?

Liveview is an architecture for building web applications where the final page is generated through 3 methods:

  • Statically render the bundle.
  • Hydrate the bundle to add dynamic functionality.
  • Link individual components to the webserver with websockets.

In other frameworks, the DOM will be updated after events from the page are sent to the server and new html is generated. The html is then sent back to the page over websockets (ie html over websockets).

In Dioxus, the user's bundle will link individual components on the page to the Liveview server. This ensures local events propogate through the page virtual dom if the server is not needed, keeping interactive latency low. This ensures the server load stays low, enabling a single server to handle tens of thousands of simultaneous clients.