Skip to content

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

Description

@davepagurek

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 #7742 (comment):

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions