Expand description
Widget tree diffing for efficient UI updates.
This module provides algorithms for comparing two widget trees and computing the minimal set of operations needed to transform one into the other.
§Algorithm
The diffing algorithm works in two phases:
- Matching: Match widgets between old and new trees by key or position
- Reconciliation: Generate operations for differences
Widgets are matched by:
- Explicit key (if set via
keyattribute) - Type + position (fallback)
Structs§
- Diff
Node - A node in the widget tree for diffing.
- Diff
Result - Result of diffing two widget trees.
- Tree
Differ - Widget tree differ.
Enums§
- DiffOp
- Operation to apply during reconciliation.
- Widget
Key - A key used to identify widgets across renders.
Functions§
- diff_
trees - Convenience function to diff two trees.