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

solves docs issue 837 for p5.js 2.x

Open NalinDalal opened this issue 5 months ago • 1 comments

Actual Behavior The “Getting Started with Node.js” tutorial is still using p5.js 1.x patterns (e.g. preload(), old APIs, external sketches locked to 1.x). Legacy p5.js 1.x APIs (e.g. old shape-drawing signatures) remain in the code samples. Several external Web Editor sketches are locked to p5.js 1.x and won’t run under 2.x.

Expected Behavior Since p5.js 2.0 has removed preload() and other legacy methods in favor of async/await and updated several APIs, we need to refresh this tutorial so it only uses supported 2.x functionality. Every linked sketch should has been forked (or updated) to use p5.js 2.x so examples execute correctly.

Hence I updated the docs for the required 2.x version

I have tested, linted and ran the code locally to ensure no breakage occurs

addresses pull request: https://github.com/processing/p5.js-website/pull/877 issue: https://github.com/processing/p5.js-website/issues/837

NalinDalal avatar Jun 27 '25 07:06 NalinDalal

Thanks for working on this! Could you add "addresses #837" to the body of the PR please? This way, it can be linked to the related issue. Thank you!

ksen0 avatar Jun 27 '25 16:06 ksen0

updated the code as per your suggestion, however if anything goes wrong or you feel wrong, do let know @perminder-17

NalinDalal avatar Jul 13 '25 04:07 NalinDalal

updated the code as per your suggestion, however if anything goes wrong or you feel wrong, do let know @perminder-17

Hi, I am sorry, I still see the old code only, the code is still the same and it doesn't follow any of the suggestions given. Can you have a look once again?

perminder-17 avatar Jul 13 '25 21:07 perminder-17

Hi thanks, now the changes are visible.

Just last bits to change then we are good to go,

In line number 17,

In this guide, we'll explore the fusion of p5.js and Node.js

The link of node.js is not working since you're using http://node.js/ but actually the link for that is https://nodejs.org/.

Also, in many places, we mention terms like Node.js but don’t link them to their official websites. For example, when we write “Node.js,” it’s not clickable. We can improve this by replacing such mentions with Node.js so users can directly access the official documentation.

perminder-17 avatar Jul 15 '25 13:07 perminder-17

Also, I was still not clear with this change,

Before it was written something like,

Object i files: Array(3) 0: "C Major Scale.json" 1: "Frere Jacques.json" 2: "Mary's Lamb.json" length: 3 // ...prototype

Now it's this after your changes. { files: [ "C Major Scale.json", "Frere Jacques.json", "Mary's Lamb.json" ] }

Can you explain why you changed this, what was exactly in the console that you removed the odering?

perminder-17 avatar Jul 15 '25 13:07 perminder-17

hey @perminder-17 I will be honest with you, i got this context after going through the codebase, i felt using json was making more, however, i will change it to original, rest for link of nodejs i have updated it

The output format in the console was just made simpler for the tutorial. No actual data structure or ordering was lost.

i still am trying to reproduce the data type as result, is it okay to contact you on discord?

NalinDalal avatar Jul 15 '25 14:07 NalinDalal

thanks @perminder-17 , looking forward to contribute more

NalinDalal avatar Jul 18 '25 03:07 NalinDalal