~/talk

React Compiler Internals

Talkat React Conf 2024 · 2024-05-15..05-16· [react, compilers-and-language-design]
github:mofeiZ
slides:none on file

A tiny compiler parses a React component with a Babel parser into flat instruction IDs, then identifies which instructions to memoize, computes precise dependency arrays, and detects writable results so adjacent useMemo calls get merged. Two lines of input expand into about ten memo calls before analysis prunes and consolidates them. The demo builds this pipeline, emits transformed code that runs, and notes gaps left out (hooks, full passes) plus a simple fix for aliasing.

AI-written summary · about

  1. 0:00Introduction to compiler
  2. 1:28Setting up the demo
  3. 5:48Generating low-level instructions
  4. 8:17Analyzing memoization needs
  5. 11:58Computing changing values
  6. 14:09Fixing dependency arrays
  7. 17:44Detecting writable values
  8. 20:34Finalizing the compiler
  9. 21:59Handling aliasing issues
  10. 22:20Real compiler output
  11. 23:25Summary and next steps
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.