perf(virtual-core): skip sync DOM reads during normal scrolling#1144
perf(virtual-core): skip sync DOM reads during normal scrolling#1144piecyk merged 1 commit intoTanStack:mainfrom
Conversation
|
|
View your CI Pipeline Execution ↗ for commit a1f20f5
☁️ Nx Cloud last updated this comment at |
dedc5bb to
10db36b
Compare
10db36b to
a1f20f5
Compare
|
@piecyk I just noticed an error in 3.13.22 that I think is related to this change: This is coming from the The I don't have a lot of context but this kind of seems related to #1135 too? I can try to figure out a repro and file an issue, but just wanted to flag quickly in case the problem is super obvious to you. |
🎯 Changes
Inline _measureElement into measureElement and RO callback to simplify the measurement flow. During normal user scrolling, the ref callback (measureElement) now only registers the element with the ResizeObserver, the actual measurement is deferred to the async RO callback, avoiding layout thrashing from forced reflows.
Sync measurement in measureElement is gated behind scrollState, so it only runs during programmatic scrolling (scrollToIndex/scrollToOffset) where reconcileScroll needs sizes in the same frame to converge correctly.
✅ Checklist
pnpm run test:pr.🚀 Release Impact