Opened 2 years ago
Last modified 5 days ago
#60478 new task (blessed)
Upgrade to jQuery 4.0
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | External Libraries | Keywords: | needs-patch needs-testing |
| Focuses: | javascript, performance | Cc: |
Description (last modified by )
Version 4.0.0 of jQuery has been released.
https://blog.jquery.com/2026/01/17/jquery-4-0-0/
Previously:
~JQuery just released a beta version of jQuery v4. Is this something that wp core will be looking to implement?~
https://blog.jquery.com/2024/02/06/jquery-4-0-0-beta/
Change History (39)
This ticket was mentioned in Slack in #core by swissspidy. View the logs.
2 years ago
#4
follow-up:
↓ 5
@
2 years ago
@azaozz Maybe something for the https://wordpress.org/plugins/wp-jquery-update-test/ plugin?
#5
in reply to:
↑ 4
@
2 years ago
- Milestone changed from Awaiting Review to Future Release
Is this something that wp core will be looking to implement?
Of course :)
Replying to swissspidy:
Maybe something for the https://wordpress.org/plugins/wp-jquery-update-test/ plugin?
Yep, thinking the test plugin can be updated for WP 6.5 (currently in beta). Then try to time the update to jQuery 4.0 depending on when it is released.
#6
@
23 months ago
The https://wordpress.org/plugins/wp-jquery-update-test/ plugin is not compatible with newer versions of WordPress; it is only compatible with WordPress 5.6 and earlier versions.
Does anyone have suggestions on how to test it with jQuery 4.0.0 BETA?
This ticket was mentioned in PR #6304 on WordPress/wordpress-develop by @adamsilverstein.
22 months ago
#7
- Keywords has-patch has-unit-tests added
Trac ticket:
@adamsilverstein commented on PR #6304:
22 months ago
#8
All tests pass here despite having removed utf8_encode, which is unexpected. is it possible this encoding is no longer required?
#10
@
22 months ago
Adding the performance tag, noting that the new jQuery version touts some performance benefits, including a "slim" version with a smaller size. https://blog.jquery.com/2024/02/06/jquery-4-0-0-beta/
This ticket was mentioned in Slack in #core-performance by mukeshpanchal27. View the logs.
22 months ago
#13
@
22 months ago
Note the linked PR above is not related to this ticket, I'm not sure how it got linked and can't seem to remove the linkage.
This ticket was mentioned in Slack in #core-performance by mukeshpanchal27. View the logs.
21 months ago
#15
follow-up:
↓ 16
@
21 months ago
@azaozz Maybe something for the https://wordpress.org/plugins/wp-jquery-update-test/ plugin?
I opened this issue to track adding support in the wp-jquery-update-test plugin.
#16
in reply to:
↑ 15
@
21 months ago
Replying to adamsilverstein:
Thanks. Yea, lets update the plugin for WP 6.5+. Seems it will only need to replace the bundled version of jQuery.
Somewhat unsure if jQuery 4.0 beta supports Migrate 3.4.1 and UI 1.13.2, or these will have to be updated too (when updates are available). Still good to update the test plugin imho.
#17
@
21 months ago
@adamsilverstein Updated the test plugin: https://github.com/WordPress/wp-jquery-update-test, could you have a look too if you get a chance :)
Also did some quick testing with jQuery 4.0.0-beta in wp-admin and everything seems to be working well. If all seems okay with the test plugin the next step would be to publish on make/core and invite (a lot) more testing.
#18
@
19 months ago
Been seeing this bug in jQuery Migrate https://github.com/jquery/jquery-migrate/issues/495 quite a bit recently jQuery.expr.match.bool is undefined. It is patched upstream but there's no new Migrate release yet. As WP depends on running jQuery Migrate, thinking to release the test plugin with a new version of Migrate so the people that will test jQuery 4 in WP don't run into it.
#19
follow-up:
↓ 20
@
19 months ago
@azaozz thanks for the reminder. I’m on vacation now but I’ll remember to release a new Migrate on early July when I’m back.
#21
follow-up:
↓ 22
@
19 months ago
@azaozz jQuery Migrate 3.5.0 has been released: https://github.com/jquery/jquery-migrate/releases/tag/3.5.0
#22
in reply to:
↑ 21
@
19 months ago
Replying to mgol:
Thanks for the ping! Will update the WP test plugin asap.
#23
@
19 months ago
Updated the test plugin.
@adamsilverstein Could you have a quick look if I haven't missed anything. Thinking to release it as soon as WP 6.6 is out.
#25
follow-up:
↓ 26
@
19 months ago
All of the readme and base class updates look good, I'm happy to try some testing, but I think its fine to release and get wider testing at this point so we can see how smooth upgrading goes for people.
#26
in reply to:
↑ 25
@
19 months ago
Replying to adamsilverstein:
Great! Thanks for having a look. Will release it in couple of days, as soon as WP 6.6 is out.
#27
@
19 months ago
Testing plugin released: https://wordpress.org/plugins/wp-jquery-update-test/. Please install it and test!
#28
@
18 months ago
The second beta of jQuery 4.0.0 has been released: https://blog.jquery.com/2024/07/17/second-beta-of-jquery-4-0-0/
Note the changed handling of boolean attributes, that’s the most risky change in this release compared to the previous beta.
#29
@
17 months ago
The second beta of jQuery 4.0.0 has been released:
Yep, updated the testing plugin to include it and the latest jQuery Migrate. Also posted to make/core: https://make.wordpress.org/core/2024/08/23/updating-jquery-shipped-with-wordpress-to-version-4-0/
This ticket was mentioned in Slack in #core by desrosj. View the logs.
6 weeks ago
#31
@
6 weeks ago
A while ago, we've released 4.0.0-rc.1: https://blog.jquery.com/2025/08/11/jquery-4-0-0-release-candidate-1/.
We haven't got any serious bug reports since that release, so we're preparing to release the final version, likely with few changes from the RC. That said, ticket #51812 needs to be addressed - removing jQuery Migrate 3.x - before the update to jQuery 4.x can be attempted.
#32
@
6 weeks ago
See also a related ticket #62757 about updating jQuery UI to 1.14 - that release line is already 1.5 years old and has few breaking changes (mostly dropping IE & Edge Legacy support).
#33
@
5 days ago
jquery 4 is out now
https://blog.jquery.com/2026/01/17/jquery-4-0-0/
#34
follow-ups:
↓ 36
↓ 38
↓ 39
@
5 days ago
- Keywords needs-testing added
- Milestone changed from Future Release to 7.0
I tentatively moved this to milestone 7.0. Given that we are still in the alpha phase, it might good to implement this soon, to get lots of testing.
Main changes are removed support with older versions of IE, but that should not be critical as WordPress did that itself recently.
However, several already deprecated API methods (e.g. those that now have native JS alternatives) have been removed, which could have an impact on plugins that are (still) using them (despite long-existing deprecation warnings).
Given that this breaks backward compatibility, it might be worth considering updating jQuery-migrate to 3.6.0 first (see #51812), if the direct update to jQuery 4.0 turns out to have too many immediate downsides.
An upgrade guide is available at https://jquery.com/upgrade-guide/4.0/
#35
@
5 days ago
- Description modified (diff)
- Summary changed from Upgrade to JQuery 4 to Upgrade to jQuery 4.0
- Type changed from enhancement to task (blessed)
#36
in reply to:
↑ 34
@
5 days ago
Replying to TobiasBg:
However, several already deprecated API methods (e.g. those that now have native JS alternatives) have been removed, which could have an impact on plugins that are (still) using them (despite long-existing deprecation warnings).
I use a variety of plugins where jQuery-migrate already logs deprecation warnings. I assume these will break entirely when Core moves to 4.0.
However, one worry I have with relying mainly on wp-jquery-update-test + jQuery Migrate is that it only tells you what breaks while you’re clicking around. Any JS that doesn’t run during testing just gets missed.
Would it make sense to add a static scan that looks at a plugin/theme’s JS files and flags removed or deprecated jQuery APIs with file + line number, without executing the code? This seems a lot like what Plugin Check already does for PHP, but for jQuery compatibility.
As a secondary thing (clearly non-blocking), the same scan could eventually point out places where jQuery usage could be optionally "modernized" to use vanilla js and browser APIs. This could be part of the broader Performance team efforts.
Whatever the approach, I suspect this will cause more issues than a typical core update. So, I think this would need a solid pre-emptive outreach effort such that plugin devs even become aware of the changes and possible solutions ahead of time.
This ticket probably isn’t the right place for that discussion, but where would it make sense to continue it? Plugin Check repo? Core Slack?
#37
@
5 days ago
As it turns out, there was considerable discussion on all of these points (outreach, compatibility detection, modernizing core to not use jQuery at all, etc) in #37110, regarding updating to jQuery 3.x.
One comment, by @desrosj (about work done with @clorith) stood out to me in that it seems to have done some sort of static analysis across the plugin repo. https://core.trac.wordpress.org/ticket/37110#comment:176
With Plugin Check and more tooling around these days, I figure that even more comprehensive scanning could be done now.
#38
in reply to:
↑ 34
@
5 days ago
Replying to TobiasBg:
I tentatively moved this to milestone 7.0. Given that we are still in the alpha phase, it might good to implement this soon, to get lots of testing.
+1 on getting this merged early here and writing a deeper post on the blog to let plugin/theme authors know early of this planned change.
#39
in reply to:
↑ 34
@
5 days ago
Replying to TobiasBg:
I tentatively moved this to milestone 7.0. Given that we are still in the alpha phase, it might good to implement this soon, to get lots of testing.
That seems really...optimistic. jQuery 3.0 was released in 2016, but it was not until 2020 that WordPress finally updated to jQuery 3.x (see #50564).
According to this comment, jQuery Migrate 3.6.0 "will prepare to a future migration to jQuery 4 much better by warning against many more breaking changes." But WordPress is still using jQuery Migrate 3.4.1. Wouldn't it be better to update to jQuery Migrate 3.6.0 first, before trying to update to jQuery 4?
#60511 was marked as a duplicate.