~/talk

A Look at Vite HMR API and its Use in React Plugins

Talkat ViteConf 2023 · 2023-10-05..10-06· [frontend-architecture, react]
links:none on file
slides:none on file

Shows how Vite’s HMR API plus React Fast Refresh actually works: uses import.meta.hot.accept (including the two-argument dependency form) to update components while preserving state, calls invalidate to trigger full reloads when needed, and demonstrates using vite-plugin-inspect to view the plugin’s code transforms. Compares Babel and SWC transforms, explains esbuild’s JSX removal, details the module graph behavior (propagation stops at roots or cycles and forces reload), and demos a zustand-backed dynamic config that updates reliably.

AI-written summary · about

  1. 0:00Introduction to HMR
  2. 1:14Basic HMR API usage
  3. 2:38React Fast Refresh setup
  4. 4:29HMR module graph and updates
  5. 6:29HMR limitations and cycles
  6. 7:12Fast Refresh component rules
  7. 8:42Context API HMR handling
  8. 9:30Dynamic config with HMR
  9. 10:59Summary and Q&A
~/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.