feat: add friendly error for cross-hook property access (#8813)#8862
Conversation
|
🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors! Thank You! |
davepagurek
left a comment
There was a problem hiding this comment.
Thanks for working on this, the approach looks good! Do you think we can add a unit test to make sure the error behaviour continues working into the future?
The scope error message now uses the display name alias (e.g. worldInputs) instead of the internal shader function name (e.g. getWorldInputs). This matches the primary API that users interact with via begin()/end(). Also added a unit test verifying the error uses the unprefixed name.
|
@all-contributors please add @BHARATH0153 for code |
|
I've put up a pull request to add @BHARATH0153! 🎉 |
…s-error feat: add friendly error for cross-hook property access (processing#8813)
Resolves #8813
Changes
Adds a friendly error when accessing one hook's struct properties from within another hook's begin()/end() block in the flat strands API. Previously this gave a cryptic TypeError because struct property getters were only defined during setupHook().
After this PR, the same code gives a clear error with a suggestion to use sharedVec3() or sharedFloat() for cross-hook data sharing.
Screenshots of the change
N/A — error-message change only.
PR Checklist
npm run lintpasses