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
- VNode representation;
h(). render(vnode, container)— mount.patch(oldVNode, newVNode)— props, attributes, events, children.- Keyed children diff. Implement a naive version, then the two-ended / longest-increasing- subsequence approach. Measure both on a shuffle.
- Components with lifecycle.
- The join: wrap each component's render in a
fw-03effect so reactive reads trigger re-render of that component only. - Scheduler: dedupe and flush component updates on a microtask.
3. Failure Lab
- Naive keyed diff on a reversal — measure the DOM operation count against the smarter algorithm. Explain the algorithmic difference, not just the number.
- Component effect that reads a value conditionally — show the dependency set changing between
renders, and what breaks without cleanup (
fw-03). - No scheduler: cause the same component to render three times in one tick.
- Event handler identity: re-creating handlers each render. Measure the cost of naive removal and re-addition versus a stable indirection.