patchChildren applies the difference between two virtual-node child collections to their corresponding DOM content. It extracts children, computes an ordered diff, and processes additions, removals, moves, and unchanged positions. section 8.2.6
Implementation responsibilities:
- Extract children from both nodes, recursively flattening fragment children and using an empty array when children are absent. section 8.2.6
- Call arraysDiffSequence with areNodesEqual to identify operations transforming the old collection into the new one. section 8.2.6
Reordering a child
For a move operation, retrieve the old child and its DOM element, insert it before the target child node, then patch it against the new virtual child.
Figure 8.14 Patching the children of a node
Use the flow diagram to follow how child differences become mount, destroy, move, or recursive patch operations. section 8.2.6
