Skip to content
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

Revamp Friendly Error System's Parameter Validation #7178

Open
12 of 31 tasks
sproutleaf opened this issue Aug 15, 2024 · 1 comment
Open
12 of 31 tasks

Revamp Friendly Error System's Parameter Validation #7178

sproutleaf opened this issue Aug 15, 2024 · 1 comment

Comments

@sproutleaf
Copy link

sproutleaf commented Aug 15, 2024

Most Appropriate Sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

Feature Enhancement Details

Migrate the parameter validation flow in FES to Zod.

Main task list:

  • Use the new modular syntax for the param validator
  • Add test file for new param validator
  • Validate against real p5 constructors
  • Account for less frequently used types (i.e. AudioNode)
  • Handle schema generation for optional parameters.
  • Validate against real p5 constants.
  • Implement a distance calculation mechanism similar to scoreOverload that gives user the proper error message when parameter validation fails.
  • Update script that generates parameterData.json to further reduce the information load.

New bugs discovered / TODOs after introducing changes:

  • cursor's overload is different from expectation (a mix of constants and primitive types)
  • createAudio overload is an array of empty arrays
  • Add support for lerpPalette's parameter, see added paletteLerp #6960
  • Agree on a most appropriate way to format and present error messages (mostly done, might require more work upon Ken's feedback)

To be completed before wrapping up the project:

  • Use the new parameter validation in p5
  • Clean up old code
Copy link

welcome bot commented Aug 15, 2024

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant