DOM ENGINEV0.10.0FIZLET

DEBUG V0.10.0

fizlet/debug

Development-only checks. guardLayout(engine) counts every layout read (rects, offset/client/scroll sizes, computed style) made while the engine is in its STEP phase, the contract's "no layout reads in the tick". Never ship this in a production build.

fizlet/debug · GZIP493 B0.5 KB of a 1.5 KB budget

Measured on this build: minified and gzipped with everything it imports, the way npm run size checks the budget in CI.

MODULES · hosted on this site
import { guardLayout } from "https://coded-dot-design.github.io/fizlet/dist/debug.js";
NPM · COMING SOON
npm install fizlet   # not published yet
import { guardLayout } from "fizlet/debug";
IN SHORT
import { guardLayout } from "fizlet/debug";
guardLayout(e);  // dev builds only
e.violations;    // layout reads made in a step: 0

API

Every export, with its doc comment, read from the published type declarations of v0.10.0.

guardLayout function

Count layout reads made during a step; the number shows as engine.violations.

export declare function guardLayout(engine: Engine): () => boolean;