~/talk

How Fast Refresh Works In Vite

Talkat React Brussels 2023 · on Friday, 2023-10-13· [javascript, react]
links:none on file
slides:none on file

Builds a Vite plugin that injects the React Fast Refresh client via transformIndexHtml, adds per-module HMR wrappers that call import.meta.hot.accept(), and runs an AST transform (Babel or SWC, with a working prototype using esbuild to avoid a 30MB Rust dependency) to register function components. Demonstrates click-to-component support, shows state is preserved across updates for PascalCase, named components, and documents the major limitation that files must export only React components — provides an ESLint rule and a PR-ready esbuild change; it works on the presenter’s machine.

AI-written summary · about

  1. 0:00Introduction and agenda
  2. 1:29Vite architecture overview
  3. 4:49Understanding HMR mechanics
  4. 7:02Fast Refresh fundamentals
  5. 8:23Building the Vite plugin
  6. 11:30Fast Refresh limitations
  7. 13:37Demo and optimization
  8. 17:36Future improvements
~/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.