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. ββ€οΈ

Top comments (0)