Sources
Fireship: Cheng Lou's Pretext — 15KB Library Achieves 500x Faster DOM-Free Text Layout, 14K Stars in 48 Hours
Fireship covers Cheng Lou's Pretext, a 15KB zero-dependency TypeScript library that calculates multiline text layout entirely in userland using Canvas font metrics and pure arithmetic, bypassing DOM reflow — the single most expensive browser operation at 10-100ms per forced reflow on mobile. The library hit 14K+ GitHub stars in 48 hours and 19M views on X; Cheng Lou is a former React core team member and current Midjourney engineer who previously created react-motion (21.7K stars). For builders: this enables real-time text-heavy UIs (editors, design tools, dashboards) that were previously bottlenecked by browser layout engines.
Source
↳ Follow the thread