Skip to main content

Module dev_server

Module dev_server 

Source
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§

BatchOutcome
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 + a DepGraph into the right HMR frame.
run_dev_loop
Pumps debounced batches off watcher and broadcasts each frame.