Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p5.js 2.0 Updates #22

Open
limzykenneth opened this issue Mar 2, 2025 · 0 comments
Open

p5.js 2.0 Updates #22

limzykenneth opened this issue Mar 2, 2025 · 0 comments

Comments

@limzykenneth
Copy link

Hi @bmoren, you may have seen that for the past year we have been working on the next major release of p5.js as p5.js 2.0 and we are currently in the process of reviewing known community libraries to see what kind of compatibility there are currently.

However before I get into the potential updates that may be required, I want to highlight the timeline we are currently working with and that we are planning for a relatively long transition timeline. After the release of p5.js 2.0 currently planned for late March, p5.js 1.x will still be the default version of p5.js used in any new p5.js web editor sketch and the website will still be using reference and materials referencing p5.js 1.x. These will switch over in August 2026, giving more than a year for the larger community to transition and not disrupt mid-term plans of teachers. p5.js 1.x will continue to receive bug fixes throughout this period.


For p5.geolocation, I have tested the provided examples and there is one main incompatibility which is that for p5.js 2.0 we have removed the preload() mechanism for asynchronous operation and switched to using Javascript native async/await. This means that for asynchronous operation, it should now return a promise.

You may wish for you addon library to support both 1.x and 2.0 for the moment and for this kind of implementation I would suggest is to use the older implementation with preload if _incrementPreload and _decrementPreload methods are detected on the p5 object while returning a promise if these methods are not detected. I have a long form write up about the system here if you are interested.

If that is the approach you are happy with for p5.geolocation, I'm happy to help with the implementation or file a PR if you'd like, just let me know! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant