Okay, I’ve never done a “Saturday Special Edition” of my newsletter, and it honestly feels kinda cheesy, but whatever, I’m doing it. The reason I felt like I had to publish this today, pretty much immediately, is because I read about something this morning on X that I think is a pretty big deal, not just AI hype, but something foundational.

Before I share my two cents, let me show you the tweet, that is going absolutely parabolic on X right now:

And first, before you think - ugh, this is another AI hype man trying to get some views…it’s not. Cheng is a badass engineer who worked on React, Midjourney, etc. He knows what he’s doing, and what he shared isn’t theoretical, it’s a real thing, with a Github repo, that anyone can start playing around with this weekend.

If this takes off, it could kill CSS, and I’m not being dramatic, this could really be a foundational shift.

Okay, now let’s get to the good stuff, here’s the TL;DR on what Cheng announced:

It’s a library called pretext, a pure TypeScript text measurement engine that can figure out exactly how text will lay out on screen without ever touching the browser DOM.

That's a big deal. Here's why:

Normally, if you want to know how tall a paragraph of text will be (e.g. to do virtualization, layout, or animations), you have to ask the browser by injecting elements and calling getBoundingClientRect(). This forces the browser to do a full reflow, one of the most expensive operations on the web, and if you read/write the DOM in alternating steps (which most UI code does), it’s freakin’ sloooooow. It also breaks component-based architectures because layout math can leak across component boundaries.

pretext solves this by computing text dimensions entirely in JavaScript/TypeScript, no DOM required. That unlocks things like:

  • Virtualizing hundreds of thousands of text boxes while scrolling at 120fps

  • Perfectly shrink-wrapped chat bubbles with no layout issues

  • Responsive multi-column magazine layouts

  • Complex canvas-based UIs that need to know text size ahead of render

Cheng trained the measurement model by feeding Claude Code and Codex real browser ground truth and had them iterate for weeks. The result is a tiny (few kB), browser engine that works across languages.

If this sounds interesting to you, and you want to dive deeper, here’s the GH repo ⬇️

Okay, it’s a beautiful day in Tahoe, time for a little mountain bike ride. Thanks for reading and have a great weekend - I’ll leave you with this 🧘‍♂️

Keep Reading