DOM nodes count keeps in Performance monitoring tab keeps growing
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend, performance
调研方向
使用链接的 StackBlitz 设置和 Brave DevTools 的 Performance 监视器,通过 src/main.tsx 中的 React 无限滚动示例重现该报告。滚动时将不断增长的 DOM 节点数量与 Elements 标签页进行比较,然后确定该行为是否符合预期,或是否表明存在 cleanup 问题;当原因和任何必需的修正都得到验证后,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
I’ve been using this library to virtualise a grid, and while testing, I noticed that the DOM node count keeps increasing when monitoring via the Performance monitoring tab in Brave DevTools.
At first, I assumed it might be an issue with my implementation, so I tested one of the official examples – specifically, the infinite scroll demo from the website.
Inspecting the Elements tab, it does appear that items are being mounted and unmounted correctly as I scroll. However, the total DOM node count continues to rise, which seems unexpected for a virtualised list.
I then wondered if the performance monitor might be counting some kind of 'virtual' or detached nodes, but to compare, I tried react-virtuoso. There, the node count rises initially as you scroll, but drops back down when items go out of view – which is the behaviour I would expect.
Is this increasing DOM node count an expected behaviour with TanStack Virtual, or could it be a memory leak or cleanup issue?
Your minimal, reproducible example
Steps to reproduce
1.) Used the code from the above example, see here.
2.) Open 'Performance monitoring' on this page: https://owailmmbkggithub-0flc--5173--10996a95.local.webcontainer.io/, and then start scrolling.
Expected behavior
Number of DOM nodes should drop back down as user scrolls - it shouldn't keep increasing.
How often does this bug happen?
Appears to be happening consistently.
Screenshots or Videos
https://github.com/user-attachments/assets/1b4f41c2-53a8-4761-8d65-da21568415b5
Platform
- OS: macOS
- Browser: Brave
tanstack-virtual version
3.13.10
TypeScript version
No response
Additional context
No response
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- 主要语言
- TypeScript
- 星标
- 7.1k
- 派生
- 466
- 平均合并
- 2 天 31 分钟
- 30 天内合并 PR
- 13
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/virtual 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 55/100
-
难度 5/5 一周以上 新手友好度 38/100
-
难度 4/5 3-5 天 新手友好度 62/100
-
难度 4/5 3-5 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 68/100
相似的 Issue
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 85/100
-
Mend: dependency security vulnerability untriaged
难度 2/5 1-3 小时 新手友好度 70/100