jquense / yup

Dead simple Object schema validation
MIT License
22.94k stars 935 forks source link

#2043 introduce ValidationErrorNoStack class to improve error creation performance #2142

Closed tedeschia closed 8 months ago

tedeschia commented 12 months ago

This Pull Request introduces ValidationErrorNoStack, a class aimed at enhancing performance in error validation processes. Similar to ValidationError, it does not extend from Error and avoids capturing the stack trace. This approach significantly improves efficiency, particularly for validations of large arrays.

Key Features:

Benefits:


This update provides an efficient solution for intensive validation scenarios while preserving the functionality for current users.


jquense commented 9 months ago

@tedeschia here is how i would do it: https://github.com/tedeschia/yup/compare/2043-performance-improvement...jquense%3Ayup%3A2043-performance-improvement

tedeschia commented 8 months ago

@jquense great! I have adopted your proposal, made a minor fix (setting "type" prop on ValidationError constructor), updated the project using the consolidated ValidationError class and fixing some tests. Are we OK to merge the changes now?

jquense commented 8 months ago

thanks!