Server-driven interactive websites using the ELM architecture.
Find a file
2026-03-09 19:21:22 +01:00
examples html5: better table abstraction 2026-03-09 10:23:17 +01:00
src html5: better table abstraction 2026-03-09 10:23:17 +01:00
.gitignore Add README.md and LICENSE.txt 2026-03-09 19:21:22 +01:00
Cargo.lock init 2026-03-09 07:07:44 +01:00
Cargo.toml Add README.md and LICENSE.txt 2026-03-09 19:21:22 +01:00
LICENSE.txt Add README.md and LICENSE.txt 2026-03-09 19:21:22 +01:00
README.md Add README.md and LICENSE.txt 2026-03-09 19:21:22 +01:00

Overview

LiveView is the term used by Elixir's Phoenix Framework to describe their approach to server-side rendering. This library implements LiveView using a ELM-like architecture. While the ELM-architecture is typically implemented entirely on the client, LiveView moves the client-server boundary between the browser and the state.

  • After the initial page load, the client and server keep communicating using a WebSocket connection.
  • The client sends events (e.g. button clicks) to the server.
  • The state is mutated using the Component::update function.
  • The state is rendered to a DOM using the Component::view function.
  • The previous DOM and the new DOM are compared and a incremental update is generated.
  • The incremental update is transmitted to the client and applied to the real DOM.

Benefits

  • no state duplication between client and server
  • effortless synchronisation between multiple clients
  • effortless session resumption
  • low bandwidth incremental updates
  • no need for separate client application
  • no need for api endpoints on the server

Drawbacks

  • the website can only be used if the WebSocket is connected
  • round trip latency for every interaction

Usage

Please take a look at the documentation and the examples. Until the public API has settled, the README would probably always be outdated.

Examples

  • counter - a simple counter
  • streaming - a generator pushes a new element to a list every 10ms.

Meta

Contributing

Contributions of any kind are always welcome. You can use the modern Issue / PR workflow or the traditional E-Mail based Git workflow.

Contact

You can contact me (the author) using issues or per E-Mail at liveview-rs@pfzetto.de.

License

This project is licensed under MPLv2;