-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Remove jQuery Migrate #25847
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
Remove jQuery Migrate #25847
Conversation
Hi @Parakoopa. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
3c0e55b
to
42b456a
Compare
Functional tests are failing. |
Hey @Parakoopa, thanks for the contribution! Could you please follow the scenario of one of the failing tests and check what's the problem yourself? Additionally, I'm not sure if we are allowed to remove jQuery Migrate at all. There can be 3rd party modules and extensions that would break without it and I'm not sure if we can introduce such change before Magento 2.4. I'll try to discuss this with other maintainers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the tests, internal Magento modules shouldn't rely on jQuery Migrate.
@krzksz I believe we can remove it as part of Magento 2.4 release |
Hi @torhoehn, thank you for the review.
|
This ticket has to wait for |
Hi @ihor-sviziev , @hostep! Does it make sense to leave jQuery migrate for developer mode only? It will be disabled in production mode but may be helpful for developers, what do you think? |
I think it’s useless, as magento has it for a long time and if someone had
any issues - they definitely already resolved them. I think full removal
should be better, unless migration to latest jquery version
…On Thu, 20 Aug 2020 at 17:59 Stanislav Idolov ***@***.***> wrote:
Hi @ihor-sviziev <https://github.com/ihor-sviziev> , @hostep
<https://github.com/hostep>! Does it make sense to leave jQuery migrate
for developer mode only? It will be disabled in production mode but may be
helpful for developers, what do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25847 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOJOUJ2CIIDTFAETQGFXDLSBU25BANCNFSM4JS7J7YA>
.
|
I was going to say the exact same thing as @ihor-sviziev 🙂 But I'm not a frontend expert, maybe @krzksz or @DanielRuf or @Parakoopa or @kirmorozov or @zetlen or @leoquijano or @jonathanKingston have a much better founded opinion (sorry for the inclusion guys, all of you are involved in discussions around jquery/jquery v3/jquery migrate here in this repo) |
Well, WordPress 5.5 did the same (removing jQuery Migrate) and many plugins and themes were broken - they even announced it a while back but many big plugin developers seem to have forgotten this and users had issues which were resolved by installing the Enable jQuery Migrate Helper plugin in this case. So we should clearly communicate this with the Magento partners and solution providers (modules / plugins) with a clear roadmap and schedule when this will be released. Otherwise this would catch many by surprise. |
I agree that any major changes to jQuery dependencies (e. g. jQuery Migrate) should be rolled out carefully. But keep in mind that this has been going on for a long time. My comment about this dependency blocking newer libraries is already two years old, for example. A lot of developers (and probably solution partners) are still relying on Magento's default frontend for theming. Having more modern tools would be nice, but if they can't have them, at least jQuery 3 (which is 4 years old) would help them move forward. |
I totally agree with you. We should just make sure that this is properly communicated and that we cover this in the docs so we can point them at this then (why does my code not work anymore? We've removed jQuery Migrate. Here's some guide / are some tips to resolve the problems). Maybe a warning in the frontend docs at the top. But this is just an idea and my opinion / my two cents. |
Would it make sense to add a simple configuration option in Magento where you can choose to include jquery migrate yes or no? That way it can be kept backwards compatible whilst also giving people who know what they are doing the option to remove it if they so wish to. It might be a bit awkward though to put this in the adminhtml configuration, since it's very developer oriented. Maybe a better idea would be to provide an option for including/excluding it in the Just an idea ... |
That makes sense, yes.
That is a good question, I'm not yet sure which place is the best option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Parakoopa,
I just reviewed failing tests - seems like in some cases w/o jquery migrate magento works incorrectly. Could you double check failing tests and update your changes accordingly?
I believe such fixes might be delivered separately than removing jquery migrate
Hi @Parakoopa, |
Sorry, I missed the last comment, I'll check the tests when I find the time. |
@magento run all tests |
Hi @Parakoopa, |
Hi @Parakoopa, thank you for your contribution! |
Just incase this ever gets picked up again and worked on. The current implementation of jquery-validate uses $.event.handle...... calls. magento2/lib/web/jquery/jquery.validate.js Lines 1251 to 1262 in 9772213
These are undocumented and deprecated. Jquery.migrate is required for these calls to work under IE11. Whilst IE11 may not be supported anymore, it still does largely work ok (well on my site atleast) so seems a shame to remove jquery-migrate without first addressing the use of $.event.handle in jquery-validate. Looks like jquery-validate hasn't been updated to any significant degree in a long time!! :( |
jQuery migrate is included for a reason. The best thing is to update the jQuery to latest version and update all core algorithms accordingly, than jQuery migrate wont be needed. I believe that likely it can't prove enough value for Magento to do it. Time passes and jQuery 3 gets required for many plugins and systems based on jQuery, which makes this bigger problem in time as it's introducing difficulty in customizing the frontend with newer software. |
Could we not swap the $.event.handle with $.event.dispatch and then remove jquery migrate? I have been testing this change in IE, so far so good. Will update my answer if I run into any issues.
|
@jordanvector could you create a pr with your suggested changes, it will be much easier to see the test results ? |
@ihor-sviziev new PR |
Description (*)
Removes jQuery Migrate
Fixed Issues (if relevant)
Manual testing scenarios (*)
None
Contribution checklist (*)