1 unstable release

0.2.0 Nov 9, 2024

#238 in WebAssembly

Download history 100/week @ 2024-11-08 9/week @ 2024-11-15

109 downloads per month

Apache-2.0

41KB
1.5K SLoC

Elmio

Elmio is a lightweight, proof-of-concept web framework inspired by The Elm Architecture. It's built using the Rust programming language and compiles to WebAssembly.

Overview

Elmio provides a structured approach to building interactive web applications. It has two main components:

  1. elmio-rs: The Rust core of the framework.
  2. elmio-js: The JavaScript runtime that integrates with the Rust core.

The framework exposes a set of functions to the JavaScript runtime, allowing it to handle the application's state management, event handling, and DOM updates.

Key Concepts

init

This function returns the initial state of your application as a JSON object.

view

The view function generates the HTML representation of your application's UI as a string, which the JavaScript runtime uses to update the DOM.

update

When an event is triggered, the update function is called with the current state. It returns the new state and a list of effects (e.g., focus an element) as JSON.

subscriptions

This function defines the event listeners, intervals, and other asynchronous tasks your application needs. It returns a declarative list of subscriptions as JSON.

Contributing

Elmio is an open-source project, and contributions are welcome! If you encounter any issues or have ideas for improvements, please feel free to submit them via the project's issue tracker or open a pull request.

License

Elmio is licensed under the Apache 2.0 License.

Dependencies

~1.5–2.6MB
~50K SLoC