chore(angular-virtual): proper angular 19 #1158
main fromrefs/pull/1158/head·merged by piecyk 🎯 Changes#
- Upgrades the adapter to Angular +19. Angular 19 is the latest angular version with LTS.
- Updates the implementation to use computed and linked signals instead of the lazy signal approach. This will make it possible to alias fields of the returned value, like
items = this.rowVirtualizer.getVirtualItems. - Use vite as a bundler for angular since the package does not need any Angular compilation.
About #1096 and #1109, I couldn't replicate the issue with the latest version of virtual. With this upgrade to Angular 19, no effect could trigger directly set a value to a signal.
Pending:
- Confirmation that is ok to state that for Angular the adapter would only target LTS version and up, like query https://github.com/TanStack/query/issues/8707
- Aligning some of the following, like TS versions since Angular examples need a newer one.
- I did not manage to add unit tests due to tolling version alignment issues.
✅ Checklist#
- I have followed the steps in the Contributing guide.
- I have tested this code locally with
pnpm run test:pr.
🚀 Release Impact#
- This change affects published code, and I have generated a changeset.
- This change is docs/CI/dev-only (no release).
Summary by CodeRabbit#
New Features
- Official Angular 19 support and signal-backed virtualizer state (including measurements cache, total size, virtual items, and scroll state).
Documentation
- Docs and README updated to require Angular 19+ and list available signal-backed virtualizer properties.
Chores
- Example projects and tooling bumped (Angular →19, TypeScript →5.6.3, Vite →6.4.2); package outputs moved to a dist/Vite layout; new e2e app and test config added.
Tests
- New Playwright E2E suites covering scrolling, smooth scroll, measurements, and stale-index scenarios.
- 1
View your CI Pipeline Execution ↗ for commit 82d7e83d1c4ff7440252864618a6070cfdd17b2d
Command Status Duration Result nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded 1m 14s View ↗ nx run-many --target=build --exclude=examples/**✅ Succeeded 17s View ↗
☁️ Nx Cloud last updated this comment at
2026-04-26 10:53:41UTCPull request overview#
Note
Copilot was unable to run its full agentic suite in this review.
Upgrades the
@tanstack/angular-virtualadapter to Angular 19, refactors the adapter to expose state via computed/linked signals (instead of lazy signal init), and switches packaging/build to Vite rather thanng-packagr.Changes:
- Update adapter implementation to use
linkedSignal/computedwith a new genericsignalProxyproxy layer. - Replace ng-packagr build output with Vite-based
distoutput + updatedpackage.jsonexports. - Bump Angular (adapter + examples) to
^19.0.0and update docs to reflect Angular 19+ support.
Reviewed changes#
Copilot reviewed 20 out of 21 changed files in this pull request and generated 6 comments.
Show a summary per file
File Description packages/angular-virtual/vite.config.ts Adds Vite/Vitest config merged with shared TanStack Vite config. packages/angular-virtual/tsconfig.json Simplifies TS config and includes vite.config.ts.packages/angular-virtual/tsconfig.build.json Removes ng-packagr build TS config. packages/angular-virtual/src/types.ts Extends AngularVirtualizersurface area (adds callable signature +measurementsCachesignal).packages/angular-virtual/src/proxy.ts Replaces proxyVirtualizerwith genericsignalProxyimplementation.packages/angular-virtual/src/index.ts Refactors virtualizer creation lifecycle to linked/computed signals + new proxy. packages/angular-virtual/package.json Switches outputs/exports to dist(CJS+ESM), updates scripts, bumps Angular/TS versions.packages/angular-virtual/ng-package.json Removes ng-packagr packaging config. packages/angular-virtual/README.md Updates stated minimum Angular version to 19. examples/angular/*/package.json Bumps Angular/TS versions across Angular examples to 19/5.6. docs/framework/angular/angular-virtual.md Documents Angular 19+/LTS intent and signal-exposed adapter state. .changeset/gold-days-greet.md Adds changeset for adapter release.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/angular-virtual/package.json line 40Outdated@@ -26,12 +27,14 @@2627 ".": {27- "types": "./build/index.d.ts",28- "esm2022": "./build/esm2022/tanstack-angular-virtual.mjs",29- "esm": "./build/esm2022/tanstack-angular-virtual.mjs",30- "default": "./build/fesm2022/tanstack-angular-virtual.mjs"28+ "import": {29+ "types": "./dist/esm/index.d.ts",30+ "default": "./dist/esm/index.js"31+ },32+ "require": {33+ "types": "./dist/cjs/index.d.cts",34+ "default": "./dist/cjs/index.cjs"35+ }3136 },32- "./package.json": {33- "default": "./package.json"34- }37+ "./package.json": "./package.json"3538 },3639 "engines": {3740 "node": ">=12""engines.node" is still set to ">=12", but this package now builds with Vite ("build": "vite build"). Vite’s supported Node versions are much newer than 12, so consumers/contributors on Node 12–17 will hit build/install failures. Please bump the Node engine range to match the Vite version used in the repo (and any workspace-wide engines policy).
"node": ">=18"packages/angular-virtual/src/index.ts lines 54 to 56Outdated@@ -58,17 +51,6 @@58- { allowSignalWrites: true },51+ { equal: () => false },5952 )605361- const scrollElement = computed(() => options().getScrollElement())62- // let the virtualizer know when the scroll element is changed63- effect(64- () => {65- const el = scrollElement()66- if (el) {67- untracked(virtualizerSignal)._willUpdate()68- }69- },70- { allowSignalWrites: true },71- )72-73- let cleanup: () => void | undefined74- afterNextRender({ read: () => (virtualizer ?? lazyInit())._didMount() })54+ afterRenderEffect((cleanup) => {55+ cleanup(lazyVirtualizer()._didMount())56+ })"_didMount()" is typically a one-time mount hook that registers observers/listeners and returns a teardown. Calling it inside "afterRenderEffect" risks re-mounting on every render cycle (and relying on cleanup between renders), which can cause listener churn and subtle behavior differences vs the previous "afterNextRender" one-shot mount. Consider ensuring "_didMount()" is invoked exactly once per instance (one-time post-render hook or a guard), while still registering teardown on destroy.
lazyVirtualizer()does not change, so it runs once.packages/angular-virtual/src/index.ts line 59Outdated@@ -61,16 +54,6 @@61- const scrollElement = computed(() => options().getScrollElement())62- // let the virtualizer know when the scroll element is changed63- effect(64- () => {65- const el = scrollElement()66- if (el) {67- untracked(virtualizerSignal)._willUpdate()68- }69- },70- { allowSignalWrites: true },71- )72-73- let cleanup: () => void | undefined74- afterNextRender({ read: () => (virtualizer ?? lazyInit())._didMount() })54+ afterRenderEffect((cleanup) => {55+ cleanup(lazyVirtualizer()._didMount())56+ })755776- inject(DestroyRef).onDestroy(() => cleanup?.())58+ afterRenderEffect(() => {59+ reactiveVirtualizer()._willUpdate()Calling "_willUpdate()" after every render can be significantly more frequent than the prior behavior (which only invoked it when the scroll element changed). If "_willUpdate()" performs DOM reads/writes or sets up observers, this can become a hot path. Consider narrowing the trigger (e.g., react only to scroll element changes / option changes that matter) or otherwise avoid invoking on renders that don’t affect the virtualizer.
const virtualizer = reactiveVirtualizer() const nextScrollElement = resolvedOptions().getScrollElement() if (virtualizer.scrollElement !== nextScrollElement) { virtualizer._willUpdate() }The change looks more aligned with react, where
_willUpdatewill be called on every re-render.@@ -33,14 +37,15 @@33- "default": "./package.json"34- }37+ "./package.json": "./package.json"3538 },3639 "engines": {3740 "node": ">=12"3841 },3942 "files": [40- "build"43+ "dist",44+ "src"4145 ],4246 "scripts": {43- "clean": "premove ./build",44- "test:types": "tsc --noEmit",47+ "clean": "premove ./dist ./build ./coverage",4548 "test:eslint": "eslint ./src",46- "build": "ng-packagr -p ng-package.json -c tsconfig.build.json"49+ "test:build": "publint --strict",50+ "test:types": "tsc",51+ "build": "vite build""test:types" now runs plain "tsc" (without "--noEmit"). That will write outputs during tests, which can pollute working trees/CI artifacts and can be surprising for a test command. It also doesn’t guarantee declarations end up in the exported "dist/..." paths (and Vite doesn’t emit .d.ts). Recommend switching "test:types" back to a no-emit check, and adding a dedicated types build step (or a Vite d.ts generation approach) that explicitly writes declaration files to the locations referenced by "types"/"exports".
"test:types": "tsc --noEmit", "build:types": "tsc --emitDeclarationOnly --declaration --outDir dist/esm && node -e \"const fs=require('fs'); fs.mkdirSync('dist/cjs',{recursive:true}); fs.copyFileSync('dist/esm/index.d.ts','dist/cjs/index.d.cts');\"", "build": "npm run build:types && vite build"@@ -62,14 +78,10 @@62- 'getOffsetForIndex',63- 'getVirtualItemForOffset',64- 'indexFromElement',65- ].includes(property)78+ attributesToTransformToSignals.includes(79+ property as TAttributesToTransformToSignals,80+ )6681 ) {67- const fn = virtualizer[property as keyof V] as Function68- Object.defineProperty(untypedTarget, property, {69- value: toComputed(virtualizerSignal, fn),70- configurable: true,71- enumerable: true,72- })82+ return (target[property] = computed(83+ () => inputSignal()[property as keyof TInput],84+ ))7385 }748675- return untypedTarget[property] || virtualizer[property as keyof V]87+ // All other fiels. Any field that is not handled above will fail if the signal includesTypo in comment: replace "fiels" with "fields".
// All other fields. Any field that is not handled above will fail if the signal includes@@ -63,13 +78,11 @@63- 'getVirtualItemForOffset',64- 'indexFromElement',65- ].includes(property)78+ attributesToTransformToSignals.includes(79+ property as TAttributesToTransformToSignals,80+ )6681 ) {67- const fn = virtualizer[property as keyof V] as Function68- Object.defineProperty(untypedTarget, property, {69- value: toComputed(virtualizerSignal, fn),70- configurable: true,71- enumerable: true,72- })82+ return (target[property] = computed(83+ () => inputSignal()[property as keyof TInput],84+ ))7385 }748675- return untypedTarget[property] || virtualizer[property as keyof V]87+ // All other fiels. Any field that is not handled above will fail if the signal includes88+ // a input or model from a component and this is accessed before initialization.Grammar in comment: replace "a input" with "an input".
// an input or model from a component and this is accessed before initialization.- Update adapter implementation to use
@benjavicente awesome work! I’ll play around with it a bit. Could we add a simple e2e test here, similar to what we have in react-virtual, to cover the basic flow?
benjavicente(GitHub profile, opens in a new tab)replied on
packages/angular-virtual/src/index.tsline 59The change looks more aligned with react, where
_willUpdatewill be called on every re-render.benjavicente(GitHub profile, opens in a new tab)replied on
packages/angular-virtual/src/index.tslines 54 to 56lazyVirtualizer()does not change, so it runs once.All green now 🚀 I had to bump vite and typescript for type checks and sherif to to pass.
Actionable comments posted: 13
🧹 Nitpick comments (10)
packages/virtual-core/tests/index.test.ts (1)
340-353: Consider extracting a sharedcreateMockResizeObserver()helper.Lines 340-346 duplicate the same mock factory from Lines 170-176. Pulling this into one local helper would reduce drift risk across tests.
♻️ Suggested refactor
+function createMockResizeObserver() { + return vi.fn(function () { + return { + observe: vi.fn(), + unobserve: vi.fn(), + disconnect: vi.fn(), + } + }) +} + test('should not throw when component unmounts during scrollToIndex rAF loop', () => { - const MockResizeObserver = vi.fn(function () { - return { - observe: vi.fn(), - unobserve: vi.fn(), - disconnect: vi.fn(), - } - }) + const MockResizeObserver = createMockResizeObserver() const mockWindow = { requestAnimationFrame: mockRaf, cancelAnimationFrame: vi.fn(), ResizeObserver: MockResizeObserver, } @@ function createMockEnvironment() { @@ - const MockResizeObserver = vi.fn(function () { - return { - observe: vi.fn(), - unobserve: vi.fn(), - disconnect: vi.fn(), - } - }) + const MockResizeObserver = createMockResizeObserver()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/virtual-core/tests/index.test.ts` around lines 340 - 353, The test suite defines the same ResizeObserver mock factory twice (MockResizeObserver) — extract a shared helper named createMockResizeObserver() that returns the vi.fn factory producing { observe, unobserve, disconnect } mocks, replace both MockResizeObserver occurrences with calls to createMockResizeObserver() and assign its result to mockWindow.ResizeObserver and the earlier test’s equivalent; this ensures both tests reuse the same factory function (refer to MockResizeObserver and mockWindow.ResizeObserver to locate the spots to replace).packages/angular-virtual/e2e/app/test/measure-element.spec.ts (1)
29-41: Poll the actual layout condition instead of sleeping.waitForTimeout(200)may not reliably cover ResizeObserver/layout timing on loaded CI. Polling the non-overlap assertion makes the test wait only as long as needed.♻️ Proposed refactor
- // Wait for ResizeObserver to measure the expanded B - await page.waitForTimeout(200) - - // C should be positioned after the expanded B, not overlapping it - const bBox = await page.locator('[data-testid="item-b"]').boundingBox() - const cBox = await page.locator('[data-testid="item-c"]').boundingBox() - - expect(bBox).not.toBeNull() - expect(cBox).not.toBeNull() - - // C's top should be at or after B's bottom (with no overlap) - const bBottom = bBox!.y + bBox!.height - expect(cBox!.y).toBeGreaterThanOrEqual(bBottom - 1) // 1px tolerance + // C should be positioned after the expanded B, not overlapping it + await expect + .poll(async () => { + const bBox = await page.locator('[data-testid="item-b"]').boundingBox() + const cBox = await page.locator('[data-testid="item-c"]').boundingBox() + + if (!bBox || !cBox) { + return false + } + + return cBox.y >= bBox.y + bBox.height - 1 // 1px tolerance + }) + .toBe(true)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/test/measure-element.spec.ts` around lines 29 - 41, Replace the brittle fixed sleep (page.waitForTimeout(200)) with a poll that retries the layout assertion until it's true or a timeout elapses: use page.waitForFunction (or a small loop) to repeatedly query the locators via page.locator('[data-testid="item-b"]').boundingBox() and page.locator('[data-testid="item-c"]').boundingBox() and assert that cBox.y >= (bBox.y + bBox.height) - 1 (preserve the 1px tolerance); ensure you still null-check bounding boxes and fail the test if the waitForFunction times out so CI will report the layout regression.packages/angular-virtual/e2e/app/test/stale-index.spec.ts (1)
13-37: Replace fixed sleeps with a deterministic observer/layout flush.waitForTimeout(100/200)can be either too short on loaded CI or unnecessarily slow locally. Prefer waiting on a concrete browser condition, e.g. a doublerequestAnimationFrameflush after scrolling/removal, then assert the error element is absent.♻️ Proposed direction
+const flushLayout = async () => { + await page.evaluate( + () => + new Promise<void>((resolve) => { + requestAnimationFrame(() => { + requestAnimationFrame(() => resolve()) + }) + }), + ) +} + // Scroll to the bottom so the last items are rendered and observed by ResizeObserver const container = page.locator('[data-testid="scroll-container"]') await container.evaluate((el) => (el.scrollTop = el.scrollHeight)) -await page.waitForTimeout(100) +await flushLayout() // Remove 5 items from the end — the RO may still fire for the now-disconnected nodes await page.click('[data-testid="remove-items"]') await expect(page.locator('[data-testid="item-count"]')).toHaveText( 'Count: 15', ) // Wait for any pending ResizeObserver callbacks -await page.waitForTimeout(200) +await flushLayout() // No error should have been thrown await expect(page.locator('[data-testid="error"]')).not.toBeVisible() // Remove 5 more to stress it await page.click('[data-testid="remove-items"]') await expect(page.locator('[data-testid="item-count"]')).toHaveText( 'Count: 10', ) -await page.waitForTimeout(200) +await flushLayout()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/test/stale-index.spec.ts` around lines 13 - 37, Replace the non-deterministic waits (await page.waitForTimeout(100) and 200) with a deterministic layout/paint flush using a double requestAnimationFrame promise after operations that change layout (the scrollTop set on container and after clicking '[data-testid="remove-items"]'). Specifically, after manipulating the DOM in the test (the container.evaluate(...) call and the await page.click('[data-testid="remove-items"]') calls) insert a browser-side double RAF flush (via page.evaluate(() => new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r))))) and/or use a page.waitForFunction that checks the state of the '[data-testid="item-count"]' or absence of '[data-testid="error"]' before asserting; replace references to waitForTimeout with that deterministic flush around the item-count and error assertions.packages/angular-virtual/e2e/app/src/app/scroll.component.ts (1)
11-25: Make E2E row heights deterministic.Math.random()makes the virtual layout differ across test runs, which makes alignment failures harder to reproduce. A key-based pseudo-random height keeps varied row sizes without nondeterminism.♻️ Proposed deterministic height helper
-function getRandomInt(min: number, max: number) { - return Math.floor(Math.random() * (max - min + 1)) + min -} - -const randomHeightForKey = (() => { - const cache = new Map<string, number>() - return (id: string) => { - const value = cache.get(id) - if (value !== undefined) { - return value - } - const v = getRandomInt(25, 100) - cache.set(id, v) - return v - } -})() +const randomHeightForKey = (id: string) => { + let hash = 0 + for (let i = 0; i < id.length; i++) { + hash = (hash * 31 + id.charCodeAt(i)) | 0 + } + return 25 + (Math.abs(hash) % 76) +}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/scroll.component.ts` around lines 11 - 25, The current randomHeightForKey uses Math.random via getRandomInt which produces non-deterministic row heights; replace the randomness with a key-based pseudo-random generator so heights are stable across runs: inside randomHeightForKey (and remove reliance on getRandomInt/Math.random for this path) compute a deterministic numeric seed from the id (e.g., a simple string hash of id), map that seed into the desired range [25,100] to produce v, store v in the existing cache Map<string, number>, and return it; keep the cache logic unchanged so repeated calls return the same value for the same key.packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts (1)
11-25: Make the smooth-scroll fixture reproducible.The current cached
Math.random()heights change between runs. Use a deterministic key-based height so smooth-scroll failures can be reproduced with the same layout.♻️ Proposed deterministic height helper
-function getRandomInt(min: number, max: number) { - return Math.floor(Math.random() * (max - min + 1)) + min -} - -const randomHeightForKey = (() => { - const cache = new Map<string, number>() - return (id: string) => { - const value = cache.get(id) - if (value !== undefined) { - return value - } - const v = getRandomInt(25, 100) - cache.set(id, v) - return v - } -})() +const randomHeightForKey = (id: string) => { + let hash = 0 + for (let i = 0; i < id.length; i++) { + hash = (hash * 31 + id.charCodeAt(i)) | 0 + } + return 25 + (Math.abs(hash) % 76) +}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts` around lines 11 - 25, The current randomHeightForKey uses Math.random so heights vary between runs; replace the randomness with a deterministic function that maps the id string to a stable integer in the 25–100 range. Modify the randomHeightForKey closure (and keep the cache Map) to compute a simple string hash from the id (e.g., accumulate char codes with multipliers) and then normalize that hash into the desired range instead of calling getRandomInt/Math.random; store and return the computed value from the existing cache so repeated calls still return the same height for the same id.packages/angular-virtual/e2e/app/test/scroll.spec.ts (1)
25-124: Replace fixed sleeps with condition-based polling for test determinism.The six
waitForTimeout()calls (lines 26, 39, 60, 80, 120, 124) introduce flakiness—too long on local machines, too short on CI. Useexpect.poll()to wait for actual scroll/layout conditions, or rely on locator assertions:♻️ Example pattern
- // Wait for scroll effect (including retries) - await page.waitForTimeout(1000) - await expect(page.locator('[data-testid="item-1000"]')).toBeVisible() - const delta = await page.evaluate(check) // Angular layout/scroll alignment needs a slightly higher tolerance than React. - expect(delta).toBeLessThan(4.5) + await expect.poll(() => page.evaluate(check), { + timeout: 5000, + }).toBeLessThan(4.5)Apply this pattern to all six instances for reliable test execution across environments.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/test/scroll.spec.ts` around lines 25 - 124, Replace the fixed waits (await page.waitForTimeout(...)) with condition-based polling/assertions: for tests that wait for an item to appear use await expect(page.locator('[data-testid="item-1000"]')).toBeVisible() / '[data-testid="item-1001"]' instead of sleep; for "scrolls to last item" poll the container scroll position (query '#scroll-container' and assert Math.abs(scrollTop + clientHeight - scrollHeight) < 1.01) using expect.poll or a locator assertion; for initialOffset replace the 500ms sleep by polling until the minimum [data-index] in '#scroll-container' is > 0, and after performing the user scroll poll until container.scrollTop has decreased by ~2000; for layout checks poll until layout.items.length > 3 and layout.maxGap < 2; for the final "scrolls to index 0" replace the two 1s sleeps with polling for visibility of '[data-testid="item-1000"]' after first click and then for '[data-testid="item-0"]' (or container scrollTop≈0) after the second click. Use the existing selectors ('#scroll-container', '[data-index]', '[data-testid="item-*"]') and helper checks inside expect.poll to determine readiness instead of fixed timeouts.packages/angular-virtual/e2e/app/test/smooth-scroll.spec.ts (1)
7-139: Prefer condition-based waits over fixed sleeps.The repeated
waitForTimeout(2000)calls throughout this file (lines 8, 32, 42, 47, 62, 87, 113, 118, 123, and 139) make the suite unnecessarily slow and can still be flaky on busy CI if the animation takes longer than expected. Replace these with locator auto-waiting andexpect.poll()to wait for actual settled conditions instead.♻️ Example pattern
- await page.waitForTimeout(2000) - - await expect(page.locator('[data-testid="item-1000"]')).toBeVisible() - - const delta = await page.evaluate(() => { + await expect(page.locator('[data-testid="item-1000"]')).toBeVisible({ + timeout: 5000, + }) + + await expect.poll(() => page.evaluate(() => { const item = document.querySelector('[data-testid="item-1000"]') const container = document.querySelector('#scroll-container') if (!item || !container) throw new Error('Elements not found') @@ - return Math.abs(bottom - containerBottom) - }) - expect(delta).toBeLessThan(1.01) + return Math.abs(bottom - containerBottom) + }), { timeout: 5000 }).toBeLessThan(1.01)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/test/smooth-scroll.spec.ts` around lines 7 - 139, The tests use many fixed page.waitForTimeout(2000) sleeps (e.g., around interactions with '#scroll-to-1000', '#scroll-to-500', '#scroll-to-100', '#scroll-to-0', '#scroll-to-500-start', '#scroll-to-500-center') which slows and flakes CI; replace each sleep with condition-based waits such as awaiting the locator to be visible (await expect(page.locator('[data-testid="item-1000"]')).toBeVisible()) or using expect.poll()/locator.waitFor() to wait until the scroll container ('#scroll-container') has the expected scrollTop or the item geometry (computed via page.evaluate) is within tolerance, and for interrupt tests poll until the final target is visible/settled instead of arbitrary timeouts so each test waits for the actual condition rather than a fixed delay.packages/angular-virtual/src/index.ts (3)
82-82:computedused as a memoized lazy singleton.lazyVirtualizerhas no tracked dependencies (the options read is wrapped inuntracked), so this is effectivelynew Virtualizer(...)memoized once. Usingcomputedfor a side‑effectful constructor is unconventional and makes the intent harder to read — a plain lazily‑initializedlet virtualizer: Virtualizer | undefined(or a one‑shot factory) would express the same thing without participating in the reactive graph. Optional clean‑up; current behavior is correct.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/index.ts` at line 82, The computed wrapper around the side‑effectful constructor (const lazyVirtualizer = computed(() => new Virtualizer(untracked(resolvedOptions)))) should be replaced with an explicit lazy initialization to avoid participating in the reactive graph; introduce a module/local variable like let virtualizer: Virtualizer | undefined and replace uses of lazyVirtualizer.value with a one‑shot factory/getter that does if (!virtualizer) virtualizer = new Virtualizer(untracked(resolvedOptions)), returning virtualizer; optionally wire any cleanup logic to Virtualizer disposal where appropriate. Ensure you reference Virtualizer, resolvedOptions, untracked and remove the computed import/usages for lazyVirtualizer.
186-195: SSR guards checktypeof documentbut accesswindow.Lines 188 and 192‑193 gate on
typeof document !== 'undefined'yet the branch they protect useswindow/window.scrollY. In the common SSR case both are undefined together so this works in practice, but the asymmetry is misleading and fails in environments that polyfill one but not the other (some test runners, edge runtimes). Recommend checking the symbol you actually read.♻️ Proposed diff
return injectVirtualizerBase<Window, TItemElement>(() => ({ - getScrollElement: () => (typeof document !== 'undefined' ? window : null), + getScrollElement: () => (typeof window !== 'undefined' ? window : null), observeElementRect: observeWindowRect, observeElementOffset: observeWindowOffset, scrollToFn: windowScroll, initialOffset: () => - typeof document !== 'undefined' ? window.scrollY : 0, + typeof window !== 'undefined' ? window.scrollY : 0, ...options(), }))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/index.ts` around lines 186 - 195, The SSR guards currently check typeof document but then read window (in getScrollElement and initialOffset), which is misleading and can break in runtimes that polyfill one but not the other; update the guards to check typeof window !== 'undefined' where you actually access window (change the checks used in the AngularVirtualizer factory for getScrollElement and initialOffset), and ensure you still return null/0 when window is unavailable so observeElementRect/observeElementOffset/scrollToFn logic remains safe.
99-139: Double cast bypasses validation of array coverage againstAngularVirtualizer.The four explicit string arrays passed to
signalProxyat the call site are not type-checked against theAngularVirtualizertype definition. The union of these arrays must cover every property that's omitted from the baseVirtualizerand given a signal wrapper inAngularVirtualizer(includinggetTotalSize,getVirtualItems,isScrolling,measurementsCache,options,range,scrollDirection,scrollElement,scrollOffset,scrollRect). Since the call is cast asunknown as AngularVirtualizer<...>, TypeScript provides no compile-time assertion. If a new signal-wrapped property is added toAngularVirtualizerwithout updating these arrays, the code will compile silently while consumers receive an unwrapped value at runtime.Consider adding a
satisfiescheck or exhaustiveness assertion at the call site to validate that the union of array keys matches the set of properties added back to theOmit<Virtualizer, ...>type.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/index.ts` around lines 99 - 139, The call to signalProxy is double-cast to AngularVirtualizer and the four string-array lists (methods pass-through, attributes-to-signals, tracked methods, zero-arg computed) are not type-checked against the AngularVirtualizer/Virtualizer shape, so new signal-wrapped properties can be missed at compile time; update the call site to assert exhaustiveness by replacing the unknown cast with a TypeScript-checked construct (e.g., use a typed helper or the satisfies operator) that verifies the union of the arrays equals the set of signal-wrapped keys on AngularVirtualizer<TScrollElement, TItemElement>, referencing signalProxy, AngularVirtualizer, and the specific property names (e.g., getTotalSize, getVirtualItems, isScrolling, measurementsCache, options, range, scrollDirection, scrollElement, scrollOffset, scrollRect) so the compiler will error if any property is omitted or changed.🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed. Inline comments: In `@examples/svelte/dynamic/package.json`: - Line 22: The package.json currently sets "vite": "^6.4.2" which is incompatible with the pinned "@sveltejs/vite-plugin-svelte@^3.1.2" that requires Vite ^5; fix by making the two dependencies compatible: either downgrade the Vite entry in package.json to a Vite 5.x range (e.g. ^5.0.0) so it satisfies "@sveltejs/vite-plugin-svelte@^3.1.2", or upgrade "@sveltejs/vite-plugin-svelte" to a release that explicitly supports Vite 6 and adjust the plugin version string accordingly; find and update the "vite" and "@sveltejs/vite-plugin-svelte" dependency entries in package.json to match one of these compatible pairs. In `@examples/svelte/smooth-scroll/package.json`: - Around line 21-22: The package.json shows an incompatible dependency set: "@sveltejs/vite-plugin-svelte@^3.1.2" requires Vite ^5.x but "vite": "^6.4.2" was added; fix by aligning versions—either upgrade the Svelte Vite plugin to a release that lists Vite 6 as a peer (replace "@sveltejs/vite-plugin-svelte" version accordingly) or downgrade "vite" to a 5.x version that satisfies the plugin's peer dependency; update the package.json dependency entries for "vite" or "@sveltejs/vite-plugin-svelte" and run install to verify peer compatibility. In `@packages/angular-virtual/e2e/app/angular.json`: - Line 2: The "$schema" path in e2e/app/angular.json is incorrect (uses "../../../node_modules/...") and points to packages/node_modules; update the schema string to traverse four levels up (use "../../../../node_modules/@angular/cli/lib/config/schema.json") so it resolves to the repository root node_modules; locate the "$schema" property in that file and replace the relative path accordingly. In `@packages/angular-virtual/e2e/app/src/app/app.config.ts`: - Line 1: The import of ApplicationConfig should be a type-only import to satisfy `@typescript-eslint/consistent-type-imports`: replace the current value import for ApplicationConfig with a type import by changing the import statement that references ApplicationConfig to use "import type { ApplicationConfig } from '@angular/core'"; locate the existing import of ApplicationConfig (symbol: ApplicationConfig) and update it to a type import to ensure it's treated as a purely type-only import by the compiler/linter. In `@packages/angular-virtual/e2e/app/src/app/app.routes.ts`: - Line 1: The import of Routes should be a type-only import; replace the value import "import { Routes } from '@angular/router'" with a type-only import for the Routes type (e.g., use "import type { Routes } from '@angular/router'") so the compiler/ESLint knows Routes is used only as a type. In `@packages/angular-virtual/e2e/app/src/app/measure-element.component.ts`: - Around line 1-9: ElementRef is only used as a type and the private field `#measureItems` is assigned but never read; change the import of ElementRef to a type-only import, remove the unused private field `#measureItems`, and move the afterRenderEffect registration out of the class field initializer into the component's constructor so the effect still runs — update any type annotations referencing ElementRef accordingly and keep the afterRenderEffect callback logic intact in the constructor. In `@packages/angular-virtual/e2e/app/src/app/scroll.component.ts`: - Around line 1-8: ElementRef is only used as a type and the private field `#measureItems` is unused; update the import to import ElementRef as a type (e.g., import type { ElementRef } from '@angular/core') and remove the unused private class field `#measureItems` to satisfy no-unused-private-class-members; to preserve behavior, move the afterRenderEffect call currently defined outside the constructor into the class constructor (keeping the same callback and references to viewChild/viewChildren) so the render effect runs as before without leaving an unused private member. In `@packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts`: - Around line 1-8: ElementRef is only used as a type parameter for viewChild and viewChildren and afterRenderEffect is called but its returned disposable is stored in the unused private field `#measureItems`; change the import of ElementRef to a type-only import, remove the unused private field `#measureItems`, and invoke afterRenderEffect directly in the component constructor without assigning its return value (keep the call to afterRenderEffect(...) as before). Ensure the viewChild and viewChildren usages still reference ElementRef as a type parameter and that no other code relies on the removed `#measureItems` field. In `@packages/angular-virtual/e2e/app/src/app/stale-index.component.ts`: - Around line 1-9: ElementRef is only used as a type and the private field `#measureItems` is unused; update the import to import ElementRef as a type-only import and remove the private `#measureItems` field, then call afterRenderEffect inside the component constructor without assigning its return value to any property (i.e., invoke afterRenderEffect(...) in the constructor), keeping references to the functions/classes like afterRenderEffect, ElementRef, and the component constructor to locate the changes. In `@packages/angular-virtual/package.json`: - Around line 39-52: The package.json currently sets "engines.node" to ">=12", which is too low for Angular 19 + Vite; update the "engines" entry in packages/angular-virtual package.json so the "node" constraint is bumped to a Vite-compatible minimum (e.g., ">=20.19.0") to match toolchain requirements, and ensure any related CI configs or documentation that reference Node version are aligned with the new constraint; locate the "engines" object and change the "node" value accordingly. In `@packages/angular-virtual/README.md`: - Line 7: Update the README note that currently reads "NOTE: Angular Virtual requires Angular 19." to explicitly state the supported floor as "Angular 19+" so it matches the package peer range (>=19) and the project’s LTS-and-up policy; locate the note string in the README (the line beginning with "NOTE: Angular Virtual requires") and change the trailing text from "Angular 19." to "Angular 19+". In `@packages/angular-virtual/src/index.ts`: - Around line 95-97: Add a short explanatory comment at the afterRenderEffect that reads reactiveVirtualizer()._willUpdate(), describing the expected re-entrancy convergence: explain that reactiveVirtualizer reads trigger the linkedSignal (equal: () => false) which schedules maybeNotify → reactiveVirtualizer.set(...) but the loop terminates because _willUpdate only rebinds when this.scrollElement changes and maybeNotify's memo prevents spurious onChange calls; also add an E2E test exercising scroll + ResizeObserver-style measurement updates to assert no infinite re-render and that only a single extra render per frame occurs at worst to prevent regressions. In `@packages/angular-virtual/src/proxy.ts`: - Around line 79-91: The getOwnPropertyDescriptor trap is returning a descriptor for every property which violates proxy invariants and conflicts with has/ownKeys; update getOwnPropertyDescriptor in the proxy to check existence via untracked(inputSignal) (or Reflect.has/Reflect.getOwnPropertyDescriptor on that object) and return undefined when the property does not exist, and when it does exist return the actual descriptor (or a descriptor that preserves configurable/enumerable/writable from the real property) instead of a blanket always-present descriptor; adjust references to getOwnPropertyDescriptor, has, ownKeys, untracked, and inputSignal accordingly. --- Nitpick comments: In `@packages/angular-virtual/e2e/app/src/app/scroll.component.ts`: - Around line 11-25: The current randomHeightForKey uses Math.random via getRandomInt which produces non-deterministic row heights; replace the randomness with a key-based pseudo-random generator so heights are stable across runs: inside randomHeightForKey (and remove reliance on getRandomInt/Math.random for this path) compute a deterministic numeric seed from the id (e.g., a simple string hash of id), map that seed into the desired range [25,100] to produce v, store v in the existing cache Map<string, number>, and return it; keep the cache logic unchanged so repeated calls return the same value for the same key. In `@packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts`: - Around line 11-25: The current randomHeightForKey uses Math.random so heights vary between runs; replace the randomness with a deterministic function that maps the id string to a stable integer in the 25–100 range. Modify the randomHeightForKey closure (and keep the cache Map) to compute a simple string hash from the id (e.g., accumulate char codes with multipliers) and then normalize that hash into the desired range instead of calling getRandomInt/Math.random; store and return the computed value from the existing cache so repeated calls still return the same height for the same id. In `@packages/angular-virtual/e2e/app/test/measure-element.spec.ts`: - Around line 29-41: Replace the brittle fixed sleep (page.waitForTimeout(200)) with a poll that retries the layout assertion until it's true or a timeout elapses: use page.waitForFunction (or a small loop) to repeatedly query the locators via page.locator('[data-testid="item-b"]').boundingBox() and page.locator('[data-testid="item-c"]').boundingBox() and assert that cBox.y >= (bBox.y + bBox.height) - 1 (preserve the 1px tolerance); ensure you still null-check bounding boxes and fail the test if the waitForFunction times out so CI will report the layout regression. In `@packages/angular-virtual/e2e/app/test/scroll.spec.ts`: - Around line 25-124: Replace the fixed waits (await page.waitForTimeout(...)) with condition-based polling/assertions: for tests that wait for an item to appear use await expect(page.locator('[data-testid="item-1000"]')).toBeVisible() / '[data-testid="item-1001"]' instead of sleep; for "scrolls to last item" poll the container scroll position (query '#scroll-container' and assert Math.abs(scrollTop + clientHeight - scrollHeight) < 1.01) using expect.poll or a locator assertion; for initialOffset replace the 500ms sleep by polling until the minimum [data-index] in '#scroll-container' is > 0, and after performing the user scroll poll until container.scrollTop has decreased by ~2000; for layout checks poll until layout.items.length > 3 and layout.maxGap < 2; for the final "scrolls to index 0" replace the two 1s sleeps with polling for visibility of '[data-testid="item-1000"]' after first click and then for '[data-testid="item-0"]' (or container scrollTop≈0) after the second click. Use the existing selectors ('#scroll-container', '[data-index]', '[data-testid="item-*"]') and helper checks inside expect.poll to determine readiness instead of fixed timeouts. In `@packages/angular-virtual/e2e/app/test/smooth-scroll.spec.ts`: - Around line 7-139: The tests use many fixed page.waitForTimeout(2000) sleeps (e.g., around interactions with '#scroll-to-1000', '#scroll-to-500', '#scroll-to-100', '#scroll-to-0', '#scroll-to-500-start', '#scroll-to-500-center') which slows and flakes CI; replace each sleep with condition-based waits such as awaiting the locator to be visible (await expect(page.locator('[data-testid="item-1000"]')).toBeVisible()) or using expect.poll()/locator.waitFor() to wait until the scroll container ('#scroll-container') has the expected scrollTop or the item geometry (computed via page.evaluate) is within tolerance, and for interrupt tests poll until the final target is visible/settled instead of arbitrary timeouts so each test waits for the actual condition rather than a fixed delay. In `@packages/angular-virtual/e2e/app/test/stale-index.spec.ts`: - Around line 13-37: Replace the non-deterministic waits (await page.waitForTimeout(100) and 200) with a deterministic layout/paint flush using a double requestAnimationFrame promise after operations that change layout (the scrollTop set on container and after clicking '[data-testid="remove-items"]'). Specifically, after manipulating the DOM in the test (the container.evaluate(...) call and the await page.click('[data-testid="remove-items"]') calls) insert a browser-side double RAF flush (via page.evaluate(() => new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r))))) and/or use a page.waitForFunction that checks the state of the '[data-testid="item-count"]' or absence of '[data-testid="error"]' before asserting; replace references to waitForTimeout with that deterministic flush around the item-count and error assertions. In `@packages/angular-virtual/src/index.ts`: - Line 82: The computed wrapper around the side‑effectful constructor (const lazyVirtualizer = computed(() => new Virtualizer(untracked(resolvedOptions)))) should be replaced with an explicit lazy initialization to avoid participating in the reactive graph; introduce a module/local variable like let virtualizer: Virtualizer | undefined and replace uses of lazyVirtualizer.value with a one‑shot factory/getter that does if (!virtualizer) virtualizer = new Virtualizer(untracked(resolvedOptions)), returning virtualizer; optionally wire any cleanup logic to Virtualizer disposal where appropriate. Ensure you reference Virtualizer, resolvedOptions, untracked and remove the computed import/usages for lazyVirtualizer. - Around line 186-195: The SSR guards currently check typeof document but then read window (in getScrollElement and initialOffset), which is misleading and can break in runtimes that polyfill one but not the other; update the guards to check typeof window !== 'undefined' where you actually access window (change the checks used in the AngularVirtualizer factory for getScrollElement and initialOffset), and ensure you still return null/0 when window is unavailable so observeElementRect/observeElementOffset/scrollToFn logic remains safe. - Around line 99-139: The call to signalProxy is double-cast to AngularVirtualizer and the four string-array lists (methods pass-through, attributes-to-signals, tracked methods, zero-arg computed) are not type-checked against the AngularVirtualizer/Virtualizer shape, so new signal-wrapped properties can be missed at compile time; update the call site to assert exhaustiveness by replacing the unknown cast with a TypeScript-checked construct (e.g., use a typed helper or the satisfies operator) that verifies the union of the arrays equals the set of signal-wrapped keys on AngularVirtualizer<TScrollElement, TItemElement>, referencing signalProxy, AngularVirtualizer, and the specific property names (e.g., getTotalSize, getVirtualItems, isScrolling, measurementsCache, options, range, scrollDirection, scrollElement, scrollOffset, scrollRect) so the compiler will error if any property is omitted or changed. In `@packages/virtual-core/tests/index.test.ts`: - Around line 340-353: The test suite defines the same ResizeObserver mock factory twice (MockResizeObserver) — extract a shared helper named createMockResizeObserver() that returns the vi.fn factory producing { observe, unobserve, disconnect } mocks, replace both MockResizeObserver occurrences with calls to createMockResizeObserver() and assign its result to mockWindow.ResizeObserver and the earlier test’s equivalent; this ensures both tests reuse the same factory function (refer to MockResizeObserver and mockWindow.ResizeObserver to locate the spots to replace).🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
9a5dc6a9-4037-48e0-83c0-e29cc3810f96📥 Commits
Reviewing files that changed from the base of the PR and between c3d4cd4f63d9c314ac6ec0ee7885a93a14ae52f9 and 233fb611b31c3b0dd0e90738aa4114571f58084c.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (70)
.changeset/gold-days-greet.mddocs/framework/angular/angular-virtual.mdexamples/angular/dynamic/package.jsonexamples/angular/fixed/package.jsonexamples/angular/infinite-scroll/package.jsonexamples/angular/padding/package.jsonexamples/angular/smooth-scroll/package.jsonexamples/angular/sticky/package.jsonexamples/angular/table/package.jsonexamples/angular/variable/package.jsonexamples/angular/window/package.jsonexamples/lit/dynamic/package.jsonexamples/lit/fixed/package.jsonexamples/react/dynamic/package.jsonexamples/react/fixed/package.jsonexamples/react/infinite-scroll/package.jsonexamples/react/padding/package.jsonexamples/react/scroll-padding/package.jsonexamples/react/smooth-scroll/package.jsonexamples/react/sticky/package.jsonexamples/react/table/package.jsonexamples/react/variable/package.jsonexamples/react/window/package.jsonexamples/svelte/dynamic/package.jsonexamples/svelte/fixed/package.jsonexamples/svelte/infinite-scroll/package.jsonexamples/svelte/smooth-scroll/package.jsonexamples/svelte/sticky/package.jsonexamples/svelte/table/package.jsonexamples/vue/dynamic/package.jsonexamples/vue/fixed/package.jsonexamples/vue/infinite-scroll/package.jsonexamples/vue/padding/package.jsonexamples/vue/scroll-padding/package.jsonexamples/vue/smooth-scroll/package.jsonexamples/vue/sticky/package.jsonexamples/vue/table/package.jsonexamples/vue/variable/package.jsonknip.jsonpackage.jsonpackages/angular-virtual/README.mdpackages/angular-virtual/angular.jsonpackages/angular-virtual/e2e/app/angular.jsonpackages/angular-virtual/e2e/app/src/app/app.component.tspackages/angular-virtual/e2e/app/src/app/app.config.tspackages/angular-virtual/e2e/app/src/app/app.routes.tspackages/angular-virtual/e2e/app/src/app/measure-element.component.tspackages/angular-virtual/e2e/app/src/app/scroll.component.tspackages/angular-virtual/e2e/app/src/app/smooth-scroll.component.tspackages/angular-virtual/e2e/app/src/app/stale-index.component.tspackages/angular-virtual/e2e/app/src/index.htmlpackages/angular-virtual/e2e/app/src/main.tspackages/angular-virtual/e2e/app/src/styles.csspackages/angular-virtual/e2e/app/test/measure-element.spec.tspackages/angular-virtual/e2e/app/test/scroll.spec.tspackages/angular-virtual/e2e/app/test/smooth-scroll.spec.tspackages/angular-virtual/e2e/app/test/stale-index.spec.tspackages/angular-virtual/e2e/app/tsconfig.app.jsonpackages/angular-virtual/e2e/app/tsconfig.jsonpackages/angular-virtual/ng-package.jsonpackages/angular-virtual/package.jsonpackages/angular-virtual/playwright.config.tspackages/angular-virtual/src/index.tspackages/angular-virtual/src/proxy.tspackages/angular-virtual/src/types.tspackages/angular-virtual/tsconfig.build.jsonpackages/angular-virtual/tsconfig.jsonpackages/angular-virtual/vite.config.tspackages/react-virtual/e2e/app/test/scroll.spec.tspackages/virtual-core/tests/index.test.ts
💤 Files with no reviewable changes (2)
- packages/angular-virtual/ng-package.json
- packages/angular-virtual/tsconfig.build.json
examples/svelte/dynamic/package.json line 22@@ -18,5 +18,5 @@1818 "svelte": "^4.2.20",1919 "svelte-check": "^4.2.1",2020 "tslib": "^2.8.1",21- "typescript": "5.4.5",22- "vite": "^5.4.19"21+ "typescript": "5.6.3",22+ "vite": "^6.4.2"⚠️ Potential issue | 🟠 Major
🧩 Analysis chain
🌐 Web query:
What Vite versions are supported by@sveltejs/vite-plugin-svelte3.1.2? Is Vite 6.4.2 supported?💡 Result:
The exact Vite peer dependency range for
@sveltejs/vite-plugin-svelte3.1.2 is not explicitly stated in the searched sources. However, based on the changelog and release history: - Version 3.0.0 bumped support to Vite 5 (breaking change from previous versions). - Version 3.1.0 (close to 3.1.2) added Svelte 5 HMR support but no Vite change mentioned. - Later versions like 6.x bumped to ^6.3.0 || ^7.0.0 (PR#1130, June 2025). Vite 6.4.2 (a 6.x version post-6.3.0) is likely supported by 3.1.2 if 3.1.2 uses Vite ^5.0.0, as semver ^5 allows 6.x. But without the exact package.json for 3.1.2, confirmation is medium confidence. Official sources recommend checking the package.json peerDependencies directly via npm view@sveltejs/vite-plugin-svelte@3.1.2 peerDependencies.Citations:
- 1: https://github.com/sveltejs/vite-plugin-svelte/releases
- 2: https://github.com/sveltejs/vite-plugin-svelte/blob/main/packages/vite-plugin-svelte/CHANGELOG.md
- 3: https://github.com/sveltejs/vite-plugin-svelte/blob/HEAD/packages/vite-plugin-svelte/CHANGELOG.md
- 4: https://newreleases.io/project/github/sveltejs/vite-plugin-svelte/release/@sveltejs%2Fvite-plugin-svelte@3.1.0
- 5: https://github.com/sveltejs/vite-plugin-svelte/pull/1130
🏁 Script executed:
npm view `@sveltejs/vite-plugin-svelte`@3.1.2 peerDependencies --jsonRepository: TanStack/virtual
Length of output: 121
🏁 Script executed:
# Also check if there are known compatibility issues in the GitHub repo # Search for any discussions about Vite 6 compatibility with 3.1.2 cd /tmp && git clone --depth 1 https://github.com/sveltejs/vite-plugin-svelte.git 2>/dev/null || true if [ -d vite-plugin-svelte ]; then cd vite-plugin-svelte # Check recent issues/discussions about Vite 6 compatibility git log --oneline --grep="Vite 6" --all | head -20 git log --oneline --grep="3.1.2" --all | head -20 fiRepository: TanStack/virtual
Length of output: 42
Fix Vite and Svelte plugin version incompatibility.
Line 22 upgrades to
vite@^6.4.2, but@sveltejs/vite-plugin-svelte@^3.1.2requiresvite@^5.0.0. This incompatibility will break the example. Either upgrade the plugin to a version supporting Vite 6 or downgrade Vite to 5.x.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/svelte/dynamic/package.json` at line 22, The package.json currently sets "vite": "^6.4.2" which is incompatible with the pinned "@sveltejs/vite-plugin-svelte@^3.1.2" that requires Vite ^5; fix by making the two dependencies compatible: either downgrade the Vite entry in package.json to a Vite 5.x range (e.g. ^5.0.0) so it satisfies "@sveltejs/vite-plugin-svelte@^3.1.2", or upgrade "@sveltejs/vite-plugin-svelte" to a release that explicitly supports Vite 6 and adjust the plugin version string accordingly; find and update the "vite" and "@sveltejs/vite-plugin-svelte" dependency entries in package.json to match one of these compatible pairs.examples/svelte/smooth-scroll/package.json lines 21 to 22@@ -18,5 +18,5 @@1818 "svelte": "^4.2.20",1919 "svelte-check": "^4.2.1",2020 "tslib": "^2.8.1",21- "typescript": "5.4.5",22- "vite": "^5.4.19"21+ "typescript": "5.6.3",22+ "vite": "^6.4.2"⚠️ Potential issue | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Read-only dependency compatibility check (no repo files required) set -euo pipefail npm view vite@6.4.2 version npm view `@sveltejs/vite-plugin-svelte`@3.1.2 peerDependencies --json npm view `@sveltejs/vite-plugin-svelte` version npm view `@sveltejs/vite-plugin-svelte` peerDependencies --jsonRepository: TanStack/virtual
Length of output: 196
Resolve Vite 6 compatibility:
@sveltejs/vite-plugin-svelte@3.1.2requires Vite^5.0.0, not 6.x.Line 22 upgrades Vite to
^6.4.2, but the Svelte Vite plugin at Line 16 (@sveltejs/vite-plugin-svelte@^3.1.2) has a peer dependency ofvite@^5.0.0. This creates an incompatibility. Either upgrade the Svelte plugin to a version supporting Vite 6 or downgrade Vite to 5.x.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/svelte/smooth-scroll/package.json` around lines 21 - 22, The package.json shows an incompatible dependency set: "@sveltejs/vite-plugin-svelte@^3.1.2" requires Vite ^5.x but "vite": "^6.4.2" was added; fix by aligning versions—either upgrade the Svelte Vite plugin to a release that lists Vite 6 as a peer (replace "@sveltejs/vite-plugin-svelte" version accordingly) or downgrade "vite" to a 5.x version that satisfies the plugin's peer dependency; update the package.json dependency entries for "vite" or "@sveltejs/vite-plugin-svelte" and run install to verify peer compatibility.packages/angular-virtual/e2e/app/angular.json line 2@@ -0,0 +1,2 @@1+{2+ "$schema": "../../../node_modules/@angular/cli/lib/config/schema.json",⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash python - <<'PY' from pathlib import Path base = Path("packages/angular-virtual/e2e/app") current = (base / "../../../node_modules/@angular/cli/lib/config/schema.json").resolve() expected = (base / "../../../../node_modules/@angular/cli/lib/config/schema.json").resolve() print("current:", current) print("expected:", expected) PYRepository: TanStack/virtual
Length of output: 223
🏁 Script executed:
#!/bin/bash # Check if the file exists and show its content around line 2 if [ -f "packages/angular-virtual/e2e/app/angular.json" ]; then echo "=== File exists ===" head -10 "packages/angular-virtual/e2e/app/angular.json" else echo "File does not exist" fi # Check node_modules structure echo "" echo "=== Checking node_modules locations ===" if [ -d "node_modules/@angular/cli" ]; then echo "✓ Root node_modules/@angular/cli exists" ls -la "node_modules/@angular/cli/lib/config/schema.json" 2>/dev/null | head -1 || echo " schema.json not found at root" fi if [ -d "packages/node_modules/@angular/cli" ]; then echo "✓ packages/node_modules/@angular/cli exists" ls -la "packages/node_modules/@angular/cli/lib/config/schema.json" 2>/dev/null | head -1 || echo " schema.json not found in packages" else echo "✗ packages/node_modules/@angular/cli does not exist" fi # Check directory structure echo "" echo "=== Directory structure ===" ls -la "packages/angular-virtual/e2e/app/" 2>/dev/null | head -10 || echo "Directory not found"Repository: TanStack/virtual
Length of output: 818
🏁 Script executed:
#!/bin/bash # Check if the schema exists at the root level (the expected path) if [ -f "node_modules/@angular/cli/lib/config/schema.json" ]; then echo "✓ Root level schema exists: node_modules/@angular/cli/lib/config/schema.json" wc -l "node_modules/@angular/cli/lib/config/schema.json" else echo "✗ Root level schema does NOT exist" fi # Double check what's in packages root echo "" echo "=== Checking packages/ root ===" if [ -d "packages/" ]; then ls -la packages/ | head -20 fiRepository: TanStack/virtual
Length of output: 677
🏁 Script executed:
#!/bin/bash # Search for `@angular/cli` anywhere in the repo echo "=== Searching for `@angular/cli` ===" find . -type d -name "@angular" 2>/dev/null | head -20 echo "" echo "=== Checking if node_modules exists at repo root ===" if [ -d "node_modules" ]; then echo "✓ node_modules exists" ls -la node_modules | head -20 else echo "✗ node_modules does NOT exist at repo root" fi echo "" echo "=== Checking root package.json for dependencies ===" if [ -f "package.json" ]; then cat package.json | head -30 fiRepository: TanStack/virtual
Length of output: 2597
🏁 Script executed:
#!/bin/bash # Check if the e2e/app/angular.json is referenced anywhere echo "=== Searching for references to e2e/app/angular.json ===" rg "e2e/app" packages/angular-virtual/ 2>/dev/null || echo "No references found" echo "" echo "=== Check packages/angular-virtual package.json ===" if [ -f "packages/angular-virtual/package.json" ]; then cat "packages/angular-virtual/package.json" fi echo "" echo "=== Check packages/angular-virtual/e2e structure ===" find packages/angular-virtual/e2e -type f 2>/dev/null | head -20Repository: TanStack/virtual
Length of output: 3644
🏁 Script executed:
#!/bin/bash # Since this is a pnpm monorepo, check where `@angular/cli` actually is echo "=== Searching for `@angular/cli` in .pnpm ===" find node_modules/.pnpm -type d -name "@angular/cli*" 2>/dev/null | head -5 echo "" echo "=== Check if schema exists in the pnpm structure ===" find node_modules -name "schema.json" -path "*@angular/cli*" 2>/dev/null echo "" echo "=== Check what's actually resolved from packages/angular-virtual/e2e/app ===" python3 <<'EOF' from pathlib import Path import os # Simulate from the e2e/app directory os.chdir("packages/angular-virtual/e2e/app") current_dir = Path.cwd() # Try to resolve the current path current_path = current_dir / "../../../node_modules/@angular/cli/lib/config/schema.json" expected_path = current_dir / "../../../../node_modules/@angular/cli/lib/config/schema.json" print("Current working dir:", current_dir) print() print("Current path resolution:") print(f" Path: {current_path}") print(f" Resolved: {current_path.resolve()}") print(f" Exists: {current_path.resolve().exists()}") print() print("Expected path resolution:") print(f" Path: {expected_path}") print(f" Resolved: {expected_path.resolve()}") print(f" Exists: {expected_path.resolve().exists()}") print() # Check what's actually at each resolved location current_resolved = current_path.resolve() expected_resolved = expected_path.resolve() # Check parents print("Current path parent exists:", current_resolved.parent.exists()) print("Expected path parent exists:", expected_resolved.parent.exists()) if expected_resolved.parent.exists(): print("Files in expected parent:", list(expected_resolved.parent.parent.iterdir())[:5]) EOFRepository: TanStack/virtual
Length of output: 871
🏁 Script executed:
#!/bin/bash # Let's check how other Angular configs in this monorepo reference node_modules echo "=== Check packages/angular-virtual/angular.json (parent config) ===" grep -n "schema" packages/angular-virtual/angular.json echo "" echo "=== Check if there are other nested angular.json files ===" find . -name "angular.json" -type f 2>/dev/null echo "" echo "=== Verify pnpm structure - check if packages has its own node_modules ===" ls -la packages/ | grep node_modules echo "Exit code: $?" echo "" echo "=== In a pnpm monorepo, check root .pnpm for `@angular` ===" ls -d node_modules/.pnpm/@angular* 2>/dev/null | head -5 || echo "Not found in .pnpm"Repository: TanStack/virtual
Length of output: 865
🏁 Script executed:
#!/bin/bash # Check how other nested angular.json files (in examples) reference the schema echo "=== Check one of the example angular.json files (nested) ===" head -5 examples/angular/dynamic/angular.json echo "" echo "=== Verify directory depth for examples vs e2e/app ===" python3 <<'EOF' from pathlib import Path # Compare relative paths example = Path("examples/angular/dynamic/angular.json") e2e = Path("packages/angular-virtual/e2e/app/angular.json") parent = Path("packages/angular-virtual/angular.json") print(f"Parent config depth: {len(parent.parts)}") print(f"E2E config depth: {len(e2e.parts)}") print(f"Example config depth: {len(example.parts)}") print() print(f"Parent relative to root: {parent.parts}") print(f"E2E relative to root: {e2e.parts}") print(f"Example relative to root: {example.parts}") print() # Calculate how many levels up each needs to go to reach root node_modules parent_levels = len(parent.parts) - 1 # -1 for the filename e2e_levels = len(e2e.parts) - 1 example_levels = len(example.parts) - 1 print(f"Parent needs to go up: {parent_levels} levels") print(f"E2E needs to go up: {e2e_levels} levels") print(f"Example needs to go up: {example_levels} levels") EOFRepository: TanStack/virtual
Length of output: 699
Fix the nested Angular schema path to reach the root node_modules.
The e2e/app/angular.json is 5 levels deep from the repository root, requiring 4 directory traversals to reach the root node_modules. The current path uses only 3 traversals (
../../../), which points to the non-existentpackages/node_modules.🛠️ Proposed fix
- "$schema": "../../../node_modules/@angular/cli/lib/config/schema.json", + "$schema": "../../../../node_modules/@angular/cli/lib/config/schema.json",📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"$schema": "../../../../node_modules/@angular/cli/lib/config/schema.json",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/angular.json` at line 2, The "$schema" path in e2e/app/angular.json is incorrect (uses "../../../node_modules/...") and points to packages/node_modules; update the schema string to traverse four levels up (use "../../../../node_modules/@angular/cli/lib/config/schema.json") so it resolves to the repository root node_modules; locate the "$schema" property in that file and replace the relative path accordingly.@@ -0,0 +1 @@1+import { ApplicationConfig } from '@angular/core'⚠️ Potential issue | 🟡 Minor
Use
import typeforApplicationConfig.ESLint (
@typescript-eslint/consistent-type-imports) flags this becauseApplicationConfigis only used as a type annotation.♻️ Proposed fix
-import { ApplicationConfig } from '@angular/core' +import type { ApplicationConfig } from '@angular/core'📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import type { ApplicationConfig } from '@angular/core'🧰 Tools
🪛 ESLint
[error] 1-1: All imports in the declaration are only used as types. Use
import type.(
@typescript-eslint/consistent-type-imports)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/app.config.ts` at line 1, The import of ApplicationConfig should be a type-only import to satisfy `@typescript-eslint/consistent-type-imports`: replace the current value import for ApplicationConfig with a type import by changing the import statement that references ApplicationConfig to use "import type { ApplicationConfig } from '@angular/core'"; locate the existing import of ApplicationConfig (symbol: ApplicationConfig) and update it to a type import to ensure it's treated as a purely type-only import by the compiler/linter.✅ Addressed in commit 34b8084
@@ -0,0 +1 @@1+import { Routes } from '@angular/router'⚠️ Potential issue | 🟡 Minor
Use a type-only import for
Routes.Per the ESLint hint (
@typescript-eslint/consistent-type-imports),Routesis used only as a type.Proposed fix
-import { Routes } from '@angular/router' +import type { Routes } from '@angular/router'📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import type { Routes } from '@angular/router'🧰 Tools
🪛 ESLint
[error] 1-1: All imports in the declaration are only used as types. Use
import type.(
@typescript-eslint/consistent-type-imports)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/app.routes.ts` at line 1, The import of Routes should be a type-only import; replace the value import "import { Routes } from '@angular/router'" with a type-only import for the Routes type (e.g., use "import type { Routes } from '@angular/router'") so the compiler/ESLint knows Routes is used only as a type.✅ Addressed in commit 34b8084
packages/angular-virtual/e2e/app/src/app/measure-element.component.ts lines 1 to 8@@ -0,0 +1,9 @@1+import {2+ ChangeDetectionStrategy,3+ Component,4+ ElementRef,5+ afterRenderEffect,6+ signal,7+ viewChild,8+ viewChildren,9+} from '@angular/core'⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash rg -n -C2 '\bElementRef\b|#measureItems|afterRenderEffect' packages/angular-virtual/e2e/app/src/app/measure-element.component.tsRepository: TanStack/virtual
Length of output: 576
🏁 Script executed:
cat -n packages/angular-virtual/e2e/app/src/app/measure-element.component.tsRepository: TanStack/virtual
Length of output: 4204
Convert
ElementRefto type-only import and remove the unused#measureItemsfield.ElementRefis only used in type annotations (lines 74 and 76) and can be imported as type-only. The#measureItemsfield (lines 82–88) is assigned but never read—move theafterRenderEffectregistration to the constructor instead.Proposed fix
import { ChangeDetectionStrategy, Component, - ElementRef, afterRenderEffect, signal, viewChild, viewChildren, } from '@angular/core' +import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.items().length, estimateSize: () => 36, getItemKey: (index) => this.items()[index]!.id, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import { ChangeDetectionStrategy, Component, afterRenderEffect, signal, viewChild, viewChildren, } from '@angular/core' import type { ElementRef } from '@angular/core'🧰 Tools
🪛 ESLint
[error] 1-9: Imports "ElementRef" are only used as type.
(
@typescript-eslint/consistent-type-imports)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/measure-element.component.ts` around lines 1 - 9, ElementRef is only used as a type and the private field `#measureItems` is assigned but never read; change the import of ElementRef to a type-only import, remove the unused private field `#measureItems`, and move the afterRenderEffect registration out of the class field initializer into the component's constructor so the effect still runs — update any type annotations referencing ElementRef accordingly and keep the afterRenderEffect callback logic intact in the constructor.packages/angular-virtual/e2e/app/src/app/scroll.component.ts lines 1 to 7@@ -0,0 +1,8 @@1+import {2+ ChangeDetectionStrategy,3+ Component,4+ ElementRef,5+ afterRenderEffect,6+ viewChild,7+ viewChildren,8+} from '@angular/core'⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash rg -n -C2 '\bElementRef\b|#measureItems|afterRenderEffect' packages/angular-virtual/e2e/app/src/app/scroll.component.tsRepository: TanStack/virtual
Length of output: 519
🏁 Script executed:
cat -n packages/angular-virtual/e2e/app/src/app/scroll.component.tsRepository: TanStack/virtual
Length of output: 3483
Fix the current lint blockers.
ElementRefshould be imported as a type (it's used only in type annotations on lines 74 and 76), and the unused private#measureItemsfield triggers theno-unused-private-class-memberslint rule. Moving the render effect to the constructor maintains the effect's behavior while eliminating the unused field warning.🧹 Proposed lint fix
import { ChangeDetectionStrategy, Component, - ElementRef, afterRenderEffect, viewChild, viewChildren, } from '@angular/core' +import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.count, estimateSize: () => 50, initialOffset: this.initialOffset, debug: true, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }🧰 Tools
🪛 ESLint
[error] 1-8: Imports "ElementRef" are only used as type.
(
@typescript-eslint/consistent-type-imports)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/scroll.component.ts` around lines 1 - 8, ElementRef is only used as a type and the private field `#measureItems` is unused; update the import to import ElementRef as a type (e.g., import type { ElementRef } from '@angular/core') and remove the unused private class field `#measureItems` to satisfy no-unused-private-class-members; to preserve behavior, move the afterRenderEffect call currently defined outside the constructor into the class constructor (keeping the same callback and references to viewChild/viewChildren) so the render effect runs as before without leaving an unused private member.packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts lines 1 to 7@@ -0,0 +1,8 @@1+import {2+ ChangeDetectionStrategy,3+ Component,4+ ElementRef,5+ afterRenderEffect,6+ viewChild,7+ viewChildren,8+} from '@angular/core'⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash rg -n -C2 '\bElementRef\b|#measureItems|afterRenderEffect' packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.tsRepository: TanStack/virtual
Length of output: 515
🏁 Script executed:
cat packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.tsRepository: TanStack/virtual
Length of output: 3195
Move
ElementRefto a type-only import and callafterRenderEffectin the constructor without storing the unused result.ElementRefis used only as a type parameter in theviewChildandviewChildrencalls and should be imported as a type-only import. The#measureItemsfield stores the result ofafterRenderEffectbut is never referenced, making it an unused private field. The effect can be invoked directly in the constructor without assignment.🧹 Proposed lint fix
import { ChangeDetectionStrategy, Component, - ElementRef, afterRenderEffect, viewChild, viewChildren, } from '@angular/core' +import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.count, estimateSize: () => 50, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import { ChangeDetectionStrategy, Component, afterRenderEffect, viewChild, viewChildren, } from '@angular/core' import type { ElementRef } from '@angular/core'🧰 Tools
🪛 ESLint
[error] 1-8: Imports "ElementRef" are only used as type.
(
@typescript-eslint/consistent-type-imports)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts` around lines 1 - 8, ElementRef is only used as a type parameter for viewChild and viewChildren and afterRenderEffect is called but its returned disposable is stored in the unused private field `#measureItems`; change the import of ElementRef to a type-only import, remove the unused private field `#measureItems`, and invoke afterRenderEffect directly in the component constructor without assigning its return value (keep the call to afterRenderEffect(...) as before). Ensure the viewChild and viewChildren usages still reference ElementRef as a type parameter and that no other code relies on the removed `#measureItems` field.packages/angular-virtual/e2e/app/src/app/stale-index.component.ts lines 1 to 8@@ -0,0 +1,9 @@1+import {2+ ChangeDetectionStrategy,3+ Component,4+ ElementRef,5+ afterRenderEffect,6+ signal,7+ viewChild,8+ viewChildren,9+} from '@angular/core'⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash rg -n -C2 '\bElementRef\b|#measureItems|afterRenderEffect' packages/angular-virtual/e2e/app/src/app/stale-index.component.tsRepository: TanStack/virtual
Length of output: 568
🏁 Script executed:
cat -n packages/angular-virtual/e2e/app/src/app/stale-index.component.tsRepository: TanStack/virtual
Length of output: 3366
Clean up the lint blockers.
ElementRefis used only as a type parameter and should be imported as a type. The private#measureItemsfield is unused—theafterRenderEffectshould be called in the constructor without storing the handle.🧹 Proposed lint fix
import { ChangeDetectionStrategy, Component, - ElementRef, afterRenderEffect, signal, viewChild, viewChildren, } from '@angular/core' +import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.items().length, estimateSize: () => 50, @@ return items[index]!.id }, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }🧰 Tools
🪛 ESLint
[error] 1-9: Imports "ElementRef" are only used as type.
(
@typescript-eslint/consistent-type-imports)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/stale-index.component.ts` around lines 1 - 9, ElementRef is only used as a type and the private field `#measureItems` is unused; update the import to import ElementRef as a type-only import and remove the private `#measureItems` field, then call afterRenderEffect inside the component constructor without assigning its return value to any property (i.e., invoke afterRenderEffect(...) in the constructor), keeping references to the functions/classes like afterRenderEffect, ElementRef, and the component constructor to locate the changes.packages/angular-virtual/package.json lines 39 to 52Outdated@@ -34,13 +37,16 @@34- }37+ "./package.json": "./package.json"3538 },3639 "engines": {3740 "node": ">=12"3841 },3942 "files": [40- "build"43+ "dist",44+ "src"4145 ],4246 "scripts": {43- "clean": "premove ./build",44- "test:types": "tsc --noEmit",47+ "clean": "premove ./dist ./build ./coverage",4548 "test:eslint": "eslint ./src",46- "build": "ng-packagr -p ng-package.json -c tsconfig.build.json"49+ "test:build": "publint --strict",50+ "test:types": "tsc",51+ "build": "vite build",52+ "test:e2e": "../../node_modules/.bin/playwright test"⚠️ Potential issue | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash npm view `@angular/cli`@19.0.0 engines --json npm view `@angular-devkit/build-angular`@19.0.0 engines --json npm view vite engines --jsonRepository: TanStack/virtual
Length of output: 323
Update
engines.nodeto match Angular 19 and Vite requirements.The package currently advertises Node 12 support, but the build toolchain now requires a newer version. Angular 19 and Vite have stricter engine requirements. Vite specifically requires Node 20.19.0 or 22.12.0+, which is more restrictive than Angular's requirements alone.
🛠️ Corrected metadata update
"engines": { - "node": ">=12" + "node": "^20.19.0 || >=22.12.0" },📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"engines": { "node": "^20.19.0 || >=22.12.0" }, "files": [ "dist", "src" ], "scripts": { "clean": "premove ./dist ./build ./coverage", "test:eslint": "eslint ./src", "test:build": "publint --strict", "test:types": "tsc", "build": "vite build", "test:e2e": "../../node_modules/.bin/playwright test"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/package.json` around lines 39 - 52, The package.json currently sets "engines.node" to ">=12", which is too low for Angular 19 + Vite; update the "engines" entry in packages/angular-virtual package.json so the "node" constraint is bumped to a Vite-compatible minimum (e.g., ">=20.19.0") to match toolchain requirements, and ensure any related CI configs or documentation that reference Node version are aligned with the new constraint; locate the "engines" object and change the "node" value accordingly.packages/angular-virtual/README.md line 7@@ -4,4 +4,4 @@4455 # Quick Start667-> NOTE: Angular Virtual requires Angular 17.7+> NOTE: Angular Virtual requires Angular 19.⚠️ Potential issue | 🟡 Minor
Clarify version floor as “Angular 19+” to match support policy.
Line 7 currently reads as exactly Angular 19; this can conflict with the stated LTS-and-up direction and
>=19peer range. Consider updating to “requires Angular 19+”.✏️ Suggested doc tweak
-> NOTE: Angular Virtual requires Angular 19. +> NOTE: Angular Virtual requires Angular 19+.📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
> NOTE: Angular Virtual requires Angular 19+.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/README.md` at line 7, Update the README note that currently reads "NOTE: Angular Virtual requires Angular 19." to explicitly state the supported floor as "Angular 19+" so it matches the package peer range (>=19) and the project’s LTS-and-up policy; locate the note string in the README (the line beginning with "NOTE: Angular Virtual requires") and change the trailing text from "Angular 19." to "Angular 19+".packages/angular-virtual/src/index.ts lines 95 to 97Outdated@@ -68,9 +84,14 @@68- }69- },70- { allowSignalWrites: true },71- )84+ const reactiveVirtualizer = linkedSignal(() => {85+ const virtualizer = lazyVirtualizer()86+ // If setOptions does not call onChange, it's safe to call it here87+ virtualizer.setOptions(resolvedOptions())88+ return virtualizer89+ }, { equal: () => false })729073- let cleanup: () => void | undefined74- afterNextRender({ read: () => (virtualizer ?? lazyInit())._didMount() })91+ afterRenderEffect((cleanup) => {92+ cleanup(lazyVirtualizer()._didMount())93+ })759476- inject(DestroyRef).onDestroy(() => cleanup?.())95+ afterRenderEffect(() => {96+ reactiveVirtualizer()._willUpdate()97+ })⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Check whether _willUpdate paths in virtual-core can call onChange and under what conditions. rg -nP -C3 '_willUpdate|_didMount' packages/virtual-core/src/index.tsRepository: TanStack/virtual
Length of output: 342
🏁 Script executed:
# Get the full _willUpdate method from virtual-core sed -n '534,570p' packages/virtual-core/src/index.tsRepository: TanStack/virtual
Length of output: 1095
🏁 Script executed:
# Check the angular-virtual implementation around lines 73, 89, 95-97 cat -n packages/angular-virtual/src/index.ts | sed -n '70,100p'Repository: TanStack/virtual
Length of output: 1084
🏁 Script executed:
# Search for onChange calls in virtual-core to understand when it's triggered rg -nP 'onChange' packages/virtual-core/src/index.ts | head -20Repository: TanStack/virtual
Length of output: 152
🏁 Script executed:
# Check what maybeNotify does in virtual-core rg -nP -A10 'maybeNotify\s*=\s*\(' packages/virtual-core/src/index.tsRepository: TanStack/virtual
Length of output: 42
🏁 Script executed:
# Check if measurement callbacks (observeElementRect) trigger onChange flow rg -nP 'measureElement|observeElementRect' packages/virtual-core/src/index.ts | head -15Repository: TanStack/virtual
Length of output: 535
🏁 Script executed:
# Search for where onChange is actually called in virtual-core rg -nP -B5 -A5 'options\.onChange' packages/virtual-core/src/index.tsRepository: TanStack/virtual
Length of output: 284
🏁 Script executed:
# Get the full maybeNotify implementation rg -nP -A20 'private maybeNotify' packages/virtual-core/src/index.tsRepository: TanStack/virtual
Length of output: 742
🏁 Script executed:
# Check the memo function and what it returns rg -nP -A30 'maybeNotify = memo' packages/virtual-core/src/index.tsRepository: TanStack/virtual
Length of output: 1059
🏁 Script executed:
# Check how observeElementRect and observeElementOffset callbacks work rg -nP -B3 -A10 'observeElementRect\(this,' packages/virtual-core/src/index.tsRepository: TanStack/virtual
Length of output: 517
🏁 Script executed:
# Verify that the linkedSignal change detection and effect scheduling rg -nP 'linkedSignal|afterRenderEffect' packages/angular-virtual/src/index.tsRepository: TanStack/virtual
Length of output: 223
🏁 Script executed:
# Check if there are any guards or conditions that prevent re-triggering rg -nP -B5 -A5 'reactiveVirtualizer.set' packages/angular-virtual/src/index.tsRepository: TanStack/virtual
Length of output: 494
🏁 Script executed:
# Check if there are any existing comments around the linkedSignal or afterRenderEffect cat -n packages/angular-virtual/src/index.ts | sed -n '60,100p'Repository: TanStack/virtual
Length of output: 1569
🏁 Script executed:
# Check the entire _willUpdate method implementation to understand if it's safe to call multiple times rg -nP -A60 '_willUpdate = \(\) => {' packages/virtual-core/src/index.ts | head -80Repository: TanStack/virtual
Length of output: 1899
🏁 Script executed:
# Look for any debouncing or guards that might prevent the re-entrancy issue rg -nP 'debounce|throttle|guard|pending|inProgress' packages/angular-virtual/src/index.tsRepository: TanStack/virtual
Length of output: 42
🏁 Script executed:
# Check if there are any tests that cover this scenario fd -e '\.spec\.ts' -e '\.test\.ts' packages/angular-virtual/ | head -10Repository: TanStack/virtual
Length of output: 465
🏁 Script executed:
# Look for any existing convergence checks or guards in the codebase rg -nP 'scrollElement|getScrollElement' packages/angular-virtual/src/index.tsRepository: TanStack/virtual
Length of output: 460
🏁 Script executed:
# Check the full implementation to see if there's idempotency cat -n packages/angular-virtual/src/index.ts | sed -n '84,97p'Repository: TanStack/virtual
Length of output: 577
🏁 Script executed:
# Look at the measurement flow more carefully - check if onChange is throttled/debounced rg -nP -B10 -A10 'notify.*=' packages/virtual-core/src/index.ts | head -40Repository: TanStack/virtual
Length of output: 612
🏁 Script executed:
# Check what happens when scrollElement doesn't change on subsequent _willUpdate calls rg -nP -B5 -A15 'this.scrollElement !== scrollElement' packages/virtual-core/src/index.tsRepository: TanStack/virtual
Length of output: 692
🏁 Script executed:
# Check if there are measurement-based tests fd . packages/angular-virtual/ -name '*.spec.ts' -o -name '*.test.ts'Repository: TanStack/virtual
Length of output: 290
🏁 Script executed:
# Check the calculateRange implementation to understand memo dependencies rg -nP -A15 'calculateRange\s*=' packages/virtual-core/src/index.ts | head -30Repository: TanStack/virtual
Length of output: 553
🏁 Script executed:
# Check if there's any documentation or tests about the re-entrancy behavior rg -nP 'afterRenderEffect|linkedSignal' packages/angular-virtual/src/index.ts -A2 -B2Repository: TanStack/virtual
Length of output: 688
🏁 Script executed:
# Verify the actual control flow - does setOptions call onChange? rg -nP -A20 'setOptions\s*=' packages/virtual-core/src/index.ts | head -40Repository: TanStack/virtual
Length of output: 1093
🏁 Script executed:
# Check if there's any test covering measurement updates fd . packages/angular-virtual --type f -name '*.ts' | xargs rg -l 'measure|scroll' 2>/dev/null | head -5Repository: TanStack/virtual
Length of output: 462
🏁 Script executed:
# Check setOptions more carefully to see if it calls onChange rg -nP -A30 'setOptions = \(opts' packages/virtual-core/src/index.tsRepository: TanStack/virtual
Length of output: 1107
🏁 Script executed:
# Check if there are any E2E tests for scroll measurement scenarios fd . packages/angular-virtual --type f | xargs rg -l 'e2e|integration' 2>/dev/nullRepository: TanStack/virtual
Length of output: 227
🏁 Script executed:
# Verify the actual behavior by checking what happens in the linked-signal computation cat -n packages/angular-virtual/src/index.ts | sed -n '82,98p'Repository: TanStack/virtual
Length of output: 686
🏁 Script executed:
# Check if there are E2E tests with measurement scenarios fd . packages/angular-virtual/e2e --type f -name '*.ts' -o -name '*.spec.ts'Repository: TanStack/virtual
Length of output: 290
🏁 Script executed:
# Check the comment that's already there about setOptions cat -n packages/angular-virtual/src/index.ts | sed -n '84,90p'Repository: TanStack/virtual
Length of output: 371
🏁 Script executed:
# Final verification - check if reactiveVirtualizer is actually reassigned or if set() creates a new instance rg -nP 'linkedSignal.*equal' packages/angular-virtual/src/index.ts -B2 -A5Repository: TanStack/virtual
Length of output: 42
Document the expected re-entrancy convergence mechanism for this
afterRenderEffect+linkedSignalpattern.The effect reads
reactiveVirtualizer(), which triggers the linkedSignal computation (due toequal: () => falseat line 89), then calls_willUpdate(). When measurements change,maybeNotify()fires, callingonChangeand settingreactiveVirtualizer.set(instance), which schedules another effect run.This naturally converges because:
_willUpdatechecksif (this.scrollElement !== scrollElement)— observer setup only runs when the scroll element actually changes- On stable measurements,
maybeNotify's memo dependencies prevent spuriousonChangecalls
However, in measurement-heavy scenarios (e.g., dynamic content with ResizeObserver), this can cause an extra render cycle per frame. Consider adding a brief comment at line 95–97 explaining why the loop is expected to terminate, and cover this behavior with an E2E scroll-plus-measure test to prevent regressions.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/index.ts` around lines 95 - 97, Add a short explanatory comment at the afterRenderEffect that reads reactiveVirtualizer()._willUpdate(), describing the expected re-entrancy convergence: explain that reactiveVirtualizer reads trigger the linkedSignal (equal: () => false) which schedules maybeNotify → reactiveVirtualizer.set(...) but the loop terminates because _willUpdate only rebinds when this.scrollElement changes and maybeNotify's memo prevents spurious onChange calls; also add an E2E test exercising scroll + ResizeObserver-style measurement updates to assert no infinite re-render and that only a single extra render per frame occurs at worst to prevent regressions.packages/angular-virtual/src/proxy.ts lines 79 to 91Outdated@@ -74,15 +74,18 @@747475- return untypedTarget[property] || virtualizer[property as keyof V]75+ // All other fiels. Any fields that is not handled above will fail if the signal includes76+ // input or model signals from a component and this is accessed before initialization.77+ return untracked(inputSignal)[property as keyof TInput]7678 },7779 has(_, property: string) {78- return !!untracked(virtualizerSignal)[property as keyof V]80+ return property in untracked(inputSignal)7981 },8082 ownKeys() {81- return Reflect.ownKeys(untracked(virtualizerSignal))83+ return Reflect.ownKeys(untracked(inputSignal))8284 },8385 getOwnPropertyDescriptor() {8486 return {8587 enumerable: true,8688 configurable: true,89+ writable: true,8790 }8891 },⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash node <<'NODE' const proxy = new Proxy(function () {}, { has() { return false }, getOwnPropertyDescriptor() { return { enumerable: true, configurable: true, writable: true } }, }) console.log('missing' in proxy) console.log(Object.hasOwn(proxy, 'missing')) NODERepository: TanStack/virtual
Length of output: 70
🏁 Script executed:
cd packages/angular-virtual && find . -name "proxy.ts" -type fRepository: TanStack/virtual
Length of output: 74
🏁 Script executed:
cat -n packages/angular-virtual/src/proxy.ts | head -100Repository: TanStack/virtual
Length of output: 4377
🏁 Script executed:
wc -l packages/angular-virtual/src/proxy.tsRepository: TanStack/virtual
Length of output: 100
Fix proxy invariants: only return descriptors for existing properties.
The
getOwnPropertyDescriptortrap currently returns a descriptor for every property, causingObject.hasOwn(proxy, 'missing')to returntrueeven whenmissing in proxyisfalse. This violates proxy invariants and conflicts with thehastrap. Only return a descriptor if the property exists in the target or input signal.🐛 Proposed proxy descriptor fix
- has(_, property: string) { + has(_, property: PropertyKey) { return property in untracked(inputSignal) }, ownKeys() { return Reflect.ownKeys(untracked(inputSignal)) }, - getOwnPropertyDescriptor() { + getOwnPropertyDescriptor(target, property) { + const targetDescriptor = Reflect.getOwnPropertyDescriptor(target, property) + if (targetDescriptor) { + return targetDescriptor + } + + if (!(property in untracked(inputSignal))) { + return undefined + } + return { enumerable: true, configurable: true, writable: true, }📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
has(_, property: PropertyKey) { return property in untracked(inputSignal) }, ownKeys() { return Reflect.ownKeys(untracked(inputSignal)) }, getOwnPropertyDescriptor(target, property) { const targetDescriptor = Reflect.getOwnPropertyDescriptor(target, property) if (targetDescriptor) { return targetDescriptor } if (!(property in untracked(inputSignal))) { return undefined } return { enumerable: true, configurable: true, writable: true, } },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/proxy.ts` around lines 79 - 91, The getOwnPropertyDescriptor trap is returning a descriptor for every property which violates proxy invariants and conflicts with has/ownKeys; update getOwnPropertyDescriptor in the proxy to check existence via untracked(inputSignal) (or Reflect.has/Reflect.getOwnPropertyDescriptor on that object) and return undefined when the property does not exist, and when it does exist return the actual descriptor (or a descriptor that preserves configurable/enumerable/writable from the real property) instead of a blanket always-present descriptor; adjust references to getOwnPropertyDescriptor, has, ownKeys, untracked, and inputSignal accordingly.♻️ Duplicate comments (1)
packages/angular-virtual/package.json (1)
44-64: ⚠️ Potential issue | 🟠 MajorMake the new Vite/Playwright toolchain self-contained and restore the Node floor.
buildnow invokesvite, whiletest:e2ehard-codes a rootnode_modules/.binpath for Playwright, but neither tool is declared in this package’s dev deps. That makes the package scripts depend on workspace layout and can break package-isolated installs or non-POSIX shells. Also, the Node engine guard is still missing after the Angular/Vite upgrade; Angular’s compatibility table and Vite’s guide make the Vite-backed floor stricter than the old package metadata. Sources: Angular version compatibility, Vite getting started.Suggested metadata direction
"files": [ "dist", "src" ], + "engines": { + "node": "^20.19.0 || ^22.12.0" + }, "scripts": { "clean": "premove ./dist ./build ./coverage", "test:eslint": "eslint ./src", "test:build": "publint --strict", "test:types": "tsc", "build": "vite build", - "test:e2e": "../../node_modules/.bin/playwright test" + "test:e2e": "playwright test" },Also declare
viteand the Playwright package that provides theplaywrightbinary indevDependencies, using the workspace’s chosen ranges/catalog entries.You can verify the current metadata with:
#!/bin/bash # Description: Check whether package scripts rely on undeclared local tool binaries # and compare current Angular/Vite engine requirements. set -euo pipefail node <<'NODE' const fs = require('fs') const pkg = JSON.parse(fs.readFileSync('packages/angular-virtual/package.json', 'utf8')) const rootPkg = JSON.parse(fs.readFileSync('package.json', 'utf8')) const allLocalDeps = { ...pkg.dependencies, ...pkg.devDependencies, ...pkg.peerDependencies, ...pkg.optionalDependencies, } const allRootDeps = { ...rootPkg.dependencies, ...rootPkg.devDependencies, ...rootPkg.peerDependencies, ...rootPkg.optionalDependencies, } for (const name of ['vite', 'playwright', '@playwright/test']) { console.log(`${name}: package=${allLocalDeps[name] ?? '<missing>'}, root=${allRootDeps[name] ?? '<missing>'}`) } console.log(`engines.node: ${pkg.engines?.node ?? '<missing>'}`) NODE npm view vite engines --json npm view `@angular/cli`@19 engines --json npm view `@angular-devkit/build-angular`@19 engines --json🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/package.json` around lines 44 - 64, The package.json scripts are using tools that are not declared and a Node engine floor is missing: add vite and the Playwright package that provides the CLI (e.g. "playwright" or "@playwright/test" per your workspace catalog) to devDependencies (use workspace:* ranges consistent with the monorepo), update "test:e2e" to call the binary directly (e.g. "playwright test") instead of the hard-coded ../../node_modules/.bin path, and add an engines.node entry (set a Vite/Angular-compatible minimum, e.g. ">=18") to package.json to restore the Node floor. Ensure you update the devDependencies block (symbols: "vite", "playwright" or "@playwright/test") and the scripts ("build", "test:e2e") and add "engines.node".🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed. Duplicate comments: In `@packages/angular-virtual/package.json`: - Around line 44-64: The package.json scripts are using tools that are not declared and a Node engine floor is missing: add vite and the Playwright package that provides the CLI (e.g. "playwright" or "@playwright/test" per your workspace catalog) to devDependencies (use workspace:* ranges consistent with the monorepo), update "test:e2e" to call the binary directly (e.g. "playwright test") instead of the hard-coded ../../node_modules/.bin path, and add an engines.node entry (set a Vite/Angular-compatible minimum, e.g. ">=18") to package.json to restore the Node floor. Ensure you update the devDependencies block (symbols: "vite", "playwright" or "@playwright/test") and the scripts ("build", "test:e2e") and add "engines.node".
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
732c23d8-9a00-4fc8-9702-7b25cc415173📥 Commits
Reviewing files that changed from the base of the PR and between 233fb611b31c3b0dd0e90738aa4114571f58084c and 34b80846004747b1e9377078700776bd32e98910.
📒 Files selected for processing (8)
packages/angular-virtual/e2e/app/src/app/app.config.tspackages/angular-virtual/e2e/app/src/app/app.routes.tspackages/angular-virtual/e2e/app/src/app/measure-element.component.tspackages/angular-virtual/e2e/app/src/app/scroll.component.tspackages/angular-virtual/e2e/app/src/app/smooth-scroll.component.tspackages/angular-virtual/e2e/app/src/app/stale-index.component.tspackages/angular-virtual/package.jsonpackages/angular-virtual/src/proxy.ts
@benjavicente sorry about the conflicts! Could you sync with main and regenerate the lockfile? Once CI is green we can merge.
- packages/angular-virtual/e2e/app/src/app/measure-element.component.ts line 42Outdated@@ -0,0 +22,21 @@22+23+@Component({24+ standalone: true,25+ selector: 'app-measure-element',26+ changeDetection: ChangeDetectionStrategy.OnPush,27+ template: `28+ <div #scrollElement id="scroll-container" style="height: 400px; overflow: auto;">29+ <div30+ style="position: relative; width: 100%;"31+ [style.height.px]="virtualizer.getTotalSize()"32+ >33+ @for (row of virtualizer.getVirtualItems(); track itemKey(row.index)) {34+ <div35+ #virtualItem36+ [attr.data-testid]="itemKey(row.index)"37+ [attr.data-index]="row.index"38+ style="position: absolute; top: 0; left: 0; width: 100%;"39+ [style.transform]="'translateY(' + row.start + 'px)'"40+ >41+ <div style="display: flex; gap: 8px; align-items: center; padding: 4px;">42+ <span>Row {{ itemFor(row.index).label }}</span>
You could use
@let item = this.items()[$index]anditem.idto avoid itemFor/itemKey - packages/angular-virtual/src/index.ts line 30@@ -16,12 +16,12 @@1616 observeWindowRect,1717 windowScroll,1818 } from '@tanstack/virtual-core'19-import { proxyVirtualizer } from './proxy'20-import type { ElementRef, Signal } from '@angular/core'19+import { signalProxy } from './proxy'20+import type { ElementRef } from '@angular/core'2121 import type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'2222 import type { AngularVirtualizer } from './types'23232424 export * from '@tanstack/virtual-core'2525 export * from './types'262627-function createVirtualizerBase<27+export type AngularVirtualizerOptions<
It may be useful to add an injector option to pass to the 2 afterRenderEffects
Actionable comments posted: 5
♻️ Duplicate comments (6)
packages/angular-virtual/e2e/app/src/app/scroll.component.ts (1)
8-9: ⚠️ Potential issue | 🟡 MinorResolve the remaining lint blockers.
#measureItemsis only used to retain the effect registration, so it still tripsno-unused-private-class-members. Register the effect in the constructor and move the@tanstack/angular-virtualvalue import before the type import.🧹 Proposed fix
} from '@angular/core' -import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' +import type { ElementRef } from '@angular/core' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.count, estimateSize: () => 50, initialOffset: this.initialOffset, debug: true, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }Also applies to: 84-98
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/scroll.component.ts` around lines 8 - 9, Move the effect registration out of the unused private field by calling the effect registration in the class constructor (so remove/stop using the private member `#measureItems`), and reorder imports so the value import from `@tanstack/angular-virtual` (`injectVirtualizer`) appears before the type import `ElementRef` from `@angular/core`; update the constructor to invoke `injectVirtualizer()` (or the existing effect registration logic) to retain the behavior and eliminate the `no-unused-private-class-members` lint error while keeping `measureItems` functionality inline.packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts (1)
8-9: ⚠️ Potential issue | 🟡 MinorClear the unused private field lint error.
#measureItemsis never read. InvokeafterRenderEffectfrom the constructor and place the value import before the type import.🧹 Proposed fix
} from '@angular/core' -import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' +import type { ElementRef } from '@angular/core' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.count, estimateSize: () => 50, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }Also applies to: 89-101
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts` around lines 8 - 9, Remove the unused private field `#measureItems` and instead invoke afterRenderEffect from the component constructor to initialize measurement logic; also reorder the imports so the value import injectVirtualizer appears before the type-only import ElementRef (i.e., import injectVirtualizer first, then import type { ElementRef }), and apply the same change to the duplicate block around lines 89-101 to clear the unused-field lint error and ensure afterRenderEffect runs on construction.packages/angular-virtual/e2e/app/src/app/measure-element.component.ts (1)
9-10: ⚠️ Potential issue | 🟡 MinorRemove the unused private field and fix import order.
The render effect can be registered directly in the constructor; keeping the handle in
#measureItemsblocks lint because it is never read.🧹 Proposed fix
} from '@angular/core' -import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' +import type { ElementRef } from '@angular/core' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.items().length, estimateSize: () => 36, getItemKey: (index) => this.items()[index]!.id, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }Also applies to: 83-96
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/measure-element.component.ts` around lines 9 - 10, Remove the unused private field `#measureItems` from measure-element.component.ts and register the render effect directly in the component constructor instead of storing a handle; update the import order so `ElementRef` import appears before `injectVirtualizer` for lint consistency. Specifically, delete the `#measureItems` declaration, move the call that registers the render effect into the `constructor` where `injectVirtualizer` is used (remove any assignment like `this.#measureItems = ...`), and reorder the imports to `import type { ElementRef } from '@angular/core'` followed by `import { injectVirtualizer } from '@tanstack/angular-virtual'`.packages/angular-virtual/src/index.ts (1)
162-189: ⚠️ Potential issue | 🟠 MajorThread
AngularExtensionOptionsthrough the public injectors.injectVirtualizerBasesupportsextensions.injector, but neither exported helper accepts or forwards it. Consumers cannot use the newly exportedAngularExtensionOptionssurface.🔧 Proposed fix
export function injectVirtualizer< TScrollElement extends Element, TItemElement extends Element, >( options: () => PartialKeys< Omit<AngularVirtualizerOptions<TScrollElement, TItemElement>, 'getScrollElement'>, 'observeElementRect' | 'observeElementOffset' | 'scrollToFn' > & { scrollElement: ElementRef<TScrollElement> | TScrollElement | undefined }, + extensions: AngularExtensionOptions = {}, ): AngularVirtualizer<TScrollElement, TItemElement> { return injectVirtualizerBase<TScrollElement, TItemElement>(() => { const _options = options() return { @@ ..._options, } - }) + }, extensions) } @@ export function injectWindowVirtualizer<TItemElement extends Element>( options: () => PartialKeys< AngularVirtualizerOptions<Window, TItemElement>, | 'getScrollElement' | 'observeElementRect' | 'observeElementOffset' | 'scrollToFn' >, + extensions: AngularExtensionOptions = {}, ): AngularVirtualizer<Window, TItemElement> { return injectVirtualizerBase<Window, TItemElement>(() => ({ getScrollElement: () => (typeof document !== 'undefined' ? window : null), observeElementRect: observeWindowRect, @@ initialOffset: () => typeof document !== 'undefined' ? window.scrollY : 0, ...options(), - })) + }), extensions) }Also applies to: 198-215
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/index.ts` around lines 162 - 189, The public injectors (injectVirtualizer and the other exported helper around lines 198–215) currently drop extensions.injector when calling injectVirtualizerBase, preventing consumers from using AngularExtensionOptions; update both injectors to read extensions from the caller-provided _options and forward extensions.injector into the object passed to injectVirtualizerBase (i.e., ensure the returned object includes extensions: { ..._options.extensions, injector: _options.extensions?.injector } or simply spread _options.extensions so injector is preserved), referring to injectVirtualizerBase, injectVirtualizer, and the other exported helper so the extension injector flows through.packages/angular-virtual/e2e/app/src/app/stale-index.component.ts (1)
9-10: ⚠️ Potential issue | 🟡 MinorRegister the measurement effect without an unused field.
#measureItemsis only assigned, never read, so lint still fails. Move the effect into the constructor and fix the value/type import order.🧹 Proposed fix
} from '@angular/core' -import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' +import type { ElementRef } from '@angular/core' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.items().length, estimateSize: () => 50, @@ return items[index]!.id }, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }Also applies to: 68-89
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/stale-index.component.ts` around lines 9 - 10, Remove the unused private field `#measureItems` and register the measurement effect directly inside the component constructor by calling injectVirtualizer().registerMeasurementEffect (or the appropriate measurement registration method) there instead of assigning it to `#measureItems`; also swap the import order so value imports (injectVirtualizer) come before type-only imports (ElementRef) to satisfy the linter and TypeScript import ordering rules. Ensure all references to `#measureItems` are removed and the constructor contains the effect registration so measurement runs without leaving an unused field.packages/angular-virtual/src/proxy.ts (1)
79-90: ⚠️ Potential issue | 🟡 MinorReturn property descriptors only for actual properties.
Line 85 still reports every key as an own property, so
Object.hasOwn(proxy, 'missing')returnstruewhile'missing' in proxyreturnsfalse. Keephas,ownKeys, andgetOwnPropertyDescriptoraligned with the target/input object.🐛 Proposed descriptor trap fix
- has(_, property: PropertyKey) { - return property in untracked(inputSignal) + has(target, property: PropertyKey) { + return Reflect.has(target, property) || property in untracked(inputSignal) }, - ownKeys() { - return Reflect.ownKeys(untracked(inputSignal)) + ownKeys(target) { + return Array.from( + new Set([ + ...Reflect.ownKeys(target), + ...Reflect.ownKeys(untracked(inputSignal)), + ]), + ) }, - getOwnPropertyDescriptor() { - return { - enumerable: true, - configurable: true, - } + getOwnPropertyDescriptor(target, property) { + const targetDescriptor = Reflect.getOwnPropertyDescriptor(target, property) + if (targetDescriptor) return targetDescriptor + + const inputDescriptor = Reflect.getOwnPropertyDescriptor( + untracked(inputSignal), + property, + ) + if (!inputDescriptor) return undefined + + return { + ...inputDescriptor, + configurable: true, + } },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/proxy.ts` around lines 79 - 90, The proxy traps are returning fabricated descriptors causing Object.hasOwn(proxy, ...) to report keys that don't actually exist; update the traps to operate against the real target (use const target = untracked(inputSignal)) and delegate to Reflect for accurate behavior: implement has as return Reflect.has(target, property), ownKeys as return Reflect.ownKeys(target), and getOwnPropertyDescriptor to return Reflect.getOwnPropertyDescriptor(target, property) (or undefined) instead of always returning an enumerable/configurable stub. Ensure all three traps use the same untracked(inputSignal) target reference so they stay aligned.🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed. Inline comments: In `@packages/angular-virtual/e2e/app/src/app/app.config.ts`: - Around line 1-3: Reorder the imports in app.config.ts so the value imports come first and the type-only import follows; specifically, move the type-only import of ApplicationConfig to after the imports of provideRouter and routes (i.e., import provideRouter from '@angular/router' and routes from './app.routes' first, then import type { ApplicationConfig } from '@angular/core') to satisfy the configured import ordering rule. In `@packages/angular-virtual/e2e/app/src/app/app.routes.ts`: - Around line 1-5: The type-only import "Routes" should be moved below the value imports to satisfy import ordering: place "import type { Routes } from '@angular/router'" after the imports of MeasureElementComponent, SmoothScrollComponent, ScrollComponent, and StaleIndexComponent so the value imports come first and the type import is last; update the top of app.routes.ts accordingly to keep the same exported route table unchanged. In `@packages/angular-virtual/e2e/app/test/scroll.spec.ts`: - Around line 63-72: The page.evaluate block computes Math.min over indices but doesn't guard the empty case, resulting in Infinity and a false-positive; inside the evaluate callback (the anonymous function that sets container/items/indices and returns Math.min(...indices)) add a check for indices.length === 0 and either throw a clear Error('No rendered [data-index] items') or return a sentinel (e.g. -1) so the test fails deterministically instead of getting Infinity; update the surrounding expectation if you choose a sentinel (visibleIndex should be > 0 remains valid when returning -1) and keep references to visibleIndex, container, items, and indices to locate the change. In `@packages/angular-virtual/e2e/app/test/stale-index.spec.ts`: - Around line 13-16: After scrolling the container (container.evaluate((el) => (el.scrollTop = el.scrollHeight))), replace the fixed sleep await page.waitForTimeout(100) with an explicit wait that asserts the tail row is actually rendered/observed before proceeding: locate the last item (use the test id or selector for the tail item, e.g. the locator for the final row) and call a proper wait (waitForSelector or locator.waitFor / waitForElementState('visible')) to ensure the tail element is in the DOM and visible; this guarantees the bottom rows are observed by ResizeObserver before removing rows instead of relying on a timeout. In `@packages/angular-virtual/src/proxy.ts`: - Around line 4-18: The SignalProxy type lacks a callable signature while the runtime returns a callable proxy via callableTarget and the apply trap, so calls like proxy() are typed as errors; update the SignalProxy type declaration to include a call signature (for example add (this: any, ...args: any[]) => any or a more specific signature) alongside the mapped properties so the type reflects the runtime callable behavior—modify the SignalProxy type itself to be the intersection of the existing mapped member types and a function signature to match signalProxy/callableTarget/apply. --- Duplicate comments: In `@packages/angular-virtual/e2e/app/src/app/measure-element.component.ts`: - Around line 9-10: Remove the unused private field `#measureItems` from measure-element.component.ts and register the render effect directly in the component constructor instead of storing a handle; update the import order so `ElementRef` import appears before `injectVirtualizer` for lint consistency. Specifically, delete the `#measureItems` declaration, move the call that registers the render effect into the `constructor` where `injectVirtualizer` is used (remove any assignment like `this.#measureItems = ...`), and reorder the imports to `import type { ElementRef } from '@angular/core'` followed by `import { injectVirtualizer } from '@tanstack/angular-virtual'`. In `@packages/angular-virtual/e2e/app/src/app/scroll.component.ts`: - Around line 8-9: Move the effect registration out of the unused private field by calling the effect registration in the class constructor (so remove/stop using the private member `#measureItems`), and reorder imports so the value import from `@tanstack/angular-virtual` (`injectVirtualizer`) appears before the type import `ElementRef` from `@angular/core`; update the constructor to invoke `injectVirtualizer()` (or the existing effect registration logic) to retain the behavior and eliminate the `no-unused-private-class-members` lint error while keeping `measureItems` functionality inline. In `@packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts`: - Around line 8-9: Remove the unused private field `#measureItems` and instead invoke afterRenderEffect from the component constructor to initialize measurement logic; also reorder the imports so the value import injectVirtualizer appears before the type-only import ElementRef (i.e., import injectVirtualizer first, then import type { ElementRef }), and apply the same change to the duplicate block around lines 89-101 to clear the unused-field lint error and ensure afterRenderEffect runs on construction. In `@packages/angular-virtual/e2e/app/src/app/stale-index.component.ts`: - Around line 9-10: Remove the unused private field `#measureItems` and register the measurement effect directly inside the component constructor by calling injectVirtualizer().registerMeasurementEffect (or the appropriate measurement registration method) there instead of assigning it to `#measureItems`; also swap the import order so value imports (injectVirtualizer) come before type-only imports (ElementRef) to satisfy the linter and TypeScript import ordering rules. Ensure all references to `#measureItems` are removed and the constructor contains the effect registration so measurement runs without leaving an unused field. In `@packages/angular-virtual/src/index.ts`: - Around line 162-189: The public injectors (injectVirtualizer and the other exported helper around lines 198–215) currently drop extensions.injector when calling injectVirtualizerBase, preventing consumers from using AngularExtensionOptions; update both injectors to read extensions from the caller-provided _options and forward extensions.injector into the object passed to injectVirtualizerBase (i.e., ensure the returned object includes extensions: { ..._options.extensions, injector: _options.extensions?.injector } or simply spread _options.extensions so injector is preserved), referring to injectVirtualizerBase, injectVirtualizer, and the other exported helper so the extension injector flows through. In `@packages/angular-virtual/src/proxy.ts`: - Around line 79-90: The proxy traps are returning fabricated descriptors causing Object.hasOwn(proxy, ...) to report keys that don't actually exist; update the traps to operate against the real target (use const target = untracked(inputSignal)) and delegate to Reflect for accurate behavior: implement has as return Reflect.has(target, property), ownKeys as return Reflect.ownKeys(target), and getOwnPropertyDescriptor to return Reflect.getOwnPropertyDescriptor(target, property) (or undefined) instead of always returning an enumerable/configurable stub. Ensure all three traps use the same untracked(inputSignal) target reference so they stay aligned.🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
1039da93-7198-42ef-bfd0-1c3e9f95ba89📥 Commits
Reviewing files that changed from the base of the PR and between 34b80846004747b1e9377078700776bd32e98910 and 156153a61bd223145ae4551db4b102d69d618032.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (70)
.changeset/gold-days-greet.mddocs/framework/angular/angular-virtual.mdexamples/angular/dynamic/package.jsonexamples/angular/fixed/package.jsonexamples/angular/infinite-scroll/package.jsonexamples/angular/padding/package.jsonexamples/angular/smooth-scroll/package.jsonexamples/angular/sticky/package.jsonexamples/angular/table/package.jsonexamples/angular/variable/package.jsonexamples/angular/window/package.jsonexamples/lit/dynamic/package.jsonexamples/lit/fixed/package.jsonexamples/react/dynamic/package.jsonexamples/react/fixed/package.jsonexamples/react/infinite-scroll/package.jsonexamples/react/padding/package.jsonexamples/react/scroll-padding/package.jsonexamples/react/smooth-scroll/package.jsonexamples/react/sticky/package.jsonexamples/react/table/package.jsonexamples/react/variable/package.jsonexamples/react/window/package.jsonexamples/svelte/dynamic/package.jsonexamples/svelte/fixed/package.jsonexamples/svelte/infinite-scroll/package.jsonexamples/svelte/smooth-scroll/package.jsonexamples/svelte/sticky/package.jsonexamples/svelte/table/package.jsonexamples/vue/dynamic/package.jsonexamples/vue/fixed/package.jsonexamples/vue/infinite-scroll/package.jsonexamples/vue/padding/package.jsonexamples/vue/scroll-padding/package.jsonexamples/vue/smooth-scroll/package.jsonexamples/vue/sticky/package.jsonexamples/vue/table/package.jsonexamples/vue/variable/package.jsonknip.jsonpackage.jsonpackages/angular-virtual/README.mdpackages/angular-virtual/angular.jsonpackages/angular-virtual/e2e/app/angular.jsonpackages/angular-virtual/e2e/app/src/app/app.component.tspackages/angular-virtual/e2e/app/src/app/app.config.tspackages/angular-virtual/e2e/app/src/app/app.routes.tspackages/angular-virtual/e2e/app/src/app/measure-element.component.tspackages/angular-virtual/e2e/app/src/app/scroll.component.tspackages/angular-virtual/e2e/app/src/app/smooth-scroll.component.tspackages/angular-virtual/e2e/app/src/app/stale-index.component.tspackages/angular-virtual/e2e/app/src/index.htmlpackages/angular-virtual/e2e/app/src/main.tspackages/angular-virtual/e2e/app/src/styles.csspackages/angular-virtual/e2e/app/test/measure-element.spec.tspackages/angular-virtual/e2e/app/test/scroll.spec.tspackages/angular-virtual/e2e/app/test/smooth-scroll.spec.tspackages/angular-virtual/e2e/app/test/stale-index.spec.tspackages/angular-virtual/e2e/app/tsconfig.app.jsonpackages/angular-virtual/e2e/app/tsconfig.jsonpackages/angular-virtual/ng-package.jsonpackages/angular-virtual/package.jsonpackages/angular-virtual/playwright.config.tspackages/angular-virtual/src/index.tspackages/angular-virtual/src/proxy.tspackages/angular-virtual/src/types.tspackages/angular-virtual/tsconfig.build.jsonpackages/angular-virtual/tsconfig.jsonpackages/angular-virtual/vite.config.tspackages/react-virtual/e2e/app/test/scroll.spec.tspackages/virtual-core/tests/index.test.ts
💤 Files with no reviewable changes (2)
- packages/angular-virtual/ng-package.json
- packages/angular-virtual/tsconfig.build.json
✅ Files skipped from review due to trivial changes (49)
- examples/react/variable/package.json
- examples/svelte/fixed/package.json
- examples/react/smooth-scroll/package.json
- packages/angular-virtual/e2e/app/src/styles.css
- .changeset/gold-days-greet.md
- examples/react/window/package.json
- examples/react/infinite-scroll/package.json
- examples/react/sticky/package.json
- examples/vue/smooth-scroll/package.json
- examples/svelte/sticky/package.json
- packages/react-virtual/e2e/app/test/scroll.spec.ts
- packages/angular-virtual/README.md
- examples/svelte/dynamic/package.json
- examples/vue/infinite-scroll/package.json
- examples/react/table/package.json
- examples/react/fixed/package.json
- examples/svelte/smooth-scroll/package.json
- examples/lit/fixed/package.json
- knip.json
- examples/vue/fixed/package.json
- packages/angular-virtual/tsconfig.json
- examples/react/padding/package.json
- examples/svelte/table/package.json
- examples/vue/variable/package.json
- packages/angular-virtual/e2e/app/src/index.html
- examples/vue/padding/package.json
- examples/angular/dynamic/package.json
- package.json
- examples/vue/sticky/package.json
- examples/svelte/infinite-scroll/package.json
- examples/angular/fixed/package.json
- examples/angular/variable/package.json
- packages/angular-virtual/e2e/app/tsconfig.app.json
- examples/angular/smooth-scroll/package.json
- examples/angular/window/package.json
- packages/angular-virtual/e2e/app/src/app/app.component.ts
- examples/vue/dynamic/package.json
- packages/angular-virtual/vite.config.ts
- examples/angular/padding/package.json
- packages/angular-virtual/e2e/app/tsconfig.json
- packages/angular-virtual/angular.json
- packages/virtual-core/tests/index.test.ts
- examples/angular/infinite-scroll/package.json
- examples/react/dynamic/package.json
- docs/framework/angular/angular-virtual.md
- examples/lit/dynamic/package.json
- packages/angular-virtual/e2e/app/angular.json
- examples/angular/table/package.json
- packages/angular-virtual/e2e/app/test/smooth-scroll.spec.ts
🚧 Files skipped from review as they are similar to previous changes (9)
- examples/vue/scroll-padding/package.json
- examples/angular/sticky/package.json
- packages/angular-virtual/e2e/app/src/main.ts
- examples/react/scroll-padding/package.json
- examples/vue/table/package.json
- packages/angular-virtual/e2e/app/test/measure-element.spec.ts
- packages/angular-virtual/playwright.config.ts
- packages/angular-virtual/src/types.ts
- packages/angular-virtual/package.json
packages/angular-virtual/e2e/app/src/app/app.config.ts lines 1 to 3@@ -0,0 +1,3 @@1+import type { ApplicationConfig } from '@angular/core'2+import { provideRouter } from '@angular/router'3+import { routes } from './app.routes'⚠️ Potential issue | 🟡 Minor
Fix the import ordering lint failure.
ApplicationConfigis already type-only, but the configured import order expects type imports after these value imports.🧹 Proposed fix
-import type { ApplicationConfig } from '@angular/core' import { provideRouter } from '@angular/router' import { routes } from './app.routes' +import type { ApplicationConfig } from '@angular/core'📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import { provideRouter } from '@angular/router' import { routes } from './app.routes' import type { ApplicationConfig } from '@angular/core'🧰 Tools
🪛 ESLint
[error] 1-1:
@angular/coretype import should occur after import of./app.routes(import/order)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/app.config.ts` around lines 1 - 3, Reorder the imports in app.config.ts so the value imports come first and the type-only import follows; specifically, move the type-only import of ApplicationConfig to after the imports of provideRouter and routes (i.e., import provideRouter from '@angular/router' and routes from './app.routes' first, then import type { ApplicationConfig } from '@angular/core') to satisfy the configured import ordering rule.packages/angular-virtual/e2e/app/src/app/app.routes.ts lines 1 to 5@@ -0,0 +1,5 @@1+import type { Routes } from '@angular/router'2+import { MeasureElementComponent } from './measure-element.component'3+import { SmoothScrollComponent } from './smooth-scroll.component'4+import { ScrollComponent } from './scroll.component'5+import { StaleIndexComponent } from './stale-index.component'⚠️ Potential issue | 🟡 Minor
Move the type import after value imports.
This should clear the remaining
import/ordererror for the route table.🧹 Proposed fix
-import type { Routes } from '@angular/router' import { MeasureElementComponent } from './measure-element.component' import { SmoothScrollComponent } from './smooth-scroll.component' import { ScrollComponent } from './scroll.component' import { StaleIndexComponent } from './stale-index.component' +import type { Routes } from '@angular/router'🧰 Tools
🪛 ESLint
[error] 1-1:
@angular/routertype import should occur after import of./stale-index.component(import/order)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/app.routes.ts` around lines 1 - 5, The type-only import "Routes" should be moved below the value imports to satisfy import ordering: place "import type { Routes } from '@angular/router'" after the imports of MeasureElementComponent, SmoothScrollComponent, ScrollComponent, and StaleIndexComponent so the value imports come first and the type import is last; update the top of app.routes.ts accordingly to keep the same exported route table unchanged.packages/angular-virtual/e2e/app/test/scroll.spec.ts lines 63 to 72@@ -0,0 +52,21 @@52+ expect(atBottom).toBeLessThan(1.01)53+})54+55+test('renders correctly with initialOffset and user scroll up', async ({56+ page,57+}) => {58+ // Start at offset 5000 (no programmatic scrollToIndex)59+ await page.goto('/scroll/?initialOffset=5000')60+ await page.waitForTimeout(500)61+62+ // Items around offset 5000 should be visible63+ const visibleIndex = await page.evaluate(() => {64+ const container = document.querySelector('#scroll-container')65+ if (!container) throw new Error('Container not found')66+ const items = container.querySelectorAll('[data-index]')67+ const indices = Array.from(items).map((el) =>68+ Number(el.getAttribute('data-index')),69+ )70+ return Math.min(...indices)71+ })72+ expect(visibleIndex).toBeGreaterThan(0)⚠️ Potential issue | 🟡 Minor
Guard against an empty rendered set before taking
Math.min.Line 70 returns
Infinitywhen no[data-index]nodes are rendered, soexpect(visibleIndex).toBeGreaterThan(0)still passes and this initial-offset check can false-positive.🐛 Proposed fix
const indices = Array.from(items).map((el) => Number(el.getAttribute('data-index')), ) + if (indices.length === 0) { + throw new Error('No rendered items found') + } return Math.min(...indices)📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const visibleIndex = await page.evaluate(() => { const container = document.querySelector('#scroll-container') if (!container) throw new Error('Container not found') const items = container.querySelectorAll('[data-index]') const indices = Array.from(items).map((el) => Number(el.getAttribute('data-index')), ) if (indices.length === 0) { throw new Error('No rendered items found') } return Math.min(...indices) }) expect(visibleIndex).toBeGreaterThan(0)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/test/scroll.spec.ts` around lines 63 - 72, The page.evaluate block computes Math.min over indices but doesn't guard the empty case, resulting in Infinity and a false-positive; inside the evaluate callback (the anonymous function that sets container/items/indices and returns Math.min(...indices)) add a check for indices.length === 0 and either throw a clear Error('No rendered [data-index] items') or return a sentinel (e.g. -1) so the test fails deterministically instead of getting Infinity; update the surrounding expectation if you choose a sentinel (visibleIndex should be > 0 remains valid when returning -1) and keep references to visibleIndex, container, items, and indices to locate the change.packages/angular-virtual/e2e/app/test/stale-index.spec.ts lines 13 to 16@@ -0,0 +1,16 @@1+import { expect, test } from '@playwright/test'2+3+test('does not call getItemKey with stale index after removing items', async ({4+ page,5+}) => {6+ await page.goto('/stale-index/')7+8+ // Verify initial state9+ await expect(page.locator('[data-testid="item-count"]')).toHaveText(10+ 'Count: 20',11+ )12+13+ // Scroll to the bottom so the last items are rendered and observed by ResizeObserver14+ const container = page.locator('[data-testid="scroll-container"]')15+ await container.evaluate((el) => (el.scrollTop = el.scrollHeight))16+ await page.waitForTimeout(100)⚠️ Potential issue | 🟡 Minor
Assert the tail item is rendered before removing rows.
The stale-index regression depends on bottom rows being rendered/observed first. A fixed sleep can let the test pass even if the scroll did not actually materialize the tail.
🧪 Proposed fix
// Scroll to the bottom so the last items are rendered and observed by ResizeObserver const container = page.locator('[data-testid="scroll-container"]') await container.evaluate((el) => (el.scrollTop = el.scrollHeight)) - await page.waitForTimeout(100) + await expect(page.locator('[data-testid="item-19"]')).toBeVisible()📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
// Scroll to the bottom so the last items are rendered and observed by ResizeObserver const container = page.locator('[data-testid="scroll-container"]') await container.evaluate((el) => (el.scrollTop = el.scrollHeight)) await expect(page.locator('[data-testid="item-19"]')).toBeVisible()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/test/stale-index.spec.ts` around lines 13 - 16, After scrolling the container (container.evaluate((el) => (el.scrollTop = el.scrollHeight))), replace the fixed sleep await page.waitForTimeout(100) with an explicit wait that asserts the tail row is actually rendered/observed before proceeding: locate the last item (use the test id or selector for the tail item, e.g. the locator for the final row) and call a proper wait (waitForSelector or locator.waitFor / waitForElementState('visible')) to ensure the tail element is in the DOM and visible; this guarantees the bottom rows are observed by ResizeObserver before removing rows instead of relying on a timeout.packages/angular-virtual/src/proxy.ts lines 4 to 18Outdated@@ -5,5 +2,17 @@2+import type { Signal } from '@angular/core'536-export function proxyVirtualizer<7- V extends Virtualizer<any, any>,8- S extends Element | Window = V extends Virtualizer<infer U, any> ? U : never,9- I extends Element = V extends Virtualizer<any, infer U> ? U : never,4+type SignalProxy<5+ TInput extends Record<string | symbol, any>,6+ TMethodsToPassThrough extends keyof TInput,7+ TAttributesToTransformToSignals extends keyof TInput,8+ TMethodsToTrack extends keyof TInput,9+ TMethodsToTransformToSignals extends keyof TInput,10+> = {11+ [K in TMethodsToPassThrough]: TInput[K]12+} & {13+ [K in TAttributesToTransformToSignals]: Signal<TInput[K]>14+ } & {15+ [K in TMethodsToTrack]: TInput[K]16+ } & {17+ [K in TMethodsToTransformToSignals]: Signal<ReturnType<TInput[K]>>18+ }⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
cat -n packages/angular-virtual/src/proxy.tsRepository: TanStack/virtual
Length of output: 4351
Add call signature to
SignalProxytype to match the runtime callable behavior.signalProxyreturns a callable proxy viacallableTargetand theapplytrap, butSignalProxylacks a call signature. This causesproxy()to be a type error despite the implementation supporting it.🐛 Proposed type fix
type SignalProxy< TInput extends Record<string | symbol, any>, TMethodsToPassThrough extends keyof TInput, TAttributesToTransformToSignals extends keyof TInput, TMethodsToTrack extends keyof TInput, TMethodsToTransformToSignals extends keyof TInput, -> = { +> = (() => TInput) & { [K in TMethodsToPassThrough]: TInput[K] } & {📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
type SignalProxy< TInput extends Record<string | symbol, any>, TMethodsToPassThrough extends keyof TInput, TAttributesToTransformToSignals extends keyof TInput, TMethodsToTrack extends keyof TInput, TMethodsToTransformToSignals extends keyof TInput, > = (() => TInput) & { [K in TMethodsToPassThrough]: TInput[K] } & { [K in TAttributesToTransformToSignals]: Signal<TInput[K]> } & { [K in TMethodsToTrack]: TInput[K] } & { [K in TMethodsToTransformToSignals]: Signal<ReturnType<TInput[K]>> }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/proxy.ts` around lines 4 - 18, The SignalProxy type lacks a callable signature while the runtime returns a callable proxy via callableTarget and the apply trap, so calls like proxy() are typed as errors; update the SignalProxy type declaration to include a call signature (for example add (this: any, ...args: any[]) => any or a more specific signature) alongside the mapped properties so the type reflects the runtime callable behavior—modify the SignalProxy type itself to be the intersection of the existing mapped member types and a function signature to match signalProxy/callableTarget/apply.More templates
- @tanstack/virtual-example-angular-dynamic
- @tanstack/virtual-example-angular-fixed
- @tanstack/virtual-example-angular-infinite-scroll
- @tanstack/virtual-example-angular-padding
- @tanstack/virtual-example-angular-smooth-scroll
- @tanstack/virtual-example-angular-sticky
- @tanstack/virtual-example-angular-table
- @tanstack/virtual-example-angular-variable
- @tanstack/virtual-example-angular-window
- tanstack-lit-virtual-example-dynamic
- tanstack-lit-virtual-example-fixed
- tanstack-react-virtual-example-dynamic
- tanstack-react-virtual-example-fixed
- tanstack-react-virtual-example-infinite-scroll
- tanstack-react-virtual-example-padding
- tanstack-react-virtual-example-scroll-padding
- tanstack-react-virtual-example-smooth-scroll
- tanstack-react-virtual-example-sticky
- tanstack-react-virtual-example-table
- tanstack-react-virtual-example-variable
- tanstack-react-virtual-example-window
- tanstack-svelte-virtual-example-dynamic
- tanstack-svelte-virtual-example-fixed
- tanstack-svelte-virtual-example-infinite-scroll
- tanstack-svelte-virtual-example-smooth-scroll
- tanstack-svelte-virtual-example-sticky
- tanstack-svelte-virtual-example-table
- tanstack-vue-virtual-example-dynamic
- tanstack-vue-virtual-example-fixed
- tanstack-vue-virtual-example-infinite-scroll
- tanstack-vue-virtual-example-padding
- tanstack-vue-virtual-example-scroll-padding
- tanstack-vue-virtual-example-smooth-scroll
- tanstack-vue-virtual-example-sticky
- tanstack-vue-virtual-example-table
- tanstack-vue-virtual-example-variable
@tanstack/angular-virtual
npm i https://pkg.pr.new/@tanstack/angular-virtual@1158@tanstack/lit-virtual
npm i https://pkg.pr.new/@tanstack/lit-virtual@1158@tanstack/react-virtual
npm i https://pkg.pr.new/@tanstack/react-virtual@1158@tanstack/solid-virtual
npm i https://pkg.pr.new/@tanstack/solid-virtual@1158@tanstack/svelte-virtual
npm i https://pkg.pr.new/@tanstack/svelte-virtual@1158@tanstack/virtual-core
npm i https://pkg.pr.new/@tanstack/virtual-core@1158@tanstack/vue-virtual
npm i https://pkg.pr.new/@tanstack/vue-virtual@1158commit:
82d7e83♻️ Duplicate comments (6)
packages/angular-virtual/e2e/app/src/app/stale-index.component.ts (1)
9-10: ⚠️ Potential issue | 🟡 MinorClear the remaining lint blockers.
Move the value import before the type import, and invoke
afterRenderEffect()from the constructor instead of assigning it to an unused private member.Lint fix
} from '@angular/core' -import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' +import type { ElementRef } from '@angular/core' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.items().length, estimateSize: () => 50, @@ return items[index]!.id }, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }Also applies to: 76-82
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/stale-index.component.ts` around lines 9 - 10, Reorder the imports so any value imports (e.g., injectVirtualizer) come before type-only imports (e.g., type ElementRef) and remove the unused private field that stores afterRenderEffect; instead call afterRenderEffect() inside the component constructor (replace the unused assignment with a direct invocation). Update the import order to place value imports first, delete the unused private member, and add a call to afterRenderEffect() in the constructor of the component that uses injectVirtualizer/ElementRef.packages/angular-virtual/src/proxy.ts (2)
91-102: ⚠️ Potential issue | 🟡 MinorReturn descriptors only for real properties.
getOwnPropertyDescriptor()currently reports every property as present, whilehas()only checks the current signal value. That makesObject.hasOwn(proxy, 'missing')true for missing fields and can violate Proxy meta-operation expectations.Descriptor trap fix
has(_, property: PropertyKey) { - return property in untracked(inputSignal) + return property in callableTarget || property in untracked(inputSignal) }, ownKeys() { - return Reflect.ownKeys(untracked(inputSignal)) + return [ + ...new Set([ + ...Reflect.ownKeys(callableTarget), + ...Reflect.ownKeys(untracked(inputSignal)), + ]), + ] }, - getOwnPropertyDescriptor() { + getOwnPropertyDescriptor(target, property) { + const targetDescriptor = Reflect.getOwnPropertyDescriptor(target, property) + if (targetDescriptor) return targetDescriptor + + const input = untracked(inputSignal) + const inputDescriptor = Reflect.getOwnPropertyDescriptor(input, property) + if (!inputDescriptor) return undefined + return { - enumerable: true, + enumerable: inputDescriptor.enumerable, configurable: true, } },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/proxy.ts` around lines 91 - 102, getOwnPropertyDescriptor currently returns a blanket descriptor for every property which contradicts has() and ownKeys(); update getOwnPropertyDescriptor to read the current target via untracked(inputSignal), check Reflect.has or Object.prototype.hasOwnProperty on that target for the requested property, and if missing return undefined; if present return a proper descriptor (value: target[prop], writable: true, enumerable: true, configurable: true) so Proxy meta-ops remain consistent with has/ownKeys (refer to getOwnPropertyDescriptor, has, ownKeys, inputSignal, untracked).
4-18: ⚠️ Potential issue | 🟡 MinorAdd the callable signature to
SignalProxy.The returned proxy is callable via
apply(), but the exported type still models only properties, soproxy()remains a type error even though it works at runtime.Type fix
type SignalProxy< TInput extends Record<string | symbol, any>, TMethodsToPassThrough extends keyof TInput, TAttributesToTransformToSignals extends keyof TInput, TMethodsToTrack extends keyof TInput, TMethodsToTransformToSignals extends keyof TInput, -> = { +> = (() => TInput) & { [K in TMethodsToPassThrough]: TInput[K] } & { [K in TAttributesToTransformToSignals]: Signal<TInput[K]> } & {Also applies to: 39-46
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/proxy.ts` around lines 4 - 18, SignalProxy models only properties but not the callable form, so calling the proxy (proxy()) types as an error; update the SignalProxy type to include a callable signature (i.e., intersect the existing mapped-property type with a function type like (...args: any[]) => any or a more specific (...args: Parameters<...>) => ReturnType<...>) so the proxy instance supports apply()/call() at the type level; modify the SignalProxy declaration to append that function signature and make the same change for the other duplicate declaration(s) that define the proxy shape.packages/angular-virtual/e2e/app/src/app/scroll.component.ts (1)
8-9: ⚠️ Potential issue | 🟡 MinorClear the remaining lint blockers.
The
afterRenderEffect()result is stored only to satisfy side effects, but the private field is unused. Invoke it in the constructor and reorder the imports.Lint fix
} from '@angular/core' -import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' +import type { ElementRef } from '@angular/core' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.count, estimateSize: () => 50, initialOffset: this.initialOffset, debug: true, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }Also applies to: 94-100
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/scroll.component.ts` around lines 8 - 9, The private field used only to hold the result of afterRenderEffect() is unused; instead call afterRenderEffect() in the constructor (or appropriate initializer) so the side-effect runs without storing it, remove the unused private field, and reorder imports so ElementRef is imported before injectVirtualizer; update the same pattern in the other occurrence referenced (lines 94-100) by locating afterRenderEffect() usage and replacing the stored-unused assignment with a direct invocation in the constructor and removing the unused field.packages/angular-virtual/e2e/app/src/app/measure-element.component.ts (1)
8-10: ⚠️ Potential issue | 🟡 MinorClear the remaining lint blockers.
Move the value import before the type import, and don’t store the
afterRenderEffect()handle in an unused private field.Lint fix
} from '@angular/core' -import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' +import type { ElementRef } from '@angular/core' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.items().length, estimateSize: () => 36, getItemKey: (index) => this.items()[index]!.id, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }Also applies to: 89-95
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/measure-element.component.ts` around lines 8 - 10, Reorder the imports so value imports come before type-only imports (move import { injectVirtualizer } from '@tanstack/angular-virtual' to appear before import type { ElementRef } from '@angular/core'), and remove the unused private field that stores the handle returned from afterRenderEffect() in measure-element.component (do not keep the assigned handle; either call afterRenderEffect(...) without assigning or use the returned handle only if you actually need to dispose it). Ensure you update both occurrences mentioned (around the shown imports and the other instance at lines ~89-95).packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts (1)
8-9: ⚠️ Potential issue | 🟡 MinorClear the remaining lint blockers.
#measureItemsis never read, and the import order still violates the configured rule.Lint fix
} from '@angular/core' -import type { ElementRef } from '@angular/core' import { injectVirtualizer } from '@tanstack/angular-virtual' +import type { ElementRef } from '@angular/core' @@ - `#measureItems` = afterRenderEffect({ - read: () => { - this.virtualItems().forEach((el) => { - this.virtualizer.measureElement(el.nativeElement) - }) - }, - }) - virtualizer = injectVirtualizer(() => ({ scrollElement: this.scrollElement(), count: this.count, estimateSize: () => 50, })) + + constructor() { + afterRenderEffect({ + read: () => { + this.virtualItems().forEach((el) => { + this.virtualizer.measureElement(el.nativeElement) + }) + }, + }) + }Also applies to: 95-101
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts` around lines 8 - 9, Remove the unused private field `#measureItems` (and any duplicate occurrences later in the file) and reorder the top imports to match the project's import-order rule: place external library imports (e.g., the injectVirtualizer import from '@tanstack/angular-virtual') before framework imports (or combine/convert the type import of ElementRef from '@angular/core' to match the configured grouping), so the import lines for injectVirtualizer and ElementRef conform to the lint ordering.🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed. Duplicate comments: In `@packages/angular-virtual/e2e/app/src/app/measure-element.component.ts`: - Around line 8-10: Reorder the imports so value imports come before type-only imports (move import { injectVirtualizer } from '@tanstack/angular-virtual' to appear before import type { ElementRef } from '@angular/core'), and remove the unused private field that stores the handle returned from afterRenderEffect() in measure-element.component (do not keep the assigned handle; either call afterRenderEffect(...) without assigning or use the returned handle only if you actually need to dispose it). Ensure you update both occurrences mentioned (around the shown imports and the other instance at lines ~89-95). In `@packages/angular-virtual/e2e/app/src/app/scroll.component.ts`: - Around line 8-9: The private field used only to hold the result of afterRenderEffect() is unused; instead call afterRenderEffect() in the constructor (or appropriate initializer) so the side-effect runs without storing it, remove the unused private field, and reorder imports so ElementRef is imported before injectVirtualizer; update the same pattern in the other occurrence referenced (lines 94-100) by locating afterRenderEffect() usage and replacing the stored-unused assignment with a direct invocation in the constructor and removing the unused field. In `@packages/angular-virtual/e2e/app/src/app/smooth-scroll.component.ts`: - Around line 8-9: Remove the unused private field `#measureItems` (and any duplicate occurrences later in the file) and reorder the top imports to match the project's import-order rule: place external library imports (e.g., the injectVirtualizer import from '@tanstack/angular-virtual') before framework imports (or combine/convert the type import of ElementRef from '@angular/core' to match the configured grouping), so the import lines for injectVirtualizer and ElementRef conform to the lint ordering. In `@packages/angular-virtual/e2e/app/src/app/stale-index.component.ts`: - Around line 9-10: Reorder the imports so any value imports (e.g., injectVirtualizer) come before type-only imports (e.g., type ElementRef) and remove the unused private field that stores afterRenderEffect; instead call afterRenderEffect() inside the component constructor (replace the unused assignment with a direct invocation). Update the import order to place value imports first, delete the unused private member, and add a call to afterRenderEffect() in the constructor of the component that uses injectVirtualizer/ElementRef. In `@packages/angular-virtual/src/proxy.ts`: - Around line 91-102: getOwnPropertyDescriptor currently returns a blanket descriptor for every property which contradicts has() and ownKeys(); update getOwnPropertyDescriptor to read the current target via untracked(inputSignal), check Reflect.has or Object.prototype.hasOwnProperty on that target for the requested property, and if missing return undefined; if present return a proper descriptor (value: target[prop], writable: true, enumerable: true, configurable: true) so Proxy meta-ops remain consistent with has/ownKeys (refer to getOwnPropertyDescriptor, has, ownKeys, inputSignal, untracked). - Around line 4-18: SignalProxy models only properties but not the callable form, so calling the proxy (proxy()) types as an error; update the SignalProxy type to include a callable signature (i.e., intersect the existing mapped-property type with a function type like (...args: any[]) => any or a more specific (...args: Parameters<...>) => ReturnType<...>) so the proxy instance supports apply()/call() at the type level; modify the SignalProxy declaration to append that function signature and make the same change for the other duplicate declaration(s) that define the proxy shape.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
d33aa841-3255-4117-b536-97a5cac0bff0📥 Commits
Reviewing files that changed from the base of the PR and between 156153a61bd223145ae4551db4b102d69d618032 and c84a8646332c3cd35df4a197460d2aee5ae2519a.
📒 Files selected for processing (12)
packages/angular-virtual/angular.jsonpackages/angular-virtual/e2e/app/angular.jsonpackages/angular-virtual/e2e/app/src/app/app.component.tspackages/angular-virtual/e2e/app/src/app/measure-element.component.tspackages/angular-virtual/e2e/app/src/app/scroll.component.tspackages/angular-virtual/e2e/app/src/app/smooth-scroll.component.tspackages/angular-virtual/e2e/app/src/app/stale-index.component.tspackages/angular-virtual/e2e/app/tsconfig.app.jsonpackages/angular-virtual/e2e/app/tsconfig.jsonpackages/angular-virtual/src/index.tspackages/angular-virtual/src/proxy.tspackages/angular-virtual/src/types.ts
✅ Files skipped from review due to trivial changes (5)
- packages/angular-virtual/e2e/app/tsconfig.app.json
- packages/angular-virtual/e2e/app/src/app/app.component.ts
- packages/angular-virtual/e2e/app/tsconfig.json
- packages/angular-virtual/e2e/app/angular.json
- packages/angular-virtual/angular.json
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/angular-virtual/src/types.ts
piecyk requested changes
Let’s bump this to a major version and ship it.
.changeset/gold-days-greet.md line 2Outdated@@ -0,0 +1,2 @@1+---2+'@tanstack/angular-virtual': minorLet's use major as @angular/core goes from >=18.1.0 to >=19.0.0. Any consumer still on Angular 18 will break on install
'@tanstack/angular-virtual': majorpackages/angular-virtual/src/proxy.ts line 87Outdated@@ -62,14 +78,10 @@62- 'getOffsetForIndex',63- 'getVirtualItemForOffset',64- 'indexFromElement',65- ].includes(property)78+ attributesToTransformToSignals.includes(79+ property as TAttributesToTransformToSignals,80+ )6681 ) {67- const fn = virtualizer[property as keyof V] as Function68- Object.defineProperty(untypedTarget, property, {69- value: toComputed(virtualizerSignal, fn),70- configurable: true,71- enumerable: true,72- })82+ return (target[property] = computed(83+ () => inputSignal()[property as keyof TInput],84+ ))7385 }748675- return untypedTarget[property] || virtualizer[property as keyof V]87+ // All other fiels. Any fields that is not handled above will fail if the signal includes// All other fields. Any field that is not handled above will fail if the signal includespackages/angular-virtual/src/index.ts line 102@@ -60,19 +100,3 @@60-61- const scrollElement = computed(() => options().getScrollElement())62- // let the virtualizer know when the scroll element is changed63- effect(64- () => {65- const el = scrollElement()66- if (el) {67- untracked(virtualizerSignal)._willUpdate()68100 }69- },70- { allowSignalWrites: true },71- )72-73- let cleanup: (() => void) | undefined74- afterNextRender({75- read: () => {76- cleanup = (virtualizer ?? lazyInit())._didMount()77- },78- })101+ })102+Let's add a comment
// Lazy singleton:
computedhere is used purely for memoization, the body // readsresolvedOptionsviauntracked, so it has no reactive deps and the //Virtualizerinstance is constructed exactly once, on first access.packages/angular-virtual/src/index.ts line 109@@ -64,15 +100,7 @@64- () => {65- const el = scrollElement()66- if (el) {67- untracked(virtualizerSignal)._willUpdate()68100 }69- },70- { allowSignalWrites: true },71- )72-73- let cleanup: (() => void) | undefined74- afterNextRender({75- read: () => {76- cleanup = (virtualizer ?? lazyInit())._didMount()77- },78- })101+ })102+103+ const lazyVirtualizer = computed(104+ () => new Virtualizer(untracked(resolvedOptions)),105+ )106+// Note:
reactiveVirtualizeris referenced by theonChangeclosure inside //resolvedOptionsabove. That's safe becauseonChangeis only invoked by // virtual-core observers after thislinkedSignalis initialized, but be // aware of the TDZ when refactoring the order of these declarations.Actionable comments posted: 1
♻️ Duplicate comments (1)
packages/angular-virtual/src/proxy.ts (1)
97-101: ⚠️ Potential issue | 🟡 MinorReturn
undefinedfor missing property descriptors.Line 97 currently reports every key as an own property, so
Object.hasOwn/hasOwnPropertycan returntruefor keys that are missing. That conflicts with thehasandownKeystraps and breaks proxy invariants.Possible fix
- getOwnPropertyDescriptor() { - return { - enumerable: true, - configurable: true, - } + getOwnPropertyDescriptor(target, property) { + const targetDescriptor = Reflect.getOwnPropertyDescriptor( + target, + property, + ) + if (targetDescriptor) return targetDescriptor + + return Reflect.getOwnPropertyDescriptor(untracked(inputSignal), property) },#!/bin/bash node <<'NODE' const proxy = new Proxy(() => {}, { has() { return false }, ownKeys() { return [] }, getOwnPropertyDescriptor() { return { enumerable: true, configurable: true } }, }) console.log('missing' in proxy) // expected false console.log(Object.prototype.hasOwnProperty.call(proxy, 'missing')) // expected true with current trap NODE🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/proxy.ts` around lines 97 - 101, The getOwnPropertyDescriptor trap currently always returns a descriptor, causing Object.hasOwn/hasOwnProperty to report missing keys as present; update the getOwnPropertyDescriptor implementation to return undefined for keys that are not present according to the has() and ownKeys() logic (i.e., consult the same presence check used by has/ownKeys before creating a descriptor), and only return a full descriptor (with configurable/enumerable and appropriate value/writable or get/set fields) for actual own properties so the proxy invariants are preserved.🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed. Inline comments: In `@packages/angular-virtual/src/proxy.ts`: - Around line 87-89: The fallback branch currently returns members from untracked(inputSignal)[property as keyof TInput] raw, causing callable members to run with this===proxy; fix by detecting if the retrieved value is a function and, before returning, bind it to the underlying target instance (the result of untracked(inputSignal)) so methods on the Virtualizer execute with the correct this; update the logic around untracked(inputSignal) and property to return the bound function for callables and the raw value for non-callables (preserving types for TInput). --- Duplicate comments: In `@packages/angular-virtual/src/proxy.ts`: - Around line 97-101: The getOwnPropertyDescriptor trap currently always returns a descriptor, causing Object.hasOwn/hasOwnProperty to report missing keys as present; update the getOwnPropertyDescriptor implementation to return undefined for keys that are not present according to the has() and ownKeys() logic (i.e., consult the same presence check used by has/ownKeys before creating a descriptor), and only return a full descriptor (with configurable/enumerable and appropriate value/writable or get/set fields) for actual own properties so the proxy invariants are preserved.🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
ac0e2953-c93e-4afd-9054-890c7406ea88📥 Commits
Reviewing files that changed from the base of the PR and between c84a8646332c3cd35df4a197460d2aee5ae2519a and 0743536ca7d514d06c054f1d76e47b33509eee34.
📒 Files selected for processing (3)
.changeset/gold-days-greet.mdpackages/angular-virtual/src/index.tspackages/angular-virtual/src/proxy.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- .changeset/gold-days-greet.md
- packages/angular-virtual/src/index.ts
packages/angular-virtual/src/proxy.ts lines 87 to 89@@ -64,12 +78,12 @@64- 'indexFromElement',65- ].includes(property)78+ attributesToTransformToSignals.includes(79+ property as TAttributesToTransformToSignals,80+ )6681 ) {67- const fn = virtualizer[property as keyof V] as Function68- Object.defineProperty(untypedTarget, property, {69- value: toComputed(virtualizerSignal, fn),70- configurable: true,71- enumerable: true,72- })82+ return (target[property] = computed(83+ () => inputSignal()[property as keyof TInput],84+ ))7385 }748675- return untypedTarget[property] || virtualizer[property as keyof V]87+ // All other fields. Any field that is not handled above will fail if the signal includes88+ // input or model signals from a component and this is accessed before initialization.89+ return untracked(inputSignal)[property as keyof TInput]⚠️ Potential issue | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash node <<'NODE' const source = { value: 1, usesThis() { this.value += 1 return this === source }, } const proxy = new Proxy(() => source, { get(_target, property) { return source[property] }, }) console.log(proxy.usesThis()) // expected false console.log(source.value) // expected 1 NODERepository: TanStack/virtual
Length of output: 68
🏁 Script executed:
# First, let's look at the proxy.ts file around lines 87-89 sed -n '75,110p' packages/angular-virtual/src/proxy.tsRepository: TanStack/virtual
Length of output: 1067
🏁 Script executed:
# Check the index.ts to see what members are intentionally passed vs left to fallback sed -n '120,170p' packages/angular-virtual/src/index.tsRepository: TanStack/virtual
Length of output: 1409
🏁 Script executed:
# Check if Virtualizer has any callable/function members rg -A 5 'class Virtualizer|interface Virtualizer' packages/virtual/src/ -t typescript | head -100Repository: TanStack/virtual
Length of output: 95
🏁 Script executed:
# Find Virtualizer class/interface definition fd -e ts -e tsx 'virtualizer' packages/virtual/src/ | head -5Repository: TanStack/virtual
Length of output: 169
🏁 Script executed:
# Check what methods Virtualizer actually has rg 'class Virtualizer' packages/virtual/src/ -A 30 | head -80Repository: TanStack/virtual
Length of output: 122
🏁 Script executed:
# Look at the AngularVirtualizer type to understand what members are exposed sed -n '1,100p' packages/angular-virtual/src/types.tsRepository: TanStack/virtual
Length of output: 1454
🏁 Script executed:
# Find where Virtualizer type is defined find . -name '*.ts' -o -name '*.tsx' | xargs grep -l "class Virtualizer\|interface Virtualizer" | grep -v node_modulesRepository: TanStack/virtual
Length of output: 133
🏁 Script executed:
# Check the actual repository structure ls -la packages/Repository: TanStack/virtual
Length of output: 610
🏁 Script executed:
# Look at virtual-core to find Virtualizer class sed -n '1,150p' packages/virtual-core/src/index.ts | head -80Repository: TanStack/virtual
Length of output: 1647
🏁 Script executed:
# Get the full Virtualizer class definition rg "class Virtualizer" packages/virtual-core/src/ -A 100 | head -150Repository: TanStack/virtual
Length of output: 6766
🏁 Script executed:
# Check if there are any method definitions in Virtualizer that would be in the fallback rg "^\s+(private|public|protected)?\s*\w+\s*\(" packages/virtual-core/src/index.ts | head -30Repository: TanStack/virtual
Length of output: 970
🏁 Script executed:
# Get all public methods of Virtualizer class rg "^\s+(public\s+)?\w+\s*\(.*\)\s*:" packages/virtual-core/src/index.ts | head -40Repository: TanStack/virtual
Length of output: 42
🏁 Script executed:
# Get method signatures more carefully rg "^\s+\w+\s*\(" packages/virtual-core/src/index.ts | grep -v "^\s*(private|get|set)" | head -50Repository: TanStack/virtual
Length of output: 1838
🏁 Script executed:
# Look at all the methods defined in Virtualizer sed -n '200,800p' packages/virtual-core/src/index.ts | grep -E "^\s+[a-zA-Z_][a-zA-Z0-9_]*\s*\(|^\s+[a-zA-Z_][a-zA-Z0-9_]*\s*="Repository: TanStack/virtual
Length of output: 2270
🏁 Script executed:
# Get a larger section of the Virtualizer class to see method definitions sed -n '150,600p' packages/virtual-core/src/index.ts | grep -A 1 "^\s*[a-zA-Z_][a-zA-Z0-9_]*\s*\s*=\s*(" | head -60Repository: TanStack/virtual
Length of output: 308
🏁 Script executed:
# Try extracting method names with ast-grep ast-grep --pattern 'class Virtualizer { $$$ $_($$$) { $$$ } $$$ }' packages/virtual-core/src/index.ts 2>/dev/null | head -100Repository: TanStack/virtual
Length of output: 42
🏁 Script executed:
# Simple grep for method definitions - lines ending with = or { sed -n '200,1000p' packages/virtual-core/src/index.ts | grep -E "^\s+[a-zA-Z_].*=\s*(\(|\{|\() |grep -E "^\s+[a-zA-Z_][a-zA-Z0-9_]*\s*\(.*\)" | head -40Repository: TanStack/virtual
Length of output: 129
🏁 Script executed:
# Get a complete list of all method/property names in the Virtualizer class grep -E "^\s+(private\s+)?[a-zA-Z_][a-zA-Z0-9_]*\s*(\(|=|:)" packages/virtual-core/src/index.ts | head -80Repository: TanStack/virtual
Length of output: 2423
🏁 Script executed:
# Count lines in the Virtualizer file and check file size wc -l packages/virtual-core/src/index.tsRepository: TanStack/virtual
Length of output: 100
🏁 Script executed:
# Get method names by looking for function assignments and method declarations python3 << 'PYTHON' import re with open('packages/virtual-core/src/index.ts', 'r') as f: content = f.read() # Find the Virtualizer class match = re.search(r'export class Virtualizer.*?{(.*)', content, re.DOTALL) if match: class_body = match.group(1) # Find all method/property names (rough extraction) methods = re.findall(r'^\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*[\(=:]', class_body, re.MULTILINE) # Filter out duplicates while preserving order seen = set() unique_methods = [] for m in methods: if m not in seen: unique_methods.append(m) seen.add(m) print("Methods/properties in Virtualizer:") for i, m in enumerate(unique_methods[:60], 1): print(f"{i:3d}. {m}") PYTHONRepository: TanStack/virtual
Length of output: 1129
🏁 Script executed:
# Get all the method definitions from Virtualizer more carefully sed -n '200,1100p' packages/virtual-core/src/index.ts | grep -E "^\s+[a-zA-Z_][a-zA-Z0-9_]*\s*=" | grep -v "^\s+if\|^\s+for\|^\s+return" | head -50Repository: TanStack/virtual
Length of output: 936
🏁 Script executed:
# Check what methods are in the explicit pass-through lists in index.ts sed -n '129,167p' packages/angular-virtual/src/index.tsRepository: TanStack/virtual
Length of output: 1200
🏁 Script executed:
# Check if there are any other public methods not in the lists python3 << 'PYTHON' import re with open('packages/virtual-core/src/index.ts', 'r') as f: lines = f.readlines() # Find the Virtualizer class and extract method names in_class = False methods = [] for i, line in enumerate(lines[130:], start=130): if 'export class Virtualizer' in line: in_class = True if in_class: # Look for method definitions (arrow functions or regular methods) match = re.match(r'\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*\(', line) if match: methods.append(match.group(1)) # Stop at next class or end if in_class and i > 150 and 'export ' in line and 'class' in line: break if i > 1200: break # Also look for regular method definitions for i, line in enumerate(lines[130:1100], start=130): match = re.match(r'\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*\(', line) if match: method_name = match.group(1) if method_name not in ['if', 'for', 'return', 'while', 'switch']: methods.append(method_name) seen = set() unique = [] for m in methods: if m not in seen and m.strip(): unique.append(m) seen.add(m) print("Virtualizer methods found:") for m in sorted(set(unique)): print(f" {m}") PYTHONRepository: TanStack/virtual
Length of output: 133
🏁 Script executed:
# Extract the exact lists from index.ts to see what's being passed through sed -n '132,166p' packages/angular-virtual/src/index.ts | head -60Repository: TanStack/virtual
Length of output: 1054
🏁 Script executed:
# Look for all public method definitions in Virtualizer more systematically sed -n '180,1100p' packages/virtual-core/src/index.ts | grep -E "^\s+(public\s+)?[a-zA-Z_][a-zA-Z0-9_]*\s*=.*\(.*\)\s*=>" -A 0Repository: TanStack/virtual
Length of output: 347
🏁 Script executed:
# Let's check what all methods exist by looking at the actual method assignments python3 << 'PYTHON' import re with open('packages/virtual-core/src/index.ts', 'r') as f: content = f.read() # Extract class body match = re.search(r'export class Virtualizer.*?\n\s*{(.*)', content, re.DOTALL) if match: class_body = match.group(1) # Split into lines and look for method assignments lines = class_body.split('\n') methods = [] for line in lines[:400]: # Check first 400 lines of class # Match: name = (...) => or name: (...) => m = re.match(r'\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*[=:]\s*\(', line) if m: methods.append(m.group(1)) print("Public methods in Virtualizer:") for method in methods: print(f" {method}") PYTHONRepository: TanStack/virtual
Length of output: 125
🏁 Script executed:
# Let's directly look at what the types.ts Omit excludes vs what index.ts passes through echo "=== Properties omitted in AngularVirtualizer type ===" sed -n '4,40p' packages/angular-virtual/src/types.ts | grep "'" | sed "s/.*'\(.*\)'.*/\1/" echo "" echo "=== All explicitly listed in signalProxy call ===" ( sed -n '133,166p' packages/angular-virtual/src/index.ts | grep -o "'[^']*'" ) | sed "s/'//g" | sortRepository: TanStack/virtual
Length of output: 754
🏁 Script executed:
# Check the full proxy.ts implementation to see if there's any existing function binding cat packages/angular-virtual/src/proxy.tsRepository: TanStack/virtual
Length of output: 3724
🏁 Script executed:
# Check if there are any getters/setters or other logic that might handle functions sed -n '1,120p' packages/angular-virtual/src/proxy.tsRepository: TanStack/virtual
Length of output: 3724
🏁 Script executed:
# Check what methods exist on Virtualizer that are NOT in the explicit lists python3 << 'PYTHON' import re # Read the explicit lists from index.ts with open('packages/angular-virtual/src/index.ts', 'r') as f: index_content = f.read() explicit_methods = set() # Extract all quoted strings in the signalProxy call matches = re.findall(r"'([^']+)'", index_content[index_content.find('signalProxy'):index_content.find(') as unknown as AngularVirtualizer')]) explicit_methods.update(matches) print("Explicitly listed methods/properties:") for m in sorted(explicit_methods): print(f" {m}") # Now check what the AngularVirtualizer type definition says about what methods are exposed with open('packages/angular-virtual/src/types.ts', 'r') as f: types_content = f.read() # The type is Omit<Virtualizer, ...> which means it includes everything except what's listed # So we need to understand: what properties does Virtualizer expose that might be methods? print(f"\nTotal explicitly listed: {len(explicit_methods)}") print("\nNote: AngularVirtualizer extends Omit<Virtualizer, ...> which means") print("all Virtualizer members not listed in the Omit are still exposed on AngularVirtualizer.") print("This means the fallback branch will receive ANY Virtualizer method not in the explicit lists above.") PYTHONRepository: TanStack/virtual
Length of output: 2860
🏁 Script executed:
# Search for all public methods in Virtualizer - look at complete method list sed -n '180,1000p' packages/virtual-core/src/index.ts | grep -E "^\s+[a-zA-Z_][a-zA-Z0-9_]*\s*=\s*\(|^\s+[a-zA-Z_][a-zA-Z0-9_]*\s*\(.*\)\s*[:{]" | head -40Repository: TanStack/virtual
Length of output: 1791
Bind function-valued fallbacks instead of returning them raw.
Line 89 returns uncategorized members as-is. Because
packages/angular-virtual/src/index.tsintentionally leaves the rest of theVirtualizersurface to this branch, any method not in the explicit lists will execute withthis === proxy, not the currentTInputinstance. This breaks method semantics for any callable member in the fallback—reads or writes inside the method hit the proxy instead of the underlying Virtualizer instance.Suggested fix
- return untracked(inputSignal)[property as keyof TInput] + const value = untracked(inputSignal)[property as keyof TInput] + if (typeof value === 'function') { + return (target[property] = ((...args: unknown[]) => { + const source = untracked(inputSignal) + const fn = source[property as keyof TInput] as ( + ...args: unknown[] + ) => unknown + return Reflect.apply(fn, source, args) + }) as unknown) + } + return value🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/angular-virtual/src/proxy.ts` around lines 87 - 89, The fallback branch currently returns members from untracked(inputSignal)[property as keyof TInput] raw, causing callable members to run with this===proxy; fix by detecting if the retrieved value is a function and, before returning, bind it to the underlying target instance (the result of untracked(inputSignal)) so methods on the Virtualizer execute with the correct this; update the logic around untracked(inputSignal) and property to return the bound function for callables and the raw value for non-callables (preserving types for TInput).piecyk approved these changes
piecyk merged this3374977
piecyk closed this
Sign in to join this conversation.
Note
Reviews paused#
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.Use the checkboxes below for quick actions:
📝 Walkthrough
Walkthrough#
Switches the Angular virtualizer to a signal-driven proxy model with updated types/options and packaging, adds an Angular 19 E2E app and Playwright suites, updates example and root dev tooling versions, and adds a changeset declaring a major bump for
@tanstack/angular-virtual.Changes#
.changeset/gold-days-greet.md@tanstack/angular-virtualindicating a major release and note: “Angular +19 with proper lazy init”.packages/angular-virtual/src/index.ts,packages/angular-virtual/src/proxy.ts,packages/angular-virtual/src/types.tslinkedSignaland introduces genericsignalProxy; addsafterRenderEffectlifecycle,useApplicationRefTickoption, callableAngularVirtualizersignature, and exposesmeasurementsCacheas a Signal; updates inject API/types.packages/angular-virtual/package.json,packages/angular-virtual/vite.config.ts,packages/angular-virtual/ng-package.json(removed),packages/angular-virtual/tsconfig.build.json(removed),packages/angular-virtual/tsconfig.jsondist/esm&dist/cjs, updates scripts and devDependencies for Vite/TS/Angular 19.packages/angular-virtual/playwright.config.ts,knip.json@angular/cli, adds path ignore).packages/angular-virtual/angular.json,packages/angular-virtual/e2e/app/angular.json,packages/angular-virtual/e2e/app/tsconfig.json,packages/angular-virtual/e2e/app/tsconfig.app.json,packages/angular-virtual/e2e/app/src/index.html,packages/angular-virtual/e2e/app/src/main.ts,packages/angular-virtual/e2e/app/src/styles.csspackages/angular-virtual/e2e/app/src/app/app.component.ts,.../app.config.ts,.../app.routes.ts,.../scroll.component.ts,.../smooth-scroll.component.ts,.../measure-element.component.ts,.../stale-index.component.tspackages/angular-virtual/e2e/app/test/scroll.spec.ts,.../smooth-scroll.spec.ts,.../measure-element.spec.ts,.../stale-index.spec.tsexamples/angular/*/package.json^18.1.0→^19.0.0and TypeScript from5.4.5→5.6.3across Angular example projects.examples/{react,vue,svelte,lit}/*/package.json^5.4.19→^6.4.2and TypeScript5.4.5→5.6.3in example devDependencies where present.package.json,packages/virtual-core/tests/index.test.ts,packages/react-virtual/e2e/app/test/scroll.spec.tsdocs/framework/angular/angular-virtual.md,packages/angular-virtual/README.mdAngularVirtualizerproperties in docs and README.Sequence Diagram(s)#
Estimated code review effort#
🎯 4 (Complex) | ⏱️ ~50 minutes
Poem#
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share