Skip to content

added productive error when loop protection breaks in p5.strands#8725

Merged
davepagurek merged 3 commits intoprocessing:dev-2.0from
kushal1061:improve/strands-loop-protection-error
May 3, 2026
Merged

added productive error when loop protection breaks in p5.strands#8725
davepagurek merged 3 commits intoprocessing:dev-2.0from
kushal1061:improve/strands-loop-protection-error

Conversation

@kushal1061
Copy link
Copy Markdown

@kushal1061 kushal1061 commented Apr 16, 2026

Resolves #8721

Changes:

  • Added detection for loop-protection code (e.g. loopProtect / $OP.loopProtect) in user sketches before p5.strands transpilation.
  • Loop protection breaks p5.strands shader compilation, an error is now thrown early with a clear message.
  • The error instructs users to add // noprotect at the top of their sketch to disable loop protection.

Screenshots

Old error:
Old error

New error after changes:
New error

PR Checklist

@davepagurek
Copy link
Copy Markdown
Contributor

Thanks @kushal1061, this is looking good! The one thing I'd ask before merging is if we can add unit tests to assert that it throws on OP-style and web editor style loop protection, so that we can make sure we don't accidentally break that in the future.

@p5-bot
Copy link
Copy Markdown

p5-bot Bot commented Apr 28, 2026

Continuous Release

CDN link

Published Packages

Commit hash: 6c8cde7

Previous deployments

d9898f4


This is an automated message.

@kushal1061
Copy link
Copy Markdown
Author

Thanks @kushal1061, this is looking good! The one thing I'd ask before merging is if we can add unit tests to assert that it throws on OP-style and web editor style loop protection, so that we can make sure we don't accidentally break that in the future.

hi @davepagurek added unit test for both cases as you suggested

Copy link
Copy Markdown
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

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

Thanks @kushal1061, looks great!

@davepagurek davepagurek merged commit 107f3c0 into processing:dev-2.0 May 3, 2026
3 of 5 checks passed
@davepagurek
Copy link
Copy Markdown
Contributor

@all-contributors please add @kushal1061 for code

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