Skip to content

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

Open
kushal1061 wants to merge 2 commits intoprocessing:dev-2.0from
kushal1061:improve/strands-loop-protection-error
Open

added productive error when loop protection breaks in p5.strands#8725
kushal1061 wants to merge 2 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: d9898f4

Previous deployments

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

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