Execution — fw-05-vue-renderer

Steps extracted from CONCEPTS.md. Read the concepts first; this file is the doing.

Record results in observation.md; tick checkpoints in verification.md.


2. Build order

  1. VNode representation; h().
  2. render(vnode, container) — mount.
  3. patch(oldVNode, newVNode) — props, attributes, events, children.
  4. Keyed children diff. Implement a naive version, then the two-ended / longest-increasing- subsequence approach. Measure both on a shuffle.
  5. Components with lifecycle.
  6. The join: wrap each component's render in a fw-03 effect so reactive reads trigger re-render of that component only.
  7. Scheduler: dedupe and flush component updates on a microtask.

3. Failure Lab

  1. Naive keyed diff on a reversal — measure the DOM operation count against the smarter algorithm. Explain the algorithmic difference, not just the number.
  2. Component effect that reads a value conditionally — show the dependency set changing between renders, and what breaks without cleanup (fw-03).
  3. No scheduler: cause the same component to render three times in one tick.
  4. Event handler identity: re-creating handlers each render. Measure the cost of naive removal and re-addition versus a stable indirection.