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

perf(forms): avoid direct references to the Validators class #41189

Commits on Mar 15, 2021

  1. perf(forms): avoid direct references to the Validators class

    Currently the `Validators` class contains a number of static methods that represent different validators as well as some helper methods. Since class methods are not tree-shakable, any reference to the `Validator` class retains all of its methods (even if you've used just one).
    
    This commit refactors the code to extract the logic into standalone functions and use these functions in the code instead of referencing them via `Validators` class. That should make the code more tree-shakable. The `Validators` class still retains its structure and calls these standalone methods internally to keep this change backwards-compatible.
    AndrewKushnir authored and thePunderWoman committed Mar 15, 2021
    Configuration menu
    Copy the full SHA
    966d897 View commit details
    Browse the repository at this point in the history