~/talk

Make legacy code delightful with statecharts

Talkat React Finland 2021 · 2021-08-30..09-03· [frontend-architecture]
slides:none on file

Shows that messy React useEffect dependency soup (examples: a Pokémon fetcher and an async image/video hover player) becomes an executable state chart using XState / Stately, with explicit events and a runnable diagram that is literally the code. The result is intent-first, statically analyzable UI logic, easier debugging and targeted fixes, and straightforward model-based tests — demonstrated working on live examples and claimed to cut maintenance cognitive load.

AI-written summary · about

  1. 0:00Make legacy code delightful with statecharts Matt Pocock
  2. 0:15Legacy code is everywhere
  3. 0:27Legacy code is code without an organisational advocate
  4. 0:56When you understand the intent of legacy code, it stops being legacy
  5. 1:11Legacy Code in React
  6. 1:28useEffect
  7. 2:01Let's look at some code
  8. 3:24What's wrong with this process?
  9. 3:35You need to track all the dependencies first
  10. 3:48Then, understand all the implementation details
  11. 4:00The intent of the code is the last thing you understand
  12. 4:11Is this process delightful?
  13. 4:34Let's go again!
  14. 4:59mattpocock/react-finland-talk
  15. 7:40This problem scales with complexity
  16. 8:01How would you mitigate it?
  17. 8:57External Docs
  18. 10:21What's the solution?
  19. 12:03Intent first, implementation second
  20. 12:35Explicit events Implicit dependencies
  21. 13:31Tired: the diagram represents the code
  22. 14:06Statically Analyzable Code
  23. 14:42Code that can speak for itself
~/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.