Hello, when following the instructions for installing the jqueryvalidate library via Composer, this warning is emitted:

Deprecation warning: require.jqueryvalidate is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -, . or _. The complete name should match "[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*". Make sure you fix this as Composer 2.0 will error.

If I recall, the jQuery naming convention is to use a period to separate the namespace from the project. In this case, the convention might be 'jquery.validate' instead of 'jqueryvalidate'.

I'm not sure what all goes into getting this updated, but figured that I'd file an issue about it.

Regards

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Luke.Leber created an issue. See original summary.

Luke.Leber’s picture

Issue summary: View changes
Eduardo Morales Alberti’s picture

I have the same issue, I changed the composer.json to follow the composer standards. I also patch the README to show the instructions to do that.

       {
         "type": "package",
         "package": {
-          "name": "jqueryvalidate",
+          "name": "jquery_validation/jqueryvalidate",
           "version": "1.17.0",
           "type": "drupal-library",
           "dist": {

-2. Run `composer require jqueryvalidate:~1.0`
+2. Run `composer require jquery_validation/jqueryvalidate:~1.0`
Eduardo Morales Alberti’s picture

Status: Active » Needs review

Change status.

Luke.Leber’s picture

I can confirm that following the updated README instructions in #3 seems to remove the deprecation warning.

JayKandari’s picture

Two suggestions from my side:

1. If vendor name could be jquery-validation instead of jquery_validation. Since this is the actual name in the original github repo.
2. If package name also could be : jquery-validation instead of jqueryvalidate. Again, the same reason as above.

For doing #2,
We would then require to change clientside_validation_jquery.libraries.yml file and change the existing lines with libraries/jqueryvalidate/ ... to libraries/jquery-validation/ ....

Accordingly, the following changes needs to be accomodated in README.md file:
Run `composer require jquery-validation/jquery-validation:~1.0`

Please let me know if I am missing something.

Eduardo Morales Alberti’s picture

Updated the patch by applying the changes suggested by JayKandari's comment.

Status: Needs review » Needs work
nikunjkotecha’s picture

https://drupal.slack.com/archives/C392CHBEW/p1568217354375600

Is there any way I can add an npm asset as dependency in composer.json of contrib module?
goal: npm-asset/jquery-validation as depdency for clientside_validation_jquery

If this is not possible I would update readme to do this and then update code to expect the library in the directory created by this operation. We would need backwards compatibility though.

Luke.Leber’s picture

On #7, would changing the libraries.yml file introduce a backward compatibility problem for users that update the module, but do not adjust their composer.json files?

nikunjkotecha’s picture

It would create issue and we need to handle it in code, in the alter hook or add multiple libraries. Need to think this through.

nikunjkotecha’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
FileSize
12.35 KB

Adding patch with updated folder name, readme and instructions to use it as npm-asset.

Will be adding this to 2.x branch as this is major change. Will need to add changelog file as well. Planning to also add Drush 9 support and remove Drush 8 support in 2.x to be ready with Drupal 9.

nikunjkotecha’s picture

Status: Needs work » Needs review
msuthars’s picture

Assigned: Unassigned » msuthars
msuthars’s picture

I reviewed the #12 patch and it working as expected. Client-side validation working for both ajax and non-ajax forms. I followed the below instructions:

1. First review Readme.md file to configure the jquery validator library.

2. Enable all three modules Clientside Validation, Clientside Validation jQuery, and Clientside Validation Demo.

3. Configure Clientside Validation jQuery settings (admin/config/user-interface/clientside-validation-jquery-settings) for Validate all forms before AJAX submit and Validate on Blur/focusout.

4. Test Client-side Validation Demo form (admin/config/user-interface/clientside-validation-demo) for client validation and it works as expected.

5. Tested library with all three options:
- CDN
- Direct download from the link.
- Configuring with composer

msuthars’s picture

Status: Needs review » Reviewed & tested by the community
msuthars’s picture

Assigned: msuthars » Unassigned

  • nikunjkotecha committed 8e675af on 8.x-2.x
    Issue #3066451 by Eduardo Morales, nikunjkotecha, Luke.Leber, msuthars,...
nikunjkotecha’s picture

Status: Reviewed & tested by the community » Fixed

Follow up ticket for Drush 9 (discussed in comment above) created: https://www.drupal.org/project/clientside_validation/issues/3083764

nikunjkotecha’s picture

RC Release created for 2.x to allow everyone to start using it.

Upgrade path is simple, added section for this in project page: https://www.drupal.org/project/clientside_validation#8x2x

Status: Fixed » Closed (fixed)

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

Kristen Pol’s picture

Issue tags: +Drupal 9 compatibility

Per a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.