TGViewer
Vibecoding Haven (BotfatherDEV) Vibecoding Haven (BotfatherDEV) @botfatherdev · 2.6K subscribers
Post #1725 492
https://x.com/_chenglou/status/2037713766205608234

Тут навчилися дуже ефективно рахувати висоту тексту без DOM. Cheng Lou (автор react-motion, ReasonML у Facebook, зараз Midjourney) випустив Pretext — pure JS/TS бібліотеку для text measurement

ідея проста: замість getBoundingClientRect (який тригерить layout reflow і вбиває перфоманс) він юзає canvas.measureText() — той самий font engine браузера, але без reflow.

Один раз робимо prepare(), далі layout() — чиста арифметика по кешованих ширинах

різниця — 300-600x. 500 текстових блоків: DOM = 15-30мс і 500 reflow, Pretext = 0.05мс і нуль reflow

побудовано з Claude + Codex, тижнями тренували на browser ground truth по всіх мовах, емодзі, RTL. 5.6k зірок за пару днів

bun install @chenglou/pretext
X (formerly Twitter) Cheng Lou (@_chenglou) on X My dear front-end developers (and anyone who’s interested in the future of interfaces): I have crawled through depths of hell to bring you, for the foreseeable years, one of the more important fo…
More from @botfatherdev
  1. Oct 10, 2026💸 If your wallet doesn’t look like this, don’t even bother sending me money for my birthd…
  2. Oct 10, 2026З такими оновленнями делегатус виглядає цікавіше бо тут подібне постійно додається
  3. Oct 8, 20266.1 sol на ultrafast !!!
  4. Oct 8, 2026ааа, а з яких пір у нас є просто gpt 6? я щось пропустив? раніше ж були sol, luna та astra…
  5. Oct 7, 2026Готується щось неймовірне
  6. Oct 5, 2026нам потрібно створити swarm of continuosly learning embodied ai, і дуже імовірно вирішитьс…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →