Expand description
Dev-server glue (issue #526) — wires EventWatcher → DepGraph
→ HmrBroadcaster into one loop.
Lifted out of bin/dev.rs so each policy decision (classify a change,
pick the HMR frame type, resolve invalidated outputs) is unit-testable
without spawning threads or binding a port.
FS event ──▶ ChangeBatch ──▶ process_batch ──▶ HmrMessage ──▶ tabs
(notify) (debounced) (DepGraph) (broadcaster)See process_batch for the policy table and run_dev_loop for
the integration point.
Structs§
- Batch
Outcome - Outcome of processing one debounced batch — the frame (if any) the caller should broadcast and the page paths invalidated by the batch (used by the rebuild step).
Functions§
- output_
to_ url - Convert an output filesystem path (e.g.
build/blog/foo/index.html) into the URL the browser tab is loaded at (/blog/foo/). - process_
batch - Policy table: turn a
ChangeBatch+ aDepGraphinto the right HMR frame. - run_
dev_ loop - Pumps debounced batches off
watcherand broadcasts each frame.