Repository navigation
1.2.0
- Fix issue preventing wrap detection when flex items have unequal heights
- Several performance optimizations:
-
Added debouncing: The ResizeObserver callback is now debounced with a 16ms delay (approximately matching a 60fps refresh rate), which reduces the frequency of calculations during resize operations.
-
Added dimension caching: The library now stores the previous dimensions of each flex container and skips recalculations if the dimensions haven't changed, which avoids unnecessary processing.
-
Reduced layout thrashing: Added rect caching to avoid multiple costly calls to getBoundingClientRect() for the same elements during a single calculation cycle.
-
Optimized DOM operations: Added the updateAttributeEfficiently helper function which only modifies attributes when necessary, reducing DOM updates and potential reflows.
-
Improved wrap-reverse detection: The algorithm for grouping items by their position now looks for nearest matches within a tolerance range, which is more efficient than the previous approach.
-
Batch calculations: Measurements are now batched together to minimize the number of reflows caused by reading layout properties.
-
Full Changelog: 1.1.0...1.2.0