Sveriges mest populära poddar
CodePen Radio

424: File List Optimization

29 april 2026

The 2.0 Editor can support hundreds of files per Pen, not to mention folders mixed in which don't count toward that total. This can be pretty weighty on the DOM and thus adversely affect performance. Especially as each file/folder has children, a variety of event listeners, are drag and drop enabled, etc. "Virtualizing" data like this is a common approach, but we've found if we just use IntersectionObserver to see if they are visible or not, "freeze" them if they aren't, and fade them in and out of life, it's a great solution.

Time Jumps

CodePen Radio med CodePen Blog finns tillgänglig på flera plattformar. Informationen på denna sida kommer från offentliga podd-flöden.