evermade / wp-block-toolkit

Toolkit for developing WordPress Gutenberg blocks.
https://www.evermade.fi
GNU General Public License v3.0
9 stars 1 forks source link

useAllPosts is inefficient with large amount of content #5

Closed mirasusanna closed 1 year ago

mirasusanna commented 2 years ago

Using useAllPosts function can be extremely slow in case the site has a lot (thousands, in my case) of posts. It can take dozens of seconds to load everything.

tnke commented 2 years ago

If there's thousands of posts, it might be good to look for alternative to current PostControl. I haven't looked too much into the efficiency of useSelect, but it could be that trying to use thousands of posts is always going to be quite slow.

Some ideas that come to mind:

Require a search input

Some kind of usePagedPosts