arel is a βLightweight browser hot reload for Python ASGI web appsβ
I just implemented this on my thoughts website using fastapi, and itβs incredibly fast and lightweight. There just two lines of js that make a web socket connection back to the backend that watches for changes.
When in development mode, this snippet gets injected directly on the page and does a refresh when arel detects a change.
const ws = new WebSocket("ws://localhost:5000/hot-reload");
ws.onmessage = () => window.location.reload();