Skip to content

Conversation

hxrshxz
Copy link
Contributor

@hxrshxz hxrshxz commented Oct 22, 2025

Resolves #8151

Changes:

Marked both the static and instance version of the array() method as deprecated

PR Checklist

* </div>
*/
array() {
p5._friendlyError(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently throwing errors in the tests. Inside of classes, we don't have access to a global p5. We do have access to them in the exported addon function body though. In #8176 I dealt with something similar by patching the class in the exported addon function to give it access to these.

Also, once this does work, we probably don't want to flood the user's console with logs if they're using this a bunch every frame. We should maybe track whether or not we've logged this warning yet, and don't log it a second time.

Copy link
Contributor Author

@hxrshxz hxrshxz Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your help sharing this pattern made the fix super easy

@hxrshxz hxrshxz force-pushed the deprecate-array-vector branch 2 times, most recently from a333725 to 4201812 Compare October 22, 2025 22:25
@hxrshxz hxrshxz requested a review from davepagurek October 22, 2025 23:13
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

Successfully merging this pull request may close these issues.

2 participants