p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

[2.0] Stabilize `p5.Vector` (umbrella issue)

Open GregStanton opened this issue 3 months ago • 5 comments

[2.0] Stabilize p5.Vector (umbrella issue)

Hi everyone!

As discussed in #8118, this umbrella issue is designed to organize the work needed to stabilize p5.Vector in p5.js 2.0. The work is organized into dedicated sub-issues. The discussion in this umbrella issue serves two purposes:

  1. If you're interested in helping but aren't sure what to help with, you can comment here for guidance.
  2. If you discover a problem that's not covered by the existing sub-issues, we can decide how to chunk it into sub-issues.

The list below covers tasks that have already been identified. The purpose of the sub-issues is to scope work into actionable tasks whenever possible, or to provide a forum for focused discussion if needed. In exceptional cases where an existing sub-issue is too broad to be actionable, sub-sub-issues could be created if necessary.

Work to create the existing sub-issues is ongoing. Once each sub-issue is created, the current issue will link to it.

Creation and inspection

  • [2.0] Stabilize the toString() method of p5.Vector
  • [2.0] Deprecate array() method of p5.Vector
  • [2.0] Proposal: A clearer API for vector components (no breaking changes)
  • [2.0] Stabilize x, y, and z fields of p5.Vector
  • [2.0] Stabilize w field of p5.Vector
  • [2.0] Stabilize the undocumented dimensions field of p5.Vector
  • [2.0] Stabilize behavior of createVector() with zero arguments
  • [2.0] Add array, vector overloads to createVector() for consistency?

Operations

  • [2.0] Complete extension of p5.Vector to $n$ dimensions
  • [2.0] Proposal: A standard policy for vector dimension mismatches
    • [2.0] Stabilize set() method of p5.Vector
    • [2.0] Simple policy clarification to prevent unintended side effects (e.g. vec1D.mult(vec2D))
    • [2.0] Update the equals() method of p5.Vector
    • Update other methods...
  • [2.0] Return vector instance from general component setter (for chaining)
  • [2.0] Proposal: Resizing functions for vectors (e.g. pad() and crop())
  • [2.0] Resolve NaN results from vector operations (PLACEHOLDER—not a real sub-issue)
    • This is a reminder to check that all observed NaN bugs have been resolved by previous sub-issues
    • If not, this can be replaced with more precise sub-issues relating to those specific bugs.

Additional documentation cleanup

  • [2.0] Update body of p5.Vector reference page (fields and method specs may change)
  • [2.0] Document clampToZero() (docs don't appear in beta reference)
  • [2.0] Add explanatory visual examples to random(), random2D(), random3D()
  • [2.0] Fill gaps in p5.Vector’s dist() documentation (some docs from 1.x have disappeared)
  • [2.0] Audit all reference pages for p5.Vector (PLACEHOLDER—not a real sub-issue)
    • Many improvements can be made as part of the preceding sub-issues.
    • The "Documentation audit" placeholder is a reminder to do a full audit after that work has completed.

GregStanton avatar Oct 15 '25 09:10 GregStanton

Hi @ksen0, @limzykenneth, @inaridarkfox4231, @sidwellr, @Ahmed-Armaan, @davepagurek, and @holomorfo! This is the umbrella issue for p5.Vector stabilization. It includes a range of dedicated sub-issues covering the tasks that arose from our conversations. I still need to make a few more sub-issues, but this should be a good start. The automated sub-issue list attached to the top post will always show the most up-to-date set of sub-issues.

GregStanton avatar Oct 15 '25 19:10 GregStanton

Hi everyone 👋

I'm Shubham Kahar, a new contributor interested in helping with the p5.Vector stabilization effort.
I’ve subscribed to this umbrella issue and the sub-issues mentioned by @GregStanton.

I support the current proposals and am particularly interested in testing, documentation, and small feature tasks once the blocking issues are approved.
Please feel free to tag me if help is needed for testing or implementation later on.

Excited to learn and contribute! 🚀

Shubhamkahar196 avatar Nov 12 '25 15:11 Shubhamkahar196

Hi everyone,

I want to thank you all for the incredible energy and detailed work you’ve put into this important Vector stabilization effort.

Moving forward, the maintainer team will be guiding this effort directly, and I will be stepping back from my role as steward. Please look to @ksen0 and the maintainer team for guidance on approvals and next steps.

Thank you again to all the volunteers for the productive discussions, your insights, and your dedication!

cc: @adity1raut, @Anirudh-x, @Ayaan005-sudo, @atif09, @avinxshKD, @ayushman1210, @GlaDrancE, @harishbit, @harshgautam5678, @Homaid, @hxrshxz, @justAnotherAnotherUser, @kunal595, @lokesh-singhal, @MRKrinetic, @nickmcintyre, @RandomGamingDev, @reshma045, @Shubhamkahar196, @sidwellr, @vtushar06

GregStanton avatar Nov 19 '25 07:11 GregStanton

Huge thanks to @GregStanton in laying the foundation! And thanks everyone for your input so far @adity1raut, @Anirudh-x, @Ayaan005-sudo, @atif09, @avinxshKD, @ayushman1210, @GlaDrancE, @harishbit, @harshgautam5678, @Homaid, @hxrshxz, @justAnotherAnotherUser, @kunal595, @lokesh-singhal, @MRKrinetic, @nickmcintyre, @RandomGamingDev, @reshma045, @Shubhamkahar196, @sidwellr, @vtushar06

We have set up a more direct discussion space for p5.js 2.x Vector implementation bugfixes, documentation, and improvements as a Discord channel: https://discord.gg/gH3VcRKhen

Please join the channel, and optionally the upcoming call to resolve some of the stickier issues: https://www.when2meet.com/?33551073-4Kcmb

(As we discuss/unblock each of the vector issues, I will also follow up on those issues as a comment. So if you prefer to participate only (or primarily) on GitHub, that still also works! If you can't make it to the meeting, also no worries, as long there are open topics, we can coordinate more direct calls.)

ksen0 avatar Nov 19 '25 13:11 ksen0

Thanks @GregStanton for all the guidance so far, and thank you @ksen0 and the maintainer team for taking over the coordination. 🙌

I’ve joined the Discord channel and I’ll continue following the discussions around the vector stabilization work. As mentioned earlier, I’m happy to help with testing, documentation, or smaller tasks once the pending decisions are finalized.

Please feel free to tag me wherever help is needed — I’m excited to continue contributing and learning from this process! 🚀

Shubhamkahar196 avatar Nov 20 '25 13:11 Shubhamkahar196