Meet Mata: live reload for Rack Apps
I build quite a few sites. For my own products or I help others. Since I released Perron that is my go-to static site generator now. But it was missing one feature for a speedy development cycle: live reload. Not just a page refresh, but more like hot reloading.
Most live reload solutions either require ActionCable (overkill when using Perron) or just do full-page reloads (annoying/too minimal). I wanted something in between.
Meet Mata: a lightweight live reload solution for Rack apps. It uses Server-Sent Events (SSE) and idiomorph.
You can install Mata simply by running bundle add mata --group=development. Then configure the middleware with watch and skip paths. That’s it. No JavaScript bundling. No ActionCable. No WebSockets. Just smart live reloading! ✨
But Mata isn’t just for Perron. It works with any Rack-based framework, like Rails: Sinatra, Hanami or Roda. 🚀 See the GitHub README for set up examples.
Look, mom, no hands:

So why the name? It’s named after the legendary double agent: Mata Hari. 🕵️💃🤓
(oh, I learned while in Indonesia, in Bahasa Indonesia, mata means eye. A fun coincidence, for something that watches your files. 😅)
Already using Mata (you do if you use Perron!)? Give Mata a star on GitHub. ⭐❤️
Want to read me more?
-
Perron 1.0 here is here
Perron 1.0 is here. Nine months in the making, packed with powerful features like programmatic SEO, live reload with DOM morphing and feeds out of the box. -
Welcome to a new Rails Designer
Rails Designer has a complete new look and more importantly is now powered by Perron, the Rails-based SSG. -
Introducing Perron: Rails-based static site generator
Introducing a new, OSS static site generator based on Rails: Perron. Build your next static site using the framework you love.
Over to you…
What did you like about this article? Learned something knew? Found something is missing or even broken? 🫣 Let me (and others) know!
Comments are powered by Chirp Form
{{comment}}