Fireship · @fireship

He just crawled through hell to fix the browser…

Uploaded April 2, 2026 · Length 5:37

He just crawled through hell to fix the browser…

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.

  1. 0:00

    earlier this week. The world may have

  2. 0:01

    changed forever. No, it's not because I

  3. 0:03

    finally figured out who was stealing all

  4. 0:05

    the water off the top of my Greek

  5. 0:06

    yogurt. It's because Changlu, a former

  6. 0:09

    React core team member and engineer at

  7. 0:11

    Midjourney, that claims to have crawled

  8. 0:13

    through the depths of hell to bring us

  9. 0:14

    pretext, a fast, secure, accurate, and

  10. 0:17

    comprehensive text measurement library

  11. 0:19

    written in pure Typescript. Now, I know

  12. 0:21

    if you don't have a deep, innate

  13. 0:22

    interest in trains, that might sound

  14. 0:24

    boring, but it's actually a massive

  15. 0:25

    gamecher for UI development. Ever since

  16. 0:28

    Al Gore invented the internet, rendering

  17. 0:30

    dynamic text has had a performance

  18. 0:31

    trade-off. When the browser needs to

  19. 0:33

    figure out how tall a paragraph is or

  20. 0:35

    where to break a line, it has to trigger

  21. 0:37

    a layout reflow, which often calculates

  22. 0:39

    the position and geometry of every

  23. 0:41

    element on the page. This reflow is one

  24. 0:43

    of the most expensive operations a

  25. 0:45

    browser can perform. But it's also what

  26. 0:47

    the browser needs to do whenever you ask

  27. 0:49

    it for the height of any text element.

  28. 0:51

    This makes it unreasonably difficult to

  29. 0:53

    build any sort of text heavy UI like a

  30. 0:55

    virtualized list or a masonry layout.

  31. 0:57

    But now, finally, in 2026, with pretext,

  32. 1:00

    you may be able to smoke your crack and

  33. 1:02

    eat it too. In today's video, we'll look

  34. 1:04

    at its crazy engineering under the hood

  35. 1:05

    and find out if it lives up to the hype.

  36. 1:07

    It is April 2nd, 2026, and you're

  37. 1:10

    watching the Code Report. A decade ago,

  38. 1:12

    while the rest of us were busy having

  39. 1:13

    premarital relations and mourning the

  40. 1:15

    death of Harambe, it chang spent his

  41. 1:18

    time studying the blade of front-end

  42. 1:19

    infrastructure at Facebook while also

  43. 1:21

    building React Motion, one of the most

  44. 1:23

    popular animation libraries in the React

  45. 1:25

    ecosystem. And so, when a person with

  46. 1:27

    his experience says they're releasing

  47. 1:29

    what they believe will be one of the

  48. 1:30

    most important foundational pieces of UI

  49. 1:33

    engineering, they're either in the midst

  50. 1:34

    of a deep episode of AI psychosis or

  51. 1:36

    they're on to something big. Either way,

  52. 1:38

    it makes for a good story. But what

  53. 1:40

    exactly makes pretext so foundational?

  54. 1:42

    Well, Chang figured out a way to bypass

  55. 1:44

    the typical browser text rendering

  56. 1:46

    pipeline that was designed during the

  57. 1:48

    Clinton administration when websites

  58. 1:50

    look like this. Now, let's imagine

  59. 1:51

    you're building a chat app for train

  60. 1:53

    enthusiasts. It needs to be fast or else

  61. 1:55

    users will blast you on Blue Sky for not

  62. 1:57

    caring about poor people. But the

  63. 1:59

    problem is that the main view in your