jquery-ui icon indicating copy to clipboard operation
jquery-ui copied to clipboard

Deprecated Jquery code in the minified version of `jquery-ui`

Open carlolalu opened this issue 1 year ago • 8 comments

jquery-migrate-3.5.0 warns of the usage of the subsequent deprecated code in the minified version of jquery-ui (the links have been obscured for privacy consideration):

JQMIGRATE: jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos [jquery-migrate-3.5.0.js:136:12](https://****/jquery-migrate-3.5.0.js)
console.trace() [jquery-migrate-3.5.0.js:138:13](https://***/jquery-migrate-3.5.0.js)
    jQuery 5
JQMIGRATE: jQuery.fn.mouseup() event shorthand is deprecated [jquery-migrate-3.5.0.js:136:12](https://****/jquery-migrate-3.5.0.js)
console.trace() [jquery-migrate-3.5.0.js:138:13](https://****/jquery-migrate-3.5.0.js)
    jQuery 5
JQMIGRATE: jQuery.isFunction() is deprecated [jquery-migrate-3.5.0.js:136:12](https://****/jquery-migrate-3.5.0.js)
console.trace() [jquery-migrate-3.5.0.js:138:13](https://****/jquery-migrate-3.5.0.js)
    jQuery 8
JQMIGRATE: jQuery.fn.delegate() is deprecated [jquery-migrate-3.5.0.js:136:12](https://****/jquery-migrate-3.5.0.js)
console.trace() [jquery-migrate-3.5.0.js:138:13](https://****/jquery-migrate-3.5.0.js)
    jQuery 7
JQMIGRATE: jQuery.fn.mousedown() event shorthand is deprecated [jquery-migrate-3.5.0.js:136:12](https://****/jquery-migrate-3.5.0.js)
console.trace() [jquery-migrate-3.5.0.js:138:13](https://****/jquery-migrate-3.5.0.js)
    jQuery 3
    <anonymous> https://****####
    jQuery 13
JQMIGRATE: jQuery.fn.unbind() is deprecated [jquery-migrate-3.5.0.js:136:12](https://****/jquery-migrate-3.5.0.js)
console.trace() [jquery-migrate-3.5.0.js:138:13](https://****/jquery-migrate-3.5.0.js)
    jQuery 9
    <anonymous> https://****####
    jQuery 13
JQMIGRATE: jQuery.fn.focus() event shorthand is deprecated [jquery-migrate-3.5.0.js:136:12](https://****/jquery-migrate-3.5.0.js)
console.trace() [jquery-migrate-3.5.0.js:138:13](https://****/jquery-migrate-3.5.0.js)
    jQuery 10
    <anonymous> https://****####
    jQuery 13
JQMIGRATE: jQuery.fn.keydown() event shorthand is deprecated [jquery-migrate-3.5.0.js:136:12](https://****/jquery-migrate-3.5.0.js)
console.trace() [jquery-migrate-3.5.0.js:138:13](https://****/jquery-migrate-3.5.0.js)
    jQuery 8
    <anonymous> https://****####
    jQuery 13
JQMIGRATE: jQuery.fn.keypress() event shorthand is deprecated [jquery-migrate-3.5.0.js:136:12](https://****/jquery-migrate-3.5.0.js)
console.trace() [jquery-migrate-3.5.0.js:138:13](https://****/jquery-migrate-3.5.0.js)
    jQuery 8
    <anonymous> https://****####
    jQuery 13
JQMIGRATE: jQuery.fn.keyup() event shorthand is deprecated [jquery-migrate-3.5.0.js:136:12](https://****/jquery-migrate-3.5.0.js)
console.trace() [jquery-migrate-3.5.0.js:138:13](https://****/jquery-migrate-3.5.0.js)
    jQuery 8
    <anonymous> https://****####
    jQuery 13

Notice that when running this with the non-minified version no warning is issued.

carlolalu avatar Jul 26 '24 11:07 carlolalu

By minifying autonomously jquery-ui.js the problem was solved (no warnings by the jquery-migrate tool). Could it be that the file jquery-ui.min.js of the official release does not correspond to the minified version of jquery-ui.js?

carlolalu avatar Jul 26 '24 14:07 carlolalu

Which version of jQuery UI and where are you getting it from?

mgol avatar Jul 30 '24 16:07 mgol

Also, what version of jQuery do you use? If an old one, some Migrate warnings are expected.

mgol avatar Jul 30 '24 16:07 mgol

This was happening in the process of updating jquery and jquery-ui to their last stable versions (3.7.1 and 1.13 respectively), and jquery-migrate-3.5.0 was used in combination with them to spot any errors/warnings. The migrate tool did not warn of any issues in the uncompressed version, but it did in the minified version of jquery-ui (taken from the zip file downloaded on the official website).

It is worthy of notice that this did not happen with jquery-migrate-3.4.1 and that jquery-migrate-3.5.0 has been released a coupe of weeks ago, so maybe the team responsible jquery-ui is still working on it.

carlolalu avatar Jul 31 '24 07:07 carlolalu

Which 1.13 UI version? Please be specific.

Can you check the behavior with jQuery 3.7.1, jQuery UI 1.13.3 & jQuery Migrate 3.5.2?

Also, you mention the difference between using the minified version of jQuery UI or the unminified one. Which versions of jQuery & jQuery Migrate are you using in both cases: minified or unminified?

mgol avatar Jul 31 '24 09:07 mgol

Please also double-check your setup. There are no differences between Migrate 3.4.1 & 3.5.0 that would explain such a difference; see the 3.5.0 release notes: https://github.com/jquery/jquery-migrate/releases/tag/3.5.0.

mgol avatar Jul 31 '24 09:07 mgol

You are right, I did not check the usage of jquery-migrate-3.4.1.js together with the minified file jquery-ui.min.js but only with the uncompressed development version file jquery-ui.js. Still I am sure of the problem encountered with jquery-migrate3.5.0 and the file jquery-ui.min.js, at least at the time of opening the issue.

PS: thank you!

carlolalu avatar Aug 01 '24 09:08 carlolalu

Please answer all my other questions, I cannot really do anything without those answers.

mgol avatar Aug 01 '24 10:08 mgol

My setup had jquery 3.7.1 (non minified) and jquery-migrate 3.5.0 (not minified).

The problem was present with the officially shipped jquery-ui.min.js (thus from the website https://jqueryui.com/ by clicking on the button 'Custom Download') where the jquery-ui custom version 1.13.1 included the all macro sections but the one Effects and the with the theme Smoothness.

I encountered no issues with the non-minified version jquery-ui.js of JqueryUI with the same characteristics as above, thus I minified such file myself and still had no warnings from jquery-migrate. Because of this and because of the lack of big changes in https://github.com/jquery/jquery-migrate/releases/tag/3.5.0 it could have been that the problem was in the lack of correspondence between jquery-ui.js and its officially minified version jquery-ui.min.js, meaning that jquery-ui.min.js could have been the minification of some older version of jquery-ui.js and not the 1.13.1, but that is only an hypothesis.

Unluckily I cannot retry the problem with the new versions you asked me because the code is not anymore available to me. Thank you anyway for your availability, I hope my answer is at least a bit helpful.

carlolalu avatar Aug 29 '24 08:08 carlolalu

I've just downloaded jQuery UI 1.13.3 via the Custom Download link, selecting the modules you described but the versions look correct. In both files, the only mention of jQuery.expr[':'] is in a conditional definition of jQuery.expr.pseudos for jQuery 1.9 or older.

There's also no mention of unbind in the entire minified file. jQuery has stopped using deprecated event shorthands long ago.

I cannot really do more here; I can't even be sure if there was really an issue on our side or if it's something specific to your setup, but I cannot reproduce it.

If you provide very specific steps to reproduce the warnings you posted in the initial post, I can try it, but without it, that's the end of the road for me. Ideally, a simple test case that I can just open & see the warnings immediately.

I'm going to close the issue for now since I don't see anything actionable for us here. You can still post updates here. If you add a reproducible example that I can run and the issue is on our side, I'll reopen.

mgol avatar Aug 30 '24 15:08 mgol