Skip to content

update jquery validate method and removal of jquery migrate #32364

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

Closed

Conversation

jordanvector
Copy link

@jordanvector jordanvector commented Mar 4, 2021

Description (*)

Removes jQuery Migrate,
Updates Jquery validate method from event.handle to event.dispatch

Builds upon #25847

Related Pull Requests

https://github.com/magento/partners-magento2ee/pull/587

Fixed Issues (if relevant)

Fixes #21406 : remove jQuery Migrate

Manual testing scenarios (*)

None

Contribution checklist (*)

Pull request has a meaningful description of its purpose
All commits are accompanied by meaningful commit messages
All new or changed code is covered with unit/integration tests (if applicable)
All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Mar 4, 2021

Hi @jordanvector. Thank you for your contribution
Here are some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Mar 4, 2021
@jordanvector jordanvector mentioned this pull request Mar 4, 2021
4 tasks
@jordanvector
Copy link
Author

@magento run all tests

@ihor-sviziev
Copy link
Contributor

Let's wait for test results

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like this is not a full solution, as we still getting functional test failures. Could you check those test failures?
Also TBH I don't think it's a good solution to fix the validation library, maybe upgrading it will be much better. What do you think?

@jordanvector
Copy link
Author

@ihor-sviziev fair enough, updating the validation library is probably better than updating the methods within. I am gonna go take a look and see where jquery validation is these days and try to swap.

If it works I will update this PR..or make a new one

@ihor-sviziev
Copy link
Contributor

@jordanvector I would recommend starting from checking test failures, that might be not in the validation library at all

@jordanvector
Copy link
Author

@ihor-sviziev I did take a look at the test results and those look like maybe a network issue with the test rather than a code problem. Can we rerun the failed to confirm?

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Mar 4, 2021

We had similar issue on the previous PR. It doesn't look like false positive
Could you check that case manually on test instance?
@magento give me test instance

@magento-deployment-service
Copy link

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

@ihor-sviziev
Copy link
Contributor

@magento run all tests

@jordanvector
Copy link
Author

updated the jquery validate library to its latest version.

@magento run all tests

@jordanvector
Copy link
Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@mrtuvn
Copy link
Contributor

mrtuvn commented Jun 30, 2021

Hi @jordanvector Can you fix conflict file ?

@sivaschenko sivaschenko requested a review from fascinosum July 4, 2021 17:39
@sivaschenko sivaschenko added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. and removed Priority: P3 May be fixed according to the position in the backlog. labels Jul 4, 2021
@sivaschenko
Copy link
Member

@fascinosum please pay attention to this PR

@sivaschenko sivaschenko changed the base branch from 2.4-develop to platform-health July 4, 2021 17:42
@sivaschenko
Copy link
Member

Changed target branch to platform-health

@eduard13
Copy link
Contributor

Hi @jordanvector, thank you for working on this. I've also done some investigation on this area (more related to jQuery.validate), and it doesn't seem that we can easily update it. The main reason, being jQuery.metadata which is still used by core code, and not supported by the latest jQuery.migrate version. As result, we'll have the frontend validation not working for form fields that are still using the data-validate="{required:true}" approach.

Is it required to update the jQuery.validate on jQuery.migrate removal?

Thank you.

@eduard13
Copy link
Contributor

@magento run Static Tests, Unit Tests, Functional Tests CE, Functional Tests EE, Functional Tests B2B

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

1 similar comment
@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@eduard13 eduard13 self-assigned this Aug 13, 2021
@jordanvector
Copy link
Author

Hi @jordanvector, thank you for working on this. I've also done some investigation on this area (more related to jQuery.validate), and it doesn't seem that we can easily update it. The main reason, being jQuery.metadata which is still used by core code, and not supported by the latest jQuery.migrate version. As result, we'll have the frontend validation not working for form fields that are still using the data-validate="{required:true}" approach.

Is it required to update the jQuery.validate on jQuery.migrate removal?

Thank you.

@eduard13 that is exactly right and thank you for writing this up, the incompatibility specifically comes from the jquery validate function. And to also answer your question no updating jquery validate is not required to remove jquery migrate however if we do not upgrade jquery validate, there are 2 functions in the current version of jquery validate that use old deprecated jquery methods that need updating.

Specifically here

8fa540d#diff-ba3cf3f1b621df49d92f6733738b560443aafaff3f0d13ddbf414838e0a5fc0c

Depending on time and effort of updating jquery validate to the latest version, maybe its worth reverting back to the old version and fixing the deprecated methods, then a new ticket to update the jquery validate package in the future?

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@eduard13
Copy link
Contributor

Hi @jordanvector thank you for your comment. Indeed, I've reverted the jQuery.validate, however we still have some incompatibility issues with jQuery.multiselect library, which is the reason of failing the functional tests Tax related, as it still using the deprecated .attr('selected', flag) approach.

Regarding fixing the deprecated methods, if they are inside of some libraries, we should try to update it instead of directly changing it.

Will keep you updated if anything.

@eduard13
Copy link
Contributor

Hi @jordanvector, after investigating possible issues, looks like removing jQuery-migrate, at the moment will cause more problems with the existing libraries. Moreover, keeping it, will allow us easily update jQuery to the latest version which is planned for the near future.

Putting it on hold for now.

Thank you for understanding.

@eduard13
Copy link
Contributor

Closing this PR for now, as it is planned to proceed updating the jQuery-migrate.
Thank you @jordanvector for your input here.

@eduard13 eduard13 closed this Aug 30, 2021
@m2-assistant
Copy link

m2-assistant bot commented Aug 30, 2021

Hi @jordanvector, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Frontend Area: Lib/Frontend Component: Theme Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Project: Platform Health Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove jQuery Migrate
8 participants