SMRTR ProgrammingMar 30, 2026Hacker Noon

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
SMRTR Programming

Get the next batch of curated summaries in your inbox.

This archive is built from SMRTR newsletter summaries. Subscribe for hand-picked stories without the extra noise.