ci: Version Packages#1169
Merged
Merged
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 was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@tanstack/virtual-core@3.15.0
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 fix(virtual-core): remove incorrect elementsCache cleanup using getItemKey #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.
@tanstack/angular-virtual@5.0.1
Patch Changes
99355ad,99355ad,99355ad,99355ad,99355ad,99355ad,99355ad]:@tanstack/lit-virtual@3.13.26
Patch Changes
99355ad,99355ad,99355ad,99355ad,99355ad,99355ad,99355ad]:@tanstack/react-virtual@3.13.25
Patch Changes
useReducer(() => ({}), {})force-rerender pattern with an (#1168)incrementing number counter. Same semantics (every dispatch changes the
reducer state, forcing a render); zero per-dispatch object allocation.
Trivial individual cost, but eliminates one steady-state GC source on
scroll-heavy apps.
99355ad,99355ad,99355ad,99355ad,99355ad,99355ad,99355ad]:@tanstack/solid-virtual@3.13.25
Patch Changes
99355ad,99355ad,99355ad,99355ad,99355ad,99355ad,99355ad]:@tanstack/svelte-virtual@3.13.25
Patch Changes
99355ad,99355ad,99355ad,99355ad,99355ad,99355ad,99355ad]:@tanstack/vue-virtual@3.13.25
Patch Changes
99355ad,99355ad,99355ad,99355ad,99355ad,99355ad,99355ad]:@tanstack/virtual-benchmarks@0.0.1
Patch Changes
99355ad]: