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
Comment | File | Size | Author |
---|---|---|---|
#12 | 3066451-12.patch | 12.35 KB | nikunjkotecha |
#7 | clientside_validation-composer_deprecation_warning-3066451-7-8.x.patch | 2.61 KB | Eduardo Morales Alberti |
|
Comments
Comment #2
Luke.LeberComment #3
Eduardo Morales AlbertiI 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.
Comment #4
Eduardo Morales AlbertiChange status.
Comment #5
Luke.LeberI can confirm that following the updated README instructions in #3 seems to remove the deprecation warning.
Comment #6
JayKandariTwo suggestions from my side:
1. If vendor name could be
jquery-validation
instead ofjquery_validation
. Since this is the actual name in the original github repo.2. If package name also could be :
jquery-validation
instead ofjqueryvalidate
. 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/ ...
tolibraries/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.
Comment #7
Eduardo Morales AlbertiUpdated the patch by applying the changes suggested by JayKandari's comment.
Comment #9
nikunjkotechahttps://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.
Comment #10
Luke.LeberOn #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?
Comment #11
nikunjkotechaIt would create issue and we need to handle it in code, in the alter hook or add multiple libraries. Need to think this through.
Comment #12
nikunjkotechaAdding 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.
Comment #13
nikunjkotechaComment #14
msutharsComment #15
msutharsI 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
Comment #16
msutharsComment #17
msutharsComment #19
nikunjkotechaFollow up ticket for Drush 9 (discussed in comment above) created: https://www.drupal.org/project/clientside_validation/issues/3083764
Comment #20
nikunjkotechaRC 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
Comment #22
Kristen PolPer 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.