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

Upgrade jquery to 3.6.0 #34162

Closed
wants to merge 5 commits into from
Closed

Conversation

mrtuvn
Copy link
Contributor

@mrtuvn mrtuvn commented Sep 26, 2021

Description (*)

This pull efforts to upgrade jquery to version 3.6.0
added resolve passive event listeners problem on mobile (touchstart) when call preventDefault

https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.js
minify version
https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js

jquery-migrate 3.3.2
https://code.jquery.com/jquery-migrate-3.3.2.js

Guide
https://jquery.com/upgrade-guide/3.0/

Remain works
-remove old patches (jQuery UI - v1.12.1)
https://github.com/magento/magento2/tree/2.4-develop/lib/web/jquery/patches
seperate each components to individual package

-check compatible with remain widgets
https://github.com/magento/magento2/tree/2.4-develop/lib/web/jquery (Main here)
Other places in external modules, EE, v.v

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Should we minimal jquery widget ?

'jquery-ui-modules/core',
'jquery-ui-modules/accordion',
'jquery-ui-modules/button',
'jquery-ui-modules/datepicker',
'jquery-ui-modules/dialog',
'jquery-ui-modules/draggable',
'jquery-ui-modules/effect',
'jquery-ui-modules/menu',
'jquery-ui-modules/mouse',
'jquery-ui-modules/position',
'jquery-ui-modules/progressbar',
'jquery-ui-modules/resizable',
'jquery-ui-modules/selectable',
'jquery-ui-modules/slider',
'jquery-ui-modules/sortable',
'jquery-ui-modules/tabs',
'jquery-ui-modules/timepicker',
'jquery-ui-modules/tooltip',
'jquery-ui-modules/widget'

Instead load all above. We only use on demands files

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)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Sep 26, 2021

Hi @mrtuvn. 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

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Oct 1, 2021

remain task upgrade jquery ui (current latest 1.12.1) following magento seperate to modules

@xmav
Copy link
Contributor

xmav commented Oct 1, 2021

Hi @mrtuvn !
Thank you for this contribution! Cannot wait to see build results )

@xmav
Copy link
Contributor

xmav commented Oct 2, 2021

@mrtuvn Let me share some info: We(magento team) are working on jquery-ui upgrade. Please contact me if you plan to work on jquery-ui upgrade so we can sync and avoid duplication in efforts

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Oct 2, 2021

Hi @xmav you can work directly on this branch . If you need write access branch please let me know.

@fascinosum
Copy link
Contributor

@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.

@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 Author

mrtuvn commented Oct 17, 2021

@xmav Can you deliver this error note to team
mage-backend-tabs
I also got this issue before
related with component mage/backend/tabs

@xmav
Copy link
Contributor

xmav commented Oct 21, 2021

Hi @mrtuvn
Could you provide steps to reproduce issue above ?

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Oct 21, 2021

Upgrade to jquery 3.6.0 + jquery ui to latest -> Go to admin
open console tab
You may got this notice that._tabId is not function

@xmav
Copy link
Contributor

xmav commented Oct 23, 2021

Got it. We are currently working on jqueryUI only so we don't see this error yet

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Nov 3, 2021

@magento run Unit Tests, Functional Tests EE, Functional Tests CE, 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.

@mrtuvn mrtuvn force-pushed the upgrade-jquery-3.6.0 branch 2 times, most recently from ce9a913 to 47dbe8c Compare November 3, 2021 15:55
@mrtuvn
Copy link
Contributor Author

mrtuvn commented Nov 4, 2021

@krissyhiserote i will let this PR like this. Other fixes can do by another seperate PR. So you team can keep working as normal. Later code merge to develop i will sync with this. Seem a long road ahead for check new compatible

@bondmedia007
Copy link

Afternoon all, Our Penetration testers have found that the current jQuery version used in Magento 2.4.3 is vulnerable in some means to hackers does this thread relate to the issue found?

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Nov 9, 2021

2.4.3 still use old version jquery. This pr will update to higher version. Internal team currently working upgrade compatible with new update

@bondmedia007
Copy link

@mrtuvn thanks for letting me know, when you say internal team do you mean the guys working at Magento?

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Nov 18, 2021

Yes @xmav may know more details

@Rrego6
Copy link
Contributor

Rrego6 commented Nov 22, 2021

Hi there, @mrtuvn . If you get a chance, could you help me understand the reason for changes to lib/web/jquery/patches/jquery.js? To me, it makes more sense to remove this file entirely.

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Nov 22, 2021

That file apply fixes for lighthouse warn "Does not use passive listeners to improve scrolling performance"

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Nov 23, 2021

Pull latest code to branch
@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.

@Rrego6
Copy link
Contributor

Rrego6 commented Nov 23, 2021

@mrtuvn I don't think that lighthouse warnings are necessary to fix for this upgrade. The upgrade does not cause these issues correct?

This change to patches breaks our unit tests since the function signature for the callback in the patch is not valid. (ns is null)

We will create a separate ticket to track and investigate this.

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Nov 24, 2021

I can remove that file in this scope of ticket. And tracking warning lighthouse in seperate PR/ticket

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Nov 24, 2021

@magento run Functional Tests CE, Functional Tests EE, Functional Tests B2B, Unit 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 Author

mrtuvn commented Nov 24, 2021

Deleted file patches jquery.
@magento run Unit 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.

Revert changes to avoid conflicts
@mrtuvn
Copy link
Contributor Author

mrtuvn commented Nov 25, 2021

@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 Author

mrtuvn commented Nov 30, 2021

Closed this because internal team already delivery updated jquery 3.6.0 to mainline codebase (2.4-develop branch)

@bondmedia007
Copy link

good morning @mrtuvn thanks for keeping us updated, when will the upgraded Jquery be available to upgrade on M 2.4.3

@mrtuvn
Copy link
Contributor Author

mrtuvn commented Nov 30, 2021

I'm not sure maybe @xmav @sidolov may know this

@bondmedia007
Copy link

Thank you @mrtuvn look forward to hearing from @xmav and @sidolov have a great day.

@xmav
Copy link
Contributor

xmav commented Nov 30, 2021

I am not aware of plans to backport this to 2.4.3

@kirmorozov
Copy link
Member

Good Luck :) I tried it years ago.
#13685

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants