nolanlawson / emoji-picker-element

A lightweight emoji picker for the modern web
https://nolanlawson.github.io/emoji-picker-element/
Apache License 2.0
1.5k stars 87 forks source link

Virtual rendering #452

Open nolanlawson opened 2 months ago

nolanlawson commented 2 months ago

444 raised the issue of performance suffering when there are a lot of custom emoji (~20k). Some recent perf improvements addressed this using a combination of content-visibility and IntersectionObserver, which is great as a quick fix but doesn't address the root problem of needing to render ~20k DOM nodes.

The only solution to that is rendering a real virtual list. Unfortunately this has complexity and accessibility considerations, so it's not straightforward to implement. It might make sense, though, especially since some use cases (e.g. a massive Slack/Discord channel, a big Mastodon instance) might have even more than 20k custom emoji.

nolanlawson commented 2 months ago

BTW I'm not 100% sold on this (due to the complexity/accessibility issues), but it's definitely worth considering.