Fireship · @fireship
He just crawled through hell to fix the browser…
Uploaded April 2, 2026 · Length 5:37
Summary
Fireship reviews pretext, a text measurement library that bypasses browser rendering pipeline, enabling fast and accurate text calculations.
- pretext
- text measurement library
- ui engineering
- react
- typescript
- browser rendering
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
earlier this week. The world may have
- 0:01
changed forever. No, it's not because I
- 0:03
finally figured out who was stealing all
- 0:05
the water off the top of my Greek
- 0:06
yogurt. It's because Changlu, a former
- 0:09
React core team member and engineer at
- 0:11
Midjourney, that claims to have crawled
- 0:13
through the depths of hell to bring us
- 0:14
pretext, a fast, secure, accurate, and
- 0:17
comprehensive text measurement library
- 0:19
written in pure Typescript. Now, I know
- 0:21
if you don't have a deep, innate
- 0:22
interest in trains, that might sound
- 0:24
boring, but it's actually a massive
- 0:25
gamecher for UI development. Ever since
- 0:28
Al Gore invented the internet, rendering
- 0:30
dynamic text has had a performance
- 0:31
trade-off. When the browser needs to
- 0:33
figure out how tall a paragraph is or
- 0:35
where to break a line, it has to trigger
- 0:37
a layout reflow, which often calculates
- 0:39
the position and geometry of every
- 0:41
element on the page. This reflow is one
- 0:43
of the most expensive operations a
- 0:45
browser can perform. But it's also what
- 0:47
the browser needs to do whenever you ask
- 0:49
it for the height of any text element.
- 0:51
This makes it unreasonably difficult to
- 0:53
build any sort of text heavy UI like a
- 0:55
virtualized list or a masonry layout.
- 0:57
But now, finally, in 2026, with pretext,
- 1:00
you may be able to smoke your crack and
- 1:02
eat it too. In today's video, we'll look
- 1:04
at its crazy engineering under the hood
- 1:05
and find out if it lives up to the hype.
- 1:07
It is April 2nd, 2026, and you're
- 1:10
watching the Code Report. A decade ago,
- 1:12
while the rest of us were busy having
- 1:13
premarital relations and mourning the
- 1:15
death of Harambe, it chang spent his
- 1:18
time studying the blade of front-end
- 1:19
infrastructure at Facebook while also
- 1:21
building React Motion, one of the most
- 1:23
popular animation libraries in the React
- 1:25
ecosystem. And so, when a person with
- 1:27
his experience says they're releasing
- 1:29
what they believe will be one of the
- 1:30
most important foundational pieces of UI
- 1:33
engineering, they're either in the midst
- 1:34
of a deep episode of AI psychosis or
- 1:36
they're on to something big. Either way,
- 1:38
it makes for a good story. But what
- 1:40
exactly makes pretext so foundational?
- 1:42
Well, Chang figured out a way to bypass
- 1:44
the typical browser text rendering
- 1:46
pipeline that was designed during the
- 1:48
Clinton administration when websites
- 1:50
look like this. Now, let's imagine
- 1:51
you're building a chat app for train
- 1:53
enthusiasts. It needs to be fast or else
- 1:55
users will blast you on Blue Sky for not
- 1:57
caring about poor people. But the
- 1:59
problem is that the main view in your


