Company
Date Published
Author
Adam Bradley
Word count
1135
Language
English
Hacker News points
None

Summary

Ionic's Collection Repeat was initially designed to optimize the performance of scrolling through large lists by dynamically switching out elements, inspired by iOS's UITableView. The original implementation required developers to specify the dimensions of each item, leading to performance issues due to unnecessary recalculations. A significant refactor introduced a more performant solution that estimates dimensions using getComputedStyle(), allowing for lazy calculations and improved rendering through batching DOM operations. The new version includes various modes, such as Static List Mode and Dynamic Grid Mode, optimizing performance for different scenarios. Challenges remain with iOS image rendering, where lag occurs due to non-cached image sources, though experiments with web workers and data-uris show promise in mitigating these issues. Despite the complexities, the new Collection Repeat is more efficient and user-friendly, with continued efforts to enhance iOS performance further.