Urgent.News

What's breaking now, across thousands of outlets.

Tech

Great News for the Rust Community: A New Server-Driven UI Technology in Rust

A new option for building interactive web interfaces has arrived in the Rust ecosystem. WebForms Core is a technology owned and developed by Elanat . It now has a Rust implementation available as the webformscore crate, allowing Rust developers to use the WebForms Core programming model with Rust web frameworks such as Actix Web. What is WebForms Core? WebForms Core is a server-orchestrated UI…

A new server-driven UI technology called WebForms Core has emerged in the Rust programming language community. Developed by Elanat, this technology enables Rust developers to build interactive web interfaces using the WebForms Core programming model within Rust web frameworks such as Actix Web.

WebForms Core operates on a server-side model where the server generates commands that describe changes to the HTML document. The core of the server-side is the WebForms class, which generates these WebForms Core commands. On the browser side, WebFormsJS receives these commands and executes them against the HTML Document Object Model (DOM).

The architecture consists of three main components: the Rust Server, the WebForms class, and the WebForms Core Commands. The Rust Server communicates with the WebForms class, which generates WebForms Core Commands. These commands are then passed to WebFormsJS, which executes them on the HTML DOM.

This separation between the server-side Commander and the browser-side Executor ensures a clear distinction between generating commands and performing DOM operations. The Rust application itself does not directly manipulate the browser DOM; instead, it generates commands, and WebFormsJS handles the corresponding DOM manipulations.

WebFormsJS, the browser-side runtime of WebForms Core, is independent of the Rust backend and can work with various server-side implementations of WebForms Core. The WebFormsJS project is available in the official WebForms Core repository. To install WebForms Core for Rust, add the webformscore crate to your Rust project's Cargo.toml file:

```toml

[dependencies]

webformscore = "2.1.0"

```

Then, import the WebForms class and HTML event definitions:

```rust

use webformscore::{WebForms, html_event};

```

WebFormscore 2.1.0 can be installed through the Rust ecosystem, providing the Rust implementation of the WebForms class.

WebFormsJS, the browser-side runtime, must be installed separately from the Rust crate. It can be installed using npm with the command:

```bash

npm install webformsjs

```

After installation, the web-forms.js file should be made available through the web server and included in the HTML file:

```html

<script type="module" src="/static/script/web-forms.js"></script>

```

For a Rust web application, the WebFormsJS file can be placed in the static directory, for example:

```

static/

└── script/

└── web-forms.js

```

Then, reference it from the HTML page similarly to the npm installation method.

A practical example of a Rust + Actix Web application using WebForms Core and WebFormsJS involves creating a simple application that displays a table of student grades. When a user clicks on a cell to highlight the grade, the browser sends a request to the Rust server. The server then generates WebForms Core commands that color the table cells according to the grades.

This example demonstrates how WebForms Core enables Rust developers to build interactive web interfaces while keeping the server-side logic distinct from the browser-side execution.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How Uber Knows Your Driver Is 7 Minutes Away

Hello, I'm Maneshwar, and I'm building LiveReview — a blast-radius aware AI code review built for your business-critical systems.

  • Uber uses road segments with time estimates for driver location tracking.
  • Drivers' location pings provide free traffic telemetry every four seconds.
  • DeepETA predicts ETAs for the next three hours, adapting to real-time events.

AICOM is the factory. AIMarket is the economy it ships into.

People keep asking if AICOM and AIMarket are two startups, a rebrand, or a Discord with extra steps. They are two names on purpose .

  • AICOM is the factory that transforms briefs into shippable web products
  • AIMarket is the economy where products are discovered, invoked, and verified
  • Both AICOM and AIMarket share the same MIT stack and have live access doors

More from Friday 11 September →