processing / processing/p5.js

[p5.js 2.0+ Bug Report]: Minor issues in the creating libraries contributor doc

Open
#9,171 2 comments 1 reaction 1 assignee View on GitHub

@MannXo is already working on this.

Since Sep 14, 2026.

Documentation Help Wanted p5.js 2.0+
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

Most appropriate sub-area of p5.js?
  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • WebGPU
  • p5.strands
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)
p5.js version

Current

Web browser and version

All

Operating system

All

Steps to reproduce this

In the creating libraries doc, whose source code is in this repo, there are a few little issues:

Minor, but the comments here should be HTML <!-- ... --> comments instead of jsx comments:
Image

Here, we show two code snippets. The first is actually an anti-example of what you shouldn't do, but the explanation is inside of the collapsible details tag. It looks like the first code block should probably be inside there too, as the explanation for it starts hidden? As it is it's somewhat easy to misread it as a thing you SHOULD do, and its difference between it and the positive example isn't super clear at first.
Image

We also don't currently have explanation about how to add to p5 state (both the kind affected by push/pop and the kind that is not.) The only example of addon state I can find is in https://dev.to/limzykenneth/designing-an-addon-library-system-for-p5js-20-3d4p:

Image

...but I think this syntax accidentally creates a single state for all uses of the addon across instances, if multiple p5 instances are loaded on a page? Probably the correct pattern (for non push/pop state anyway) is in https://github.com/processing/p5.js/issues/7742#issuecomment-2829734911:

Image

Contributor guide

Open the contributing guide

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.