Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions benchmarks/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @tanstack/virtual-benchmarks

## 0.0.4

### Patch Changes

- Updated dependencies []:
- @tanstack/react-virtual@3.14.1

## 0.0.3

### Patch Changes

- Updated dependencies [[`73e115d`](https://github.com/TanStack/virtual/commit/73e115d53faf01f073bc4a7bd71ee0139307f4a8)]:
- @tanstack/react-virtual@3.14.0

## 0.0.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tanstack/virtual-benchmarks",
"private": true,
"version": "0.0.2",
"version": "0.0.4",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/dynamic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
"@faker-js/faker": "^8.4.1",
"@tanstack/angular-virtual": "^5.0.2",
"@tanstack/angular-virtual": "^5.0.3",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/fixed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@angular/platform-browser": "^19.0.0",
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
"@tanstack/angular-virtual": "^5.0.2",
"@tanstack/angular-virtual": "^5.0.3",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/infinite-scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
"@tanstack/angular-query-experimental": "5.80.7",
"@tanstack/angular-virtual": "^5.0.2",
"@tanstack/angular-virtual": "^5.0.3",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/padding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@angular/platform-browser": "^19.0.0",
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
"@tanstack/angular-virtual": "^5.0.2",
"@tanstack/angular-virtual": "^5.0.3",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/smooth-scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@angular/platform-browser": "^19.0.0",
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
"@tanstack/angular-virtual": "^5.0.2",
"@tanstack/angular-virtual": "^5.0.3",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/sticky/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
"@faker-js/faker": "^8.4.1",
"@tanstack/angular-virtual": "^5.0.2",
"@tanstack/angular-virtual": "^5.0.3",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@angular/router": "^19.0.0",
"@faker-js/faker": "^8.4.1",
"@tanstack/angular-table": "8.21.3",
"@tanstack/angular-virtual": "^5.0.2",
"@tanstack/angular-virtual": "^5.0.3",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/variable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@angular/platform-browser": "^19.0.0",
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
"@tanstack/angular-virtual": "^5.0.2",
"@tanstack/angular-virtual": "^5.0.3",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/angular/window/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@angular/platform-browser": "^19.0.0",
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
"@tanstack/angular-virtual": "^5.0.2",
"@tanstack/angular-virtual": "^5.0.3",
"rxjs": "^7.8.2",
"tslib": "^2.8.1",
"zone.js": "0.15.1"
Expand Down
4 changes: 2 additions & 2 deletions examples/lit/dynamic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"dependencies": {
"@faker-js/faker": "^8.4.1",
"@tanstack/lit-virtual": "^3.13.27",
"@tanstack/virtual-core": "^3.16.0",
"@tanstack/lit-virtual": "^3.13.28",
"@tanstack/virtual-core": "^3.16.1",
"lit": "^3.3.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/lit/fixed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"dependencies": {
"@faker-js/faker": "^8.4.1",
"@tanstack/lit-virtual": "^3.13.27",
"@tanstack/virtual-core": "^3.16.0",
"@tanstack/lit-virtual": "^3.13.28",
"@tanstack/virtual-core": "^3.16.1",
"lit": "^3.3.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/react/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"serve": "vite preview"
},
"dependencies": {
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
9 changes: 6 additions & 3 deletions examples/react/chat/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ function App() {
count: messages.length,
getScrollElement: () => parentRef.current,
estimateSize: () => 74,
getItemKey: (index) => messages[index]!.id,
getItemKey: React.useCallback(
(index: number) => messages[index]!.id,
[messages],
),
anchorTo: 'end',
followOnAppend: true,
scrollEndThreshold: 80,
overscan: 6,
directDomUpdates: true,
})

const virtualItems = virtualizer.getVirtualItems()
Expand Down Expand Up @@ -180,8 +184,8 @@ function App() {
}}
>
<div
ref={virtualizer.containerRef}
style={{
height: virtualizer.getTotalSize(),
position: 'relative',
width: '100%',
}}
Expand All @@ -199,7 +203,6 @@ function App() {
position: 'absolute',
top: 0,
left: 0,
transform: `translateY(${virtualItem.start}px)`,
width: '100%',
}}
>
Expand Down
2 changes: 1 addition & 1 deletion examples/react/dynamic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@faker-js/faker": "^8.4.1",
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
48 changes: 21 additions & 27 deletions examples/react/dynamic/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ function RowVirtualizerDynamic() {
getScrollElement: () => parentRef.current,
estimateSize: () => 45,
enabled,
directDomUpdates: true,
})

React.useEffect(() => {
virtualizer.scrollToIndex(count - 1, { align: 'end' })
}, [])

const items = virtualizer.getVirtualItems()

return (
<div>
<button
Expand Down Expand Up @@ -78,37 +77,32 @@ function RowVirtualizerDynamic() {
}}
>
<div
ref={virtualizer.containerRef}
style={{
height: virtualizer.getTotalSize(),
width: '100%',
position: 'relative',
}}
>
<div
style={{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
transform: `translateY(${items[0]?.start ?? 0}px)`,
}}
>
{items.map((virtualRow) => (
<div
key={virtualRow.key}
data-index={virtualRow.index}
ref={virtualizer.measureElement}
className={
virtualRow.index % 2 ? 'ListItemOdd' : 'ListItemEven'
}
>
<div style={{ padding: '10px 0' }}>
<div>Row {virtualRow.index}</div>
<div>{sentences[virtualRow.index]}</div>
</div>
{virtualizer.getVirtualItems().map((v) => (
<div
key={v.key}
data-testid={`item-${v.index}`}
ref={virtualizer.measureElement}
className={v.index % 2 ? 'ListItemOdd' : 'ListItemEven'}
data-index={v.index}
style={{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
}}
>
<div style={{ padding: '10px 0' }}>
<div>Row {v.index}</div>
<div>{sentences[v.index]}</div>
</div>
))}
</div>
</div>
))}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion examples/react/fixed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"serve": "vite preview"
},
"dependencies": {
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/react/infinite-scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@tanstack/react-query": "^5.80.7",
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/react/padding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/react/pretext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@chenglou/pretext": "^0.0.7",
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/react/scroll-padding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@react-hookz/web": "^25.1.1",
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/react/smooth-scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/react/sticky/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@faker-js/faker": "^8.4.1",
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"lodash": "^4.17.21",
"react": "^18.3.1",
"react-dom": "^18.3.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/react/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@faker-js/faker": "^8.4.1",
"@tanstack/react-table": "^8.21.3",
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/react/variable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "vite"
},
"dependencies": {
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/react/window/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"serve": "vite preview"
},
"dependencies": {
"@tanstack/react-virtual": "^3.13.26",
"@tanstack/react-virtual": "^3.14.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/dynamic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@faker-js/faker": "^8.4.1",
"@tanstack/svelte-virtual": "^3.13.26"
"@tanstack/svelte-virtual": "^3.13.27"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.1.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/fixed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"dependencies": {
"@tanstack/svelte-virtual": "^3.13.26"
"@tanstack/svelte-virtual": "^3.13.27"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.1.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/infinite-scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@tanstack/svelte-query": "^5.80.7",
"@tanstack/svelte-virtual": "^3.13.26"
"@tanstack/svelte-virtual": "^3.13.27"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.1.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/smooth-scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@faker-js/faker": "^8.4.1",
"@tanstack/svelte-virtual": "^3.13.26"
"@tanstack/svelte-virtual": "^3.13.27"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.1.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/sticky/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@faker-js/faker": "^8.4.1",
"@tanstack/svelte-virtual": "^3.13.26",
"@tanstack/svelte-virtual": "^3.13.27",
"lodash": "^4.17.21"
},
"devDependencies": {
Expand Down
Loading
Loading