Reactive web pages in Ruby
Mayuisaliveupdatingserver-siderenderingwebframeworkwritteninRuby
How does it work?
- Mayu implements a Virtual DOM in Ruby.
- All DOM updates are streamed to a small browser runtime that takes care of patching the DOM.
- Event handlers run on the server.
Efficient
- HTTP/2 Streams with compression and MessagePack.
- Designed to be deployed on the edge.
- Pages are interactive immediately on FCP.
- Prometheus-endpoint for real-time metrics.
Live from the server
Everything on this page was rendered on the server at 21:38:24 UTC. The only JavaScript in the browser is a small runtime that patches the DOM whenever state changes on the server.
A counter
The buttons call Ruby methods.
The new count is streamed back as a DOM patch.
Source is loading.View it on GitHub
A calculator
This calculator is implemented in Ruby.
Calculations are server-side.
Source is loading.View it on GitHub
What you get
A full stack in one place: components, styling, assets, routing and a live connection to the browser.
100% server side
State, rendering and event handlers all live in Ruby.
100% async
Fibers instead of callbacks. Write straight-line code.
Haml components
Markup, Ruby and CSS together in one file.
CSS modules
Styles are scoped to the component that owns them.
Assets handled
Import images, fonts and SVGs. Hashing and resizing are automatic.
Hot reloading
Save a file and the page updates, state included.
File based routing
Pages, layouts and API routes follow the directory tree.
Built for the edge
HTTP/2 streams with compression and MessagePack.
Read more on GitHub