Skip to content

src/dazzle_ui/runtime/hot_reload.py

Generated: 2026-03-30T04:38:49.039348+00:00

Commit: 615f1354a103

Language: python

Scope: dazzle_ui

Purpose

Hot reload support for DNR development server.

Watches DSL files and source files for changes and triggers browser refresh via SSE.

Two watch modes: 1. DSL files (.dsl, dazzle.toml) - regenerates specs on change 2. Source files (.py, .css, .js) - clears caches and triggers reload

Key Exports

  • FileWatcher
  • HotReloadManager
  • create_reload_callback
  • start
  • stop
  • start
  • stop
  • register_sse_client
  • unregister_sse_client
  • get_specs
  • set_specs
  • reload_specs

Dependencies

Imports

  • __future__.annotations
  • threading
  • time
  • collections.abc.Callable
  • pathlib.Path
  • typing.TYPE_CHECKING
  • dazzle.core.ir.AppSpec
  • dazzle_ui.specs.UISpec
  • importlib
  • sys
  • dazzle_ui
  • dazzle_ui.runtime.template_renderer.get_jinja_env
  • dazzle.core.fileset.discover_dsl_files
  • dazzle.core.linker.build_appspec
  • dazzle.core.lint.lint_appspec
  • dazzle.core.manifest.load_manifest
  • dazzle.core.parser.parse_modules
  • dazzle_ui.converters.convert_appspec_to_ui

Event Interactions

None detected.

Invariants and Assumptions

No invariants documented.

Tests

  • tests/integration/test_runtime_e2e.py
  • tests/integration/test_runtime_pipeline.py
  • tests/unit/test_runtime_test_routes.py
  • tests/unit/test_runtime_services.py
  • tests/unit/test_runtime_mcp_tools.py

Notes

This page was automatically generated by tools/gen_reference_docs.py.