Frontend
7 pieces · techniques, visualized · code + interpretation
Events & Performance02
Debounce & Throttle
Watch one keystroke stream collapse two different ways — and learn which question each answers.
JUL 2026· events· performance· timing
The Loop That Lays Out 800 Times
Same reads, same writes, same pixels — one order is an order of magnitude slower. Measure it on your own machine.
JUL 2026· performance· layout· reflow
Forms02
The input Event Lies While You're Composing
One Chinese word fires six input events carrying pinyin the user never typed. Replay a real IME trace and fix it in thirty lines.
JUL 2026· forms· ime· events
The Caret Jumps to the End
Format an input as the user types and the caret teleports right. Anchor it to a digit count, not an offset.
JUL 2026· forms· input· selection
Internals02
Writing useDebouncedValue
A hand-written debounced-value hook, read line by line — the source you see is the source that runs.
JUL 2026· react· hooks· source
StrictMode Runs Your Effect Twice On Purpose
The double-invoke is an assertion, not a nuisance: cleanup must undo setup — including the bookkeeping.
JUL 2026· react· useEffect· strictmode