feathericons.com icon indicating copy to clipboard operation
feathericons.com copied to clipboard

Improve search performance 🔎🏃‍♂️

Open colebemis opened this issue 5 years ago • 6 comments

There is noticeable lag when searching. Let's fix that.

colebemis avatar Nov 07 '19 09:11 colebemis

I've noticed this as well @colebemis. I'll take a look at the codebase and see if I find anything that could be the culprit 🔎

jletey avatar Nov 07 '19 10:11 jletey

That'd be awesome! This code block seems like a good starting point: https://github.com/feathericons/feathericons.com/blob/master/src/pages/index.js#L16-L21

colebemis avatar Nov 07 '19 10:11 colebemis

Hmm, I'm not noticing any lag anymore. Is search still sluggish for you, @johnletey?

colebemis avatar Nov 08 '19 21:11 colebemis

I'll work on this issue!

anthonygedeon avatar Oct 02 '20 02:10 anthonygedeon

The search input component performs a lot better now #287

  • User can quickly spam (or hold down) the backspace key (previously had to hit the key 1 at at time)
  • Utilizes a denounce function to set the query at a later time (500 ms to be exact)
  • On feathericons.com, if you typed too fast, the query would not get all the letters, this feature prevents that from happening

There is a bug though, the result is not waiting until the query is done after 500ms.

Here's a GIF of the working feature

https://gph.is/g/ZYoqpJn

anthonygedeon avatar Oct 06 '20 22:10 anthonygedeon

I have found solution for this on heroicons.dev site May be it will help you out. https://github.com/zaydek/heroicons.dev/blob/61042d17b54ac2f0a04e92bc85184ac6ed132a41/src/pages/index.js#L500-L534

DevT0ny avatar May 23 '21 03:05 DevT0ny