fix(deps): update dependency @tanstack/virtual-core to ^3.17.1#28
Open
renovate-ce-paramount-engineering[bot] wants to merge 1 commit into
Open
fix(deps): update dependency @tanstack/virtual-core to ^3.17.1#28renovate-ce-paramount-engineering[bot] wants to merge 1 commit into
renovate-ce-paramount-engineering[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^3.14.0→^3.17.1Release Notes
TanStack/virtual (@tanstack/virtual-core)
v3.17.1Compare Source
Patch Changes
ef69ea3- Fix "items jump while scrolling up": the default scroll-adjustment predicate now compensates scrollTop on the first measurement of an above-viewport item even while scrolling backward (the estimate→actual delta must be absorbed), and only skips compensation for re-measurements during backward scroll to avoid the cascading jankv3.17.0Compare Source
Minor Changes
fbf3bdb- AdduseCachedMeasurementsoption to skip DOM measurement when the list is hidden (e.g.display: none). When enabled, the defaultmeasureElementreturns the cached size orestimateSizefallback instead of reading the DOM, preventing ResizeObserver from resetting measurements to zero.Patch Changes
c0b84c8- Skip synchronous DOM read (offsetWidth/offsetHeight) in default measureElement when a cached size already exists, reducing layout reflow on re-rendersv3.16.1Compare Source
Patch Changes
Eagerly adjust scrollOffset on prepend to prevent one-frame jump with anchorTo: 'end' (#1176)
When items are prepended with
anchorTo: 'end'and dynamic sizes, the virtualizer would compute the wrong visible range for one frame (using stale estimate-based positions) and then correct in the next frame via_willUpdate, producing a visible jump. This fix eagerly adjustsscrollOffsetinsetOptionsduring the render pass socalculateRange/getVirtualItemsreturn the correct items immediately.v3.16.0Compare Source
Minor Changes
Add end-anchored virtualization support for chat, logs, and reverse feeds. (#1173)
New
anchorTo: 'end'mode keeps the current visible item stable when older items are prepended, while preserving the existing start-anchored behavior by default. It also keeps an end-pinned viewport pinned when the last item grows during streaming output.Add
followOnAppendso new items scroll into view only when the viewport was already at the end, plusscrollEndThreshold,scrollToEnd(),getDistanceFromEnd(), andisAtEnd()helpers for chat-style integrations.v3.15.0Compare Source
Minor Changes
iOS Safari momentum-scroll handling. Writing
scrollTopwhile a finger (#1168)is on the screen, during momentum decay, or while the page is in the
elastic-overscroll bounce zone all cancel the in-flight scroll in iOS
WebKit. The virtualizer previously had no iOS-specific handling, which
manifested as the recurring "scroll abruptly stops when content above
resizes" complaints on Safari mobile.
Adds three layers of protection, default-on, all transparent to
consumers:
150 ms grace timer for the early-momentum phase. Scroll-position
adjustments triggered during any of these states accumulate into a
_iosDeferredAdjustmentfield instead of writingscrollTop.scrollTopwithin 1.5 px of a value we just wrote, the virtualizerprefers the intended value rather than treating the round-trip as a
user scroll.
when
scrollTopis outside[0, scrollHeight - clientHeight],preventing a snap-back jolt at end-of-bounce. The next in-bounds
scroll event retries.
Non-iOS code paths are unchanged. iOS detection is SSR-safe and cached
after first call. Bundle cost is ~370 B gzip in the consumer-minified
production build — kept default-on because iOS Safari is a large share
of mobile traffic for the apps that use virtualization heavily.
Skip the scroll-position adjustment while the user is scrolling backward (#1168)
by default. When an above-viewport item resizes during backward scroll
(images load, content reflows, etc.) the prior behavior wrote
scrollTopto keep the visible window stable — but on backward scroll that write
fights the user's direction and produces visible "items jump up while I
scroll up" jank. This was the largest single complaint cluster in the
issue tracker (multiple recurring threads spanning years; users had
independently rediscovered the same workaround at least five times).
Forward-scroll and idle (mount-time) adjustments still fire as before
to preserve visual stability of the visible window. Consumers who want
the old behavior — adjusting on every above-viewport resize regardless
of direction — can supply
shouldAdjustScrollPositionOnItemSizeChangewhich is checked before the default branch.
Add
takeSnapshot()instance method for scroll-restoration round-trips. (#1168)Returns the currently-measured items as plain
VirtualItemobjects;pair with the current
scrollOffsetto persist scroll position acrossremounts (route navigation, list-view modals, etc.). The result feeds
back through the existing
initialMeasurementsCacheoption:Closes the gap to virtua's
takeCacheSnapshot()and react-virtuoso'sgetState. Only items actually rendered (and thus measured) areincluded; unmeasured items fall back to
estimateSizeon restore.Mount-time, measurement, and memory rewrite for huge lists. The hot path (#1168)
through
getMeasurements()no longer allocates aVirtualItemobject perindex for single-lane lists; instead it fills a
Float64Arrayofstart/size pairs and materializes
VirtualItemobjects lazily through aProxy-backed view when consumers index into them. Internal hot paths(
calculateRange,getVirtualItemForOffset,getTotalSize,resizeItem)read directly from the typed-array storage to avoid the Proxy.
Also collapses a chain of smaller hotspots discovered in an audit pass:
the per-resize
Mapclone inresizeItem, theObject.entries+deletedeopt in
setOptions, theMath.min(...pendingMeasuredCacheIndexes)spread, the
defaultRangeExtractorpushgrowth pattern, the eagermeasurementsCachereference invalidation, and the leakedelementsCacheentries when a
ResizeObserverfires for a node React already replaced.Headline impact (measured against actual
Virtualizerinstances withvitest bench):
resizeItemstorm of 10,000 measurements + finalgetMeasurements:~1.9 s → ~1.3 ms (≈1382×) — this was the dominant
Map-clone bugsetOptions× 10,000 calls (React-render-storm proxy): ~14 ms → ~1.3 ms(11×)
The lanes>1 path keeps the previous eager allocation (lane assignment is
order-dependent and harder to defer cleanly); behavior is unchanged
there.
No public API change.
measurementsCacheis still anArray<VirtualItem>-shaped value supporting[i],.length, iteration,etc. Internal consumers that previously read fields off
VirtualItemobjects continue to do so transparently.
Patch Changes
scrollToIndex(N, { behavior: 'smooth' })on a dynamic-height list no (#1168)longer snaps to
behavior: 'auto'the moment a measurement shifts thecomputed target offset. While the scroll is still more than a viewport
away from the new target, smooth scroll continues with the updated
endpoint; only on the final approach do we fall back to 'auto' for
precise landing. The user-visible effect is one continuous smooth
motion that subtly adjusts its endpoint as measurements arrive,
instead of the prior animation-then-snap pattern.
Also: once
reconcileScrollreaches its stable-frames threshold, itwrites the exact target offset one final time. This is a no-op when
scrollTopalready equals the target (the common case) but correctsthe rare subpixel-rounding case where smooth scroll undershoots by
less than 1 px.
Don't call
getItemKeywith a possibly-stale index when cleaning up (#1168)elementsCachefor a disconnected node. The cleanup now finds thematching entry by node identity, so removing items from the end of
the list while a
ResizeObserverstill has the now-detached nodequeued no longer throws (regression of #1148).
Two correctness fixes in the new code: (#1168)
measure()now resetspendingMinso a priorresizeItem()that leftit non-null can't preserve stale
measurementsCacheentries before thatindex. The next rebuild is guaranteed to start at 0.
scrollAdjustments. Without this, a resize landing between the flushand the resulting scroll event would compute the next correction from
the stale pre-flush offset.
Configuration
📅 Schedule: (in timezone America/Los_Angeles)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate CE.