Vertigo
A reactive Real-DOM library with SSR for Rust. The graph of values and
computeds works out what to refresh when one of them changes, and the result
is written straight to the DOM - there is no virtual DOM in between.
The same WebAssembly renders this page on the server and in the browser, so
what you are reading arrived as HTML and was then taken over by the wasm.
Each tab below is a small demonstration of one part of that. Follow a link, or
step through them with the left and right arrow keys.
Counters
Value and Computed: one write reaching a counter, a sum, and the sum's double.
Styling
The css! macro, an animation, a tooltip, and Tailwind classes.
Sudoku
A wide reactive graph - 81 cells, each deriving its candidates from twenty peers.
Input
One Value<String> behind an input, a textarea, and a derived character count.
Github Explorer
LazyCache over a fetch, decoding nested AutoJsJson structs.
Game Of Life
8400 Value<bool> driven by a timer, fanned back into a single population count.
Chat
A websocket connection, with each message echoed to every client.
Fetch
LazyCache again, prefetched during SSR so the browser does not ask a second time.
Drop File
Files by drag-and-drop or by a file input, both arriving as a DropFileEvent.
Driver
get_driver(): cookies, the timezone, a random number, history and the router.
JS Api Access
The js! macro and NodeRef, for reaching what vertigo does not wrap itself.
List
render_list and a hand-built dom_element! loop over the same data.
Lazy List
LazyListCache: optimistic create, update and delete, rolled back on error.
WS Collection
WsCollection - a collection the server pushes, re-queried as you filter it.
Svg
Namespaced elements, and the workaround for tags that clash with HTML.
Source: github.com/vertigo-web/vertigo - the code for every tab is under demo/app/src/app.