Module

server.dev_browser_reload

Browser live reload for development (SSE + mtime polling).

No extra dependencies: polls file mtimes on an interval and emitsreload events. Works alongside Pounce's Python--reloadso .py changes restart the process while .html/.css edits trigger an in-browser refresh.

Functions

_watch_roots 1 list[Path]
Directories to scan for template/static changes.
def _watch_roots(config: AppConfig) -> list[Path]
Parameters
Name Type Description
config AppConfig
Returns
list[Path]
_reload_event_stream 1 AsyncIterator[SSEEvent]
Yield SSE reload events when watched files change.
async
async def _reload_event_stream(config: AppConfig) -> AsyncIterator[SSEEvent]
Parameters
Name Type Description
config AppConfig
Returns
AsyncIterator[SSEEvent]
make_dev_reload_pending_route 1 PendingRoute
Return a pending route for the dev-reload SSE stream.
def make_dev_reload_pending_route(config: AppConfig) -> PendingRoute
Parameters
Name Type Description
config AppConfig
Returns
PendingRoute