Skip to main content

Module drift

Module drift 

Source
Expand description

Checks that a hand-written frontend still agrees with the crate that generates its siblings.

The generated files cannot drift: they ask makeover-geometry for the answer. The hand-written ones state it, and a stylesheet or a script that disagrees with the crate is not an error at any point – it is a rule that quietly stops matching where it used to. Cheaper to read a panic naming the line.

Deliberately assertions and not substitutions. A JS or CSS file that has to be generated to be correct stops being readable on its own, and it is worth something that you can still open the frontend in a browser and have it work.

Functions§

check_breakpoints
Fail the build if a hand-written breakpoint has drifted from SizeClass.
check_breakpoints_files
check_breakpoints against a named list of files rather than a tree.
check_touch_density
Fail the build if a JS copy of the touch-density query has drifted from Density::Touch.