Web UI is the framework I built to run my company's websites, including this one. It started in 2022 as a Rust framework that rendered the UI in WebAssembly. In 2024 I rebuilt it as vanilla JavaScript web components, with Rust kept for the heavy processing it is good at. Today about two dozen websites run on it from one shared CDN, and every deploy is gated by automated tests.

This page covers the problem, the decision to rebuild, the design, and how it is kept reliable.

The problem

I run about two dozen websites through Stoic Dreams. Each one needs the same things: navigation, drawers, a header and footer, page routing, forms, data binding, and accessibility. Rebuilding that on every site, or copying it between sites, multiplies the code I have to maintain by the number of sites.

I wanted a new site to start with almost no boilerplate, and a fix in shared code to reach every site at once.

Version one: Rust in the browser

The first version, started in September 2022, was a Rust library built on the Yew framework, compiled to WebAssembly. Within the first two weeks I replaced Yew's router with my own navigation system, and the library grew to cover the shared layout and components for my sites.

It worked, but it had Rust building HTML. The rebuild followed a different principle: Rust should not build or manage the UI. It belongs in a worker thread doing long-running or processing-heavy work, while the UI stays in HTML, CSS, and JavaScript, the languages the browser was built around.

The rebuild

In May 2024 I began a vanilla JavaScript loader for web components, and in June 2024 I moved the framework over to it and retired the Rust rendering.

The design that came out of the rebuild:

The framework now has about 70 components, from layout pieces like drawers and tabs to forms, tables, and dialogs.

Keeping two dozen sites safe

When every site loads the same framework, a mistake in the framework is a mistake on every site. That makes testing the core of the design, not an extra:

Results

Run on one framework and one CDN, including this site, Ap Tul, and Task Proxy.

A page is one markdown file. A layout used across sites becomes one component, instead of markup and CSS copied into each page.

No site deploys unless its tests pass, and the framework can't add a component or method without tests.

What I'd tell a team facing the same choice

Web UI documentation Web UI on GitHub More projects

Case Study: Web UI

Rebuilding a framework around what each language does best

You can also come chat with us on the Stoic Dreams discord server.

About Erik Gassler Contact Erik Gassler Privacy Terms & Conditions