Notes

PRETEXT and the Long Arc of Cheng Lou's Work

Cheng Lou built React Motion, pushed ReasonML into production at Facebook, and worked on Midjourney. His latest project, PRETEXT, takes on one of the web's oldest headaches: text layout.

PRETEXT and the Long Arc of Cheng Lou's Work

Some people ship libraries. Cheng Lou ships mental models.

If you’ve been in the React world for any amount of time, you’ve probably used or at least heard of React Motion. Springs instead of durations. Physics instead of easing curves. It wasn’t just another animation lib — it changed how people thought about movement in interfaces. That was back in 2015.

His GitHub bio reads: ReactJS, ReasonML, ReScript, Messenger, Midjourney. One line, but if you know what each of those projects meant at the time they happened, it tells a whole story. React rewired component thinking. ReasonML brought OCaml-style types into the frontend, and the Messenger team at Facebook actually went and converted half their codebase to it. Then he ended up at Midjourney, which… yeah. Different universe entirely.

The thing that ties all of this together is that Cheng Lou keeps finding the spots where the web feels stuck — the stuff everyone just accepted as “how it is” — and he builds something that unsticks it.

Which brings us to PRETEXT.

PRETEXT

Released March 26, 2026. A JS/TS library for multiline text measurement and layout.

Sounds boring on paper. It’s not.

You know the drill. You need to know how tall some text is going to be. Or how many lines it’ll wrap into. Or you want text to flow around some non-rectangular shape. So you throw it into a hidden div, read back the dimensions, cache the result, and hope nothing invalidates it before the next frame. We’ve all been there. It works, but it’s duct tape.

PRETEXT skips all of that. You prepare your text once, and after that, layout is cheap. DOM, Canvas, SVG — doesn’t matter. It just works. No hidden elements, no layout thrashing, no crossing your fingers.

The reason this feels like a big deal is that text is the one thing that’s everywhere in every interface, and yet we still don’t have great tools for reasoning about it programmatically. Buttons change labels. Users write in different languages. AI spits out content of random length. Chat UIs need pixel-perfect heights. The moment text gets dynamic, things get fragile fast.

PRETEXT makes text something you work with instead of something you work around. That’s the shift.

The pattern

React Motion — animation was janky and over-specified, so he made it physical. ReasonML — frontend code was fragile at scale, so he brought real types. PRETEXT — text layout was a guessing game, so he made it computable.

Different problems, same instinct. Find the thing everyone normalized as painful, then go one layer deeper and actually fix it. Not a wrapper. Not an abstraction over the mess. A new primitive.

That’s rare. Most of us build on top of whatever’s there. Cheng Lou keeps rebuilding the layer underneath.

The demos are worth checking out. Not because they’re flashy, but because they make you realize how much we’ve been leaving on the table with text. Once layout is programmable, a lot of interfaces that felt impossible start to feel obvious.


Written by Archie

Sources

Your privacy choices

Cookie preferences

We use a small set of cookies to make this site work and to understand which content is useful. You can change these at any time.

Accessibility

Reading & motion

Quick toggles for comfort. These stay on this device and respect your system-level preferences by default.