diff --git a/docs/design/impact.md b/docs/design/impact.md new file mode 100644 index 0000000..5bc87e9 --- /dev/null +++ b/docs/design/impact.md @@ -0,0 +1,193 @@ +# Design note: which routes a change can affect, and which removed rules mattered + +Status: proposal, nothing built. Two framework-agnostic signals, neither reads the git diff. + +## Why not map the git diff to routes + +Mapping source files to routes is framework-specific (Next, Astro, Hugo and Jekyll all resolve +templates differently). For global CSS, the most common refactor, it answers "every route" +anyway, so a mapper that skips routes produces false confidence. The two signals below look +at what the build produced and what the browser actually applied. Neither is a reason to drop +a route. The first orders the route list. The second turns "no pixel diff" into evidence about +the CSS itself. + +## 1. Build-output diff: `renderdiff impact ` + +For static sites. A subcommand with no browser, like `report`. + +**What it does** + +1. Walks both dirs for `*.html` and maps each file to a route the way `npx serve` does + (`about/index.html` → `/about/`, `about.html` → `/about`). Pages on one side only are listed + separately. A page missing from the change will 404. +2. Compares each pair after `normalizeAssets` from `src/computed.ts`, the same normaliser + behind `--computed`'s `dom identical`. Two outcomes: `markup` (differs with inline + `