-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
skip FES checks on internal calls #8517
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
base: dev-2.0
Are you sure you want to change the base?
skip FES checks on internal calls #8517
Conversation
|
@davepagurek hey let me know if any adjustments needed, happy to work thanks |
| if (!p5.disableFriendlyErrors && !p5.disableParameterValidator) { | ||
| validate(name, args); | ||
| const wasInternalCall = this._isUserCall; | ||
| this._isUserCall = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this line would result in all calls being internal? What am I missing? I understood it but maybe it would be nice to add a comment for this block and the block above, noting that if one logic is updated the other should probably be reviewed, as they are similar but not quite same.
track call depth with _isUserCall flag, add _internal() for post-await sections fixes processing#7817
c81787f to
492c59d
Compare
|
@ksen0 Hey, hve added cross-reference comments linking the two blocks, both now have NOTE lines pointing to each other. |
| try { | ||
| const cb = await urlToStrandsCallback(url); | ||
| let shader = this.withGlobalStrands(this, () => | ||
| let shader = this._internal(() => this.withGlobalStrands(this, () => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! While we're at it, can we do the other known methods? In the reference it looks like that means loadModel, loadFont, loadImage, loadBlob, loadBytes, loadJSON, loadStrings, loadTable, and loadXML
|
hey @davepagurek you mean _internal() applied to ALL load* methods, not just the shader ones.Right?? checked all of them:
None of them hit a decorated Should I add wrapping to the others anyway for consistency/future-proofing, or is the current scope (just the shader loaders) what you had in mind? Want to make sure I'm not missing somethin |
|
@davepagurek hey pls also have a look when you get chance, implemented the .at() approach we discussed for the 2.0 #8512. As we have already merged for the main. Thanks again |
Resolves #7817
Changes
Added call depth tracking to skip FES param validation on internal p5 function calls. The decorator now sets
_isUserCallflag and only validates at the outermost level. For async contexts (load* methods), added_internal()helper to suppress validation after await points.Modified 5 shader loading functions in
src/webgl/material.jsto wrap post-await internal calls:loadFilterShader,loadMaterialShader,loadNormalShader,loadColorShader,loadStrokeShader.Fixes the issue where users see FES warnings for internal p5 calls they didn't write (like
createVectorinsideworldToScreenand avoids redundant param checking on already-validated internal calls.Screenshots of the change
N/A - internal behavior change, no visual differences
PR Checklist
npm run lintpasses