Pretext Does What CSS Can't — Measuring Text Before the DOM Even Exists
SMRTR summary
Cheng Lou released Pretext, a JavaScript library that bypasses DOM layout reflow by implementing pure JavaScript text measurement using canvas. It splits text into segments once, caches measurements, then performs layout calculations without touching the DOM. Early benchmarks show massive speedups for virtualized lists and chat UIs that need pre-render height calculations.
SMRTR provides this summary for quick context. The original article belongs to Hacker Noon.
Read the original article