All Projects â†’ axelf4 â†’ vfin

axelf4 / vfin

Licence: MIT license
🦈 GUI framework agnostic virtual DOM library

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to vfin

Preact Worker Demo
Demo of preact rendering an entire app in a Web Worker.
Stars: ✭ 204 (+1100%)
Mutual labels:  virtual-dom
Ng Vdom
(Developer Preview) A virtual-DOM extension for Angular, also work as React bridge.
Stars: ✭ 249 (+1364.71%)
Mutual labels:  virtual-dom
Awesome-Rust-MachineLearning
This repository is a list of machine learning libraries written in Rust. It's a compilation of GitHub repositories, blogs, books, movies, discussions, papers, etc. 🦀
Stars: ✭ 1,110 (+6429.41%)
Mutual labels:  rust-library
Hydux
A light-weight type-safe Elm-like alternative for Redux ecosystem, inspired by hyperapp and Elmish
Stars: ✭ 216 (+1170.59%)
Mutual labels:  virtual-dom
Gccx
Transforms CPX (JSX like syntax) into asm-dom Virtual DOM
Stars: ✭ 234 (+1276.47%)
Mutual labels:  virtual-dom
SwiftElm
Reactive + Automaton + VTree in Swift, inspired by Elm.
Stars: ✭ 97 (+470.59%)
Mutual labels:  virtual-dom
Virtual Dom
The foundation of HTML and SVG in Elm.
Stars: ✭ 196 (+1052.94%)
Mutual labels:  virtual-dom
crc32c
Fast CRC-32-Castagnoli implementation in Rust
Stars: ✭ 26 (+52.94%)
Mutual labels:  rust-library
Superviews.js
Template engine targeting incremental-dom
Stars: ✭ 242 (+1323.53%)
Mutual labels:  virtual-dom
i2p-rs
Rust client library for interacting with I2P
Stars: ✭ 62 (+264.71%)
Mutual labels:  rust-library
Asm Dom
A minimal WebAssembly virtual DOM to build C++ SPA (Single page applications)
Stars: ✭ 2,604 (+15217.65%)
Mutual labels:  virtual-dom
Respo
A virtual DOM library built with ClojureScript, inspired by React and Reagent.
Stars: ✭ 230 (+1252.94%)
Mutual labels:  virtual-dom
wui builder
A dart library for building user interfaces for the web, inspired by reactjs.
Stars: ✭ 21 (+23.53%)
Mutual labels:  virtual-dom
Panel
Web Components + Virtual DOM: web standards for powerful UIs
Stars: ✭ 206 (+1111.76%)
Mutual labels:  virtual-dom
core
Server side rendering with The Elm Architecture in Deno
Stars: ✭ 16 (-5.88%)
Mutual labels:  virtual-dom
Svg Patterns
SVG patterns for Data Visualization.
Stars: ✭ 201 (+1082.35%)
Mutual labels:  virtual-dom
Live
Live views and components for golang
Stars: ✭ 251 (+1376.47%)
Mutual labels:  virtual-dom
Nebuchadnezzar
High Performance Key-Value Store
Stars: ✭ 49 (+188.24%)
Mutual labels:  rust-library
arangors
Easy to use rust driver for arangoDB
Stars: ✭ 120 (+605.88%)
Mutual labels:  rust-library
hidapi-rs
Rust bindings for the hidapi C library
Stars: ✭ 103 (+505.88%)
Mutual labels:  rust-library

vfin

vfin is a GUI framework agnostic virtual DOM library. Due to the small number of assumptions made about the underlying framework the design is different from other VDOM libraries. While fully functional, the interface is not yet stable.

See the web DOM example for usage.

The html! macro

Vtree defines simple stack operations, create_element and pop_parent, unlike in the JS-world where one would typically nest function calls instead. The html! macro is sugar for creating trees.

fn render(app: Rc<RefCell<App>>) -> Vtree<DomContext> {
    use Attribute::*;
    let mut vtree = Vtree::new();
    html!{vtree,
        <Div>
            <Div Text=state.count, />
            // Inline code-block
            { render_part(&mut vtree); }
            <Button Text="Increment", OnClick={
                let app = Rc::clone(&app);
                move || {
                    dispatch(&app, Action::IncrementCount);
                }
            }, />
            <Div>
            {
                for i in 0..4 {
                    let i = if state.count < -1 { 5 - i } else { i };
                    // Resume adding nodes
                    html!{vtree, <Div key=i, Text=i, />}
                }
            }
            </Div>
        </Div>
    }
    vtree
}

Here Div and Button are trait objects that contain procedures for un-/mounting and updating attributes for the respective types.

DomContext is a DOM backend specific type that implements the Context trait and is responsible for actually carrying out the patching.

The function patch takes a Context and the previous Vtree and a reference to the new Vtree and performs the diffing.

vfin-dom

vfin-dom is a vfin backend for the web.

Disadvantages compared to Yew or similiar

  • Potentially larger generated binaries. Each tag needs its own trait implementation.
  • No batteries included. This is only a virtual DOM framework and not a general application framework. (Though I would consider it an advantage. You are free to use whatever state store you wish)

Roadmap

  • Working example.
  • Only send delta movements to context.
  • Recursive unmounting. Otherwise you'd get memory leaks in non-garbage collected backends that don't store destructor addresses.
  • Stateful virtual nodes.
  • New more performant diffing algorithm, using LIS or similar. Currently Heckel diff is used, which is still O(n).
  • Sub-tree rendering. Possible without API breaking changes.
  • String keys. Currently only integer keys are supported.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].