#dom #wasm-bindings #ui #wasm-interpreter #ui-framework #react

dioxus-interpreter-js

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

23 releases

new 0.6.0 Dec 7, 2024
0.6.0-alpha.5 Nov 16, 2024
0.5.6 Jul 18, 2024
0.5.0 Mar 28, 2024
0.2.0 Mar 9, 2022

#832 in GUI

Download history 2954/week @ 2024-08-19 3151/week @ 2024-08-26 3256/week @ 2024-09-02 2897/week @ 2024-09-09 3003/week @ 2024-09-16 3905/week @ 2024-09-23 2876/week @ 2024-09-30 2070/week @ 2024-10-07 3232/week @ 2024-10-14 3770/week @ 2024-10-21 3117/week @ 2024-10-28 2656/week @ 2024-11-04 2264/week @ 2024-11-11 2556/week @ 2024-11-18 2928/week @ 2024-11-25 4364/week @ 2024-12-02

12,304 downloads per month
Used in 61 crates (7 directly)

MIT/Apache

270KB
4.5K SLoC

Rust 3.5K SLoC // 0.1% comments TypeScript 1K SLoC // 0.1% comments JavaScript 6 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–7.5MB
~58K SLoC