@rethunk/react-render-audit
v0.2.0
Published
Playwright helpers that measure what a React page does: commits per component and why, idle activity, backend-call counts, layout breaks, and a pixel diff of two screenshot folders.
Readme
Playwright helpers that measure what a React page does: commits per component and why, idle activity, backend-call counts, layout breaks, and a pixel diff of two screenshot folders. Package @rethunk/react-render-audit. First consumer: Mortar.
It reads React's DevTools hook, so it counts commits by component without a dev build, and its layout checks need
no baseline to see a bug. Selectors for a UI library are options; muiPreset holds the values that fit MUI.
await page.addInitScript({ content: hookScript(muiPreset) })Quick start
bun add @rethunk/react-render-auditA worked example and the contracts: HUMANS.md.
Features
hookScriptandMeterreport commits per component and why, mutations, long tasks and backend calls.layoutBreaksfinds a control squeezed to nothing, text covered by another element and a page wider than its window. A positioned<aside>laid over content is taken as a side panel meant to cover it, and a menu or dialog kept mounted while hidden is not taken as the open layer.unevenSpacingandnestedBoxesfind uneven gaps and a box inside a same-looking box.diffShotsand therender-diffcommand compare two screenshot folders pixel by pixel.webkitWalkrepeats the layout checks in WebKitGTK through WebKitWebDriver.@rethunk/react-render-audit/procreads a process tree's memory and CPU from Linux/proc, for budget scripts.
Documentation
| Doc | Audience | | ---------------------------------- | ------------------------------ | | HUMANS.md | Running and using the package | | AGENTS.md | Internals, invariants, and why | | CONTRIBUTING.md | Process — commits, tests, docs | | SECURITY.md | Vulnerability disclosure | | CHANGELOG.md | Release notes |
License
MIT — see LICENSE. © 2026 Rethunk.Tech, LLC.
