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.
server.dev_browser_reload
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
Publish one stable plan per file revision across reload connections.
Return whether dev browser reload should register browser-visible wiring.
Directories to scan for template/static changes.
Yield SSE reload events when watched files change.
Return redacted planner records for changed HTML before full reload.
Serialize only the public-safe fields approved for DevTools.
Build the shared planner lazily after app freeze publishes its graph.
Return a pending route for the dev-reload SSE stream.
_TemplateReloadPlannerLike
class
_TemplateReloadPlanPublisher
class
Publish one stable plan per file revision across reload connections.
is_dev_browser_reload_enabled
function
def is_dev_browser_reload_enabled(config: AppConfig) -> bool
Return whether dev browser reload should register browser-visible wiring.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
config
|
AppConfig
|
— |
_watch_roots
function
def _watch_roots(config: AppConfig) -> list[Path]
Directories to scan for template/static changes.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
config
|
AppConfig
|
— |
_reload_event_stream
function
async
async def _reload_event_stream(config: AppConfig, planner: _TemplateReloadPlannerLike | None = None) -> AsyncIterator[SSEEvent]
Yield SSE reload events when watched files change.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
config
|
AppConfig
|
— | |
planner
|
_TemplateReloadPlannerLike | None
|
None
|
_template_reload_plan_events
function
def _template_reload_plan_events(changed_paths: list[Path], planner: _TemplateReloadPlannerLike | None) -> tuple[SSEEvent, ...]
Return redacted planner records for changed HTML before full reload.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
changed_paths
|
list[Path]
|
— | |
planner
|
_TemplateReloadPlannerLike | None
|
— |
_template_reload_plan_event
function
def _template_reload_plan_event(plan: TemplateReloadPlan) -> SSEEvent
Serialize only the public-safe fields approved for DevTools.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
plan
|
TemplateReloadPlan
|
— |
_build_template_reload_planner
function
def _build_template_reload_planner(runtime_state: RuntimeAppState | None, fragment_targets: FragmentTargetRegistry | None) -> _TemplateReloadPlannerLike | None
Build the shared planner lazily after app freeze publishes its graph.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
runtime_state
|
RuntimeAppState | None
|
— | |
fragment_targets
|
FragmentTargetRegistry | None
|
— |
make_dev_reload_pending_route
function
def make_dev_reload_pending_route(config: AppConfig, runtime_state: RuntimeAppState | None = None, fragment_targets: FragmentTargetRegistry | None = None) -> PendingRoute
Return a pending route for the dev-reload SSE stream.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
config
|
AppConfig
|
— | |
runtime_state
|
RuntimeAppState | None
|
None
|
|
fragment_targets
|
FragmentTargetRegistry | None
|
None
|
View source · /home/runner/work/chirp/chirp/site/../src/chirp/server/dev_browser_reload.py:1