#dom #react #ui #wasm

dioxus-interpreter-js

JS Intepreter for Dioxus - a concurrent renderer-agnostic Virtual DOM for interactive user experiences

14 unstable releases (5 breaking)

0.5.1 Apr 5, 2024
0.5.0 Mar 28, 2024
0.5.0-alpha.0 Feb 23, 2024
0.4.3 Dec 7, 2023
0.2.0 Mar 9, 2022

#887 in GUI

Download history 1615/week @ 2024-01-01 1804/week @ 2024-01-08 1611/week @ 2024-01-15 1910/week @ 2024-01-22 1400/week @ 2024-01-29 1336/week @ 2024-02-05 1247/week @ 2024-02-12 2068/week @ 2024-02-19 2020/week @ 2024-02-26 2388/week @ 2024-03-04 1612/week @ 2024-03-11 1908/week @ 2024-03-18 2494/week @ 2024-03-25 2740/week @ 2024-04-01 2693/week @ 2024-04-08 2885/week @ 2024-04-15

11,018 downloads per month
Used in 42 crates (6 directly)

MIT/Apache

215KB
3.5K SLoC

Rust 3K SLoC // 0.1% comments TypeScript 671 SLoC // 0.2% comments JavaScript 3 SLoC

dioxus-interpreter-js

Crates.io MIT licensed Build Status Discord chat

Website | Guides | API Docs | Chat

Overview

dioxus-interpreter-js provides the high-performance JavaScript glue that interprets the stream of edits produced by the Dioxus VirtualDom and converts them into mutations on the actual web DOM.

This crate features bindings for the web and sledgehammer for increased performance.

Architecture

We use TypeScript to write the bindings and a very simple build.rs along with bun to convert them to javascript, minify them, and glue them into the rest of the project.

Not every snippet of JS will be used, so we split out the snippets from the core interpreter.

In theory, we could use Rust in the browser to do everything these bindings are doing. In reality, we want to stick with JS to skip the need for a WASM build step when running the LiveView and WebView renderers. We also want to use JS to prevent diverging behavior of things like canceling events, uploading files, and collecting form inputs. These details are tough to ensure 1:1 compatibility when implementing them in two languages.

If you want to contribute to the bindings, you'll need to have the typescript compiler installed on your machine as well as bun:

https://bun.sh/docs/installation

Contributing

  • Report issues on our issue tracker.
  • Join the discord and ask questions!

License

This project is licensed under the MIT license.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Dioxus by you shall be licensed as MIT without any additional terms or conditions.

Dependencies

~0–9.5MB
~58K SLoC