Most appropriate sub-area of p5.js?
p5.js version
N/A - website repo issue, not p5.js core
Web browser and version
All browsers
Operating system
all
Issue :
Every time searchTerm changes, SearchProvider:
- fetches the entire search index JSON again
- flattens it
- creates a brand new Fuse instance
- runs the search
Typing "createVector" = 13 requests to the same en.json. No debounce,
no abort, no caching. The Fuse index is expensive to build and should
be created once per locale, not per keystroke.
There's also a race condition, no AbortController means a slow response
for "col" can resolve after "color" and overwrite the results.
Should be:
- fetch + build Fuse once per locale change, store in a ref
- separate effect just for running fuse.search(searchTerm)
- debounce the search (~250ms)
- AbortController on the fetch with cleanup
Easy to reproduce: open /search/, DevTools Network tab, type anything
fast and watch duplicate requests pile up.
File: src/components/SearchProvider/index.tsx
Most appropriate sub-area of p5.js?
p5.js version
N/A - website repo issue, not p5.js core
Web browser and version
All browsers
Operating system
all
Issue :
Every time searchTerm changes, SearchProvider:
Typing "createVector" = 13 requests to the same en.json. No debounce,
no abort, no caching. The Fuse index is expensive to build and should
be created once per locale, not per keystroke.
There's also a race condition, no AbortController means a slow response
for "col" can resolve after "color" and overwrite the results.
Should be:
Easy to reproduce: open /search/, DevTools Network tab, type anything
fast and watch duplicate requests pile up.
File: src/components/SearchProvider/index.tsx