pub fn process_batch(
batch: &ChangeBatch,
graph: &DepGraph,
output_dir: &Path,
) -> BatchOutcomeExpand description
Policy table: turn a ChangeBatch + a DepGraph into the right
HMR frame.
Rules:
- All CSS →
hmr-css(AC2) — list every changed.csspath. - Markdown / HTML content (no templates) →
hmr-html(AC3) — list invalidated output URLs from the dep graph. - Template touched →
hmr-htmlif the dep graph resolves affected pages (AC4); falls back toreloadif no pages are linked (e.g. a brand-new template). - Mixed CSS + content →
reloadto keep the protocol simple. - All other (data, fonts, images that aren’t fingerprinted) →
reloadso the user always sees the latest build.
§Examples
use ssg::dev_server::process_batch;
use ssg::depgraph::DepGraph;
use ssg::event_watch::ChangeBatch;
use std::path::Path;
let batch = ChangeBatch { paths: vec![] };
let outcome = process_batch(&batch, &DepGraph::new(), Path::new("build"));
assert!(outcome.frame.is_none());