processing / processing/p5.js-website

CodeEmbed/frame.tsx: p5.sound never loads in iframes + postMessage uses wildcard origin

Open
#1,249 6 comments 0 reactions 1 assignee View on GitHub

@avinxshKD is already working on this.

Since Apr 6, 2026.

  • #1350 by @avinxshKD — open
Bug
Dominant language
MDX
Stars
96
Forks
322
Avg merge
5d 22h
Merged PRs (30d)
8

Description

Most appropriate sub-area of p5.js?
  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • p5.strands
  • WebGL
  • DevOps, Build process, Unit testing
  • Internationalization (i18n)
  • Friendly Errors
  • Other (specify if possible)
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:

  1. fetches the entire search index JSON again
  2. flattens it
  3. creates a brand new Fuse instance
  4. 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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.