~/talk

Building a Time Machine with ES6 Proxies

Talkat Porto Tech Hub Conference 2024 · on Tuesday, 2024-11-26· [javascript, creative-coding]
slides:none on file

Live-coded a working time engine built on ES6 Proxies that logs state changes into an array of snapshots, overrides proxy get/set handlers to push deep-copied states (using structuredClone), and adds an onUpdate callback for free reactivity. It implements stepwise undo/redo, timestamped jumps (cutting history to a chosen time), and branching timelines stored as arrays of timelines; covers pitfalls: reference mutation, memory cost, and the option to save deltas instead of full snapshots.

AI-written summary · about

  1. 0:00Introduction
  2. 1:07About the speaker
  3. 3:34What are JavaScript proxies
  4. 5:22Time machine concept
  5. 9:15Planning the time machine
  6. 11:06Live coding setup
  7. 12:13Creating a basic proxy
  8. 16:32Refactoring into time machine
  9. 17:36Adding reactivity
  10. 21:38Implementing undo/redo
  11. 28:17Demoing the game
  12. 30:05Integrating time machine
  13. 33:23Fixing state duplication
  14. 37:03Deep cloning states
  15. 39:31Jumping back in time
  16. 44:12Multi-timeline demo
  17. 45:18Final implementation
  18. 46:44Optimization ideas
  19. 47:11Q&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.