Problem/Motivation

The additional-methods.js provided by the jquery-validation library is 42kB in size and is a hodge podge of validation methods that are unrelated to validation via a regex pattern. However the Pattern Validator Plugin provided by clientside_validation_jquery loads the entire js file to make use of the 1 method in it. This could be more efficient.

Steps to reproduce

Tested with webform:

  1. Configure a form field to be validated by pattern or via a custom plugin that relies on pattern
  2. Check the form on a page
  3. Check network activity in dev tools and see that additional-methods.js is loaded

Proposed resolution

Move the pattern validation method out into a separate file that is provided by the Drupal module instead of loading the entire additional-methods.js file provided by the 3rd party library.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

angrytoast created an issue. See original summary.

angrytoast’s picture

Status: Active » Needs review

nikunjkotecha made their first commit to this issue’s fork.

nikunjkotecha’s picture

Category: Bug report » Support request
Status: Needs review » Fixed

Marked as support request considering it isn't a bug in code but a performance enhancement.

Merged the code.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.