N°7355 - Update jQuery-migrate to 3.4.1

This commit is contained in:
Molkobain
2024-03-22 16:35:41 +01:00
parent e8c4c45c5c
commit db4c70cea3
26 changed files with 1811 additions and 390 deletions

6
node_modules/.package-lock.json generated vendored
View File

@@ -163,9 +163,9 @@
}
},
"node_modules/jquery-migrate": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.1.0.tgz",
"integrity": "sha512-u/MtE1ST2pCr3rCyouJG2xMiw/k3OzLNeRKprjKTeHUezCGr0DyEgeXFdqFLmQfxfR5EsVu+mGo/sCcYdiYcIQ==",
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.4.1.tgz",
"integrity": "sha512-6RaV23lLAYccu8MtLfy2sIxOvx+bulnWHm/pvffAi7KOzPk1sN9IYglpkl1ZNCj1FSgSNDPS2fSZ1hWsXc200Q==",
"peerDependencies": {
"jquery": ">=3 <4"
}

View File

@@ -9,8 +9,3 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[package.json]
indent_style = space
indent_size = 2

View File

@@ -2,7 +2,5 @@ coverage
external
node_modules
*.min.js
src/intro.js
src/outro.js
test/data/jquery-*.js
test/data/jquery.mobile-*.js

32
node_modules/jquery-migrate/.eslintrc-browser.json generated vendored Normal file
View File

@@ -0,0 +1,32 @@
{
"root": true,
"extends": "jquery",
// Support: IE <=9 only, Android <=4.0 only
// The above browsers are failing a lot of tests in the ES5
// test suite at http://test262.ecmascript.org.
"parserOptions": {
"ecmaVersion": 3
},
// The browser env is not enabled on purpose so that code takes
// all browser-only globals from window instead of assuming
// they're available as globals. This makes it possible to use
// jQuery with tools like jsdom which provide a custom window
// implementation.
"env": {},
"globals": {
"window": true
},
"rules": {
"one-var": [ "error", { "var": "always" } ],
"strict": [ "error", "function" ],
// Support: IE <=9 only, Android <=4.0 only
// Allow square bracket notation for ES3 reserved words
"dot-notation": [ "error", { "allowKeywords": false } ]
}
}

18
node_modules/jquery-migrate/.eslintrc-node.json generated vendored Normal file
View File

@@ -0,0 +1,18 @@
{
"root": true,
"extends": "jquery",
"parserOptions": {
"ecmaVersion": 2018
},
"env": {
"es6": true,
"node": true
},
"rules": {
"strict": ["error", "global"]
}
}

View File

@@ -1,8 +1,14 @@
{
"extends": "jquery",
"root": true,
"env": {
"browser": false,
"node": true
}
"extends": "./.eslintrc-node.json",
"overrides": [
{
"files": ["**/*.mjs"],
"parserOptions": {
"sourceType": "module"
}
}
]
}

726
node_modules/jquery-migrate/.log86986 generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +0,0 @@
language: node_js
sudo: false
node_js:
- "8"
addons:
chrome: stable
script: "npm run ci"

View File

@@ -47,7 +47,7 @@ Make sure you have reproduced the bug with all browser extensions and add-ons di
### Try the latest version of jQuery
Bugs in old versions of jQuery may have already been fixed. In order to avoid reporting known issues, make sure you are always testing against the [latest build](http://code.jquery.com/jquery.js).
Bugs in old versions of jQuery may have already been fixed. In order to avoid reporting known issues, make sure you are always testing against the [latest jQuery version](https://releases.jquery.com/jquery/).
### Try an older version of jQuery
@@ -55,7 +55,7 @@ Sometimes, bugs are introduced in newer versions of jQuery that do not exist in
### Reduce, reduce, reduce!
When you are experiencing a problem, the most useful thing you can possibly do is to [reduce your code](http://webkit.org/quality/reduction.html) to the bare minimum required to reproduce the issue. This makes it *much* easier to isolate and fix the offending code. Bugs that are reported without reduced test cases take on average 9001% longer to fix than bugs that are submitted with them, so you really should try to do this if at all possible.
When you are experiencing a problem, the most useful thing you can possibly do is to [reduce your code](https://webkit.org/test-case-reduction/) to the bare minimum required to reproduce the issue. This makes it *much* easier to isolate and fix the offending code. Bugs that are reported without reduced test cases take on average 9001% longer to fix than bugs that are submitted with them, so you really should try to do this if at all possible.
## jQuery Core Style Guide
@@ -64,7 +64,7 @@ See: [jQuery Core Style Guide](http://docs.jquery.com/JQuery_Core_Style_Guidelin
## Tips For Bug Patching
### Environment: localhost
### Environment: localhost
To test the plugin you will need:
@@ -84,28 +84,28 @@ Change directory to your web root directory, whatever that might be:
$ cd /path/to/your/www/root/
```
Clone your plugin fork to work locally
Clone your plugin fork to work locally:
```bash
$ git clone git@github.com:username/jquery-migrate.git
```
Change directory to the newly created dir jquery-migrate/
Change directory to the newly created dir `jquery-migrate/`:
```bash
$ cd jquery-migrate
```
Add the jquery-migrate master as a remote. I label mine "upstream"
Add the jquery-migrate repository as a remote; I label mine "upstream":
```bash
$ git remote add upstream git://github.com/jquery/jquery-migrate.git
```
Get in the habit of pulling in the "upstream" master to stay up to date as jQuery receives new commits
Get in the habit of pulling in the "upstream" `main` branch to stay up to date as jQuery Migrate receives new commits:
```bash
$ git pull upstream master
$ git pull upstream main
```
Run the Grunt tools:
@@ -121,14 +121,14 @@ Success! You just built and tested jQuery!
### Fix a bug from a ticket filed at bugs.jquery.com:
**NEVER write your patches to the master branch**
**NEVER write your patches to the `main` branch**
**ALWAYS USE A "TOPIC" BRANCH!** Like so (#### = the ticket #)...
Make sure you start with your up-to-date master:
Make sure you start with your up-to-date `main` branch:
```bash
$ git checkout master
$ git checkout main
```
Create and checkout a new branch that includes the ticket #
@@ -179,16 +179,16 @@ Then, push your branch with the bug fix commits to your github fork
$ git push origin -u bug_####
```
Before you tackle your next bug patch, return to the master:
Before you tackle your next bug patch, return to the `main` branch:
```bash
$ git checkout master
$ git checkout main
```
### Test Suite Tips...
By default the plugin runs against the current (jquery-git WIP) version of jQuery. You can select a different version by specifying it in the URL. Files are always retrieved from code.jquery.com.
By default the plugin runs against the current (jquery-3.x-git WIP) version of jQuery. You can select a different version by specifying it in the URL. Files are always retrieved from code.jquery.com or releases.jquery.com (the latter for development versions).
Example:

View File

@@ -1,40 +1,100 @@
/*global module:false*/
"use strict";
/* global module:false */
module.exports = function( grunt ) {
"use strict";
const gzip = require( "gzip-js" );
var isTravis = process.env.TRAVIS;
const oldNode = /^v10\./.test( process.version );
const karmaQunitConfig = {
showUI: true,
testTimeout: 5000,
// We're running `QUnit.start()` ourselves in
// test/data/qunit-start.js
autostart: false
};
const karmaFilesExceptJQueryAndMigrate = [
// In esmodules mode only object entries of this array with `type: "js"`
// get the `type: "module"` tweak. npo is incompatible with being loaded as
// a module so leverage this hack to prevent loading it in this way.
"external/npo/npo.js",
{ pattern: "test/data/compareVersions.js", type: "js", nocache: true },
{ pattern: "test/data/testinit.js", type: "js", nocache: true },
{ pattern: "test/data/test-utils.js", type: "js", nocache: true },
{ pattern: "test/unit/migrate.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/core.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/ajax.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/attributes.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/css.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/data.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/deferred.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/effects.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/event.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/manipulation.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/offset.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/serialize.js", type: "js", nocache: true },
{ pattern: "test/unit/jquery/traversing.js", type: "js", nocache: true },
{ pattern: "test/data/qunit-start.js", type: "js", nocache: true },
{ pattern: "dist/jquery-migrate.js", included: false, served: true, nocache: true },
{ pattern: "test/**/*.@(js|json|css|jpg|html|xml)", included: false, served: true }
];
// Support: Node.js <12
// Skip running tasks that dropped support for Node.js 10
// in this Node version.
function runIfNewNode( task ) {
return oldNode ? "print_old_node_message:" + task : task;
}
// Project configuration.
grunt.initConfig( {
pkg: grunt.file.readJSON( "package.json" ),
files: [
"src/intro.js",
"src/version.js",
"src/compareVersions.js",
"src/migrate.js",
"src/core.js",
"src/ajax.js",
"src/attributes.js",
"src/css.js",
"src/data.js",
"src/effects.js",
"src/event.js",
"src/offset.js",
"src/serialize.js",
"src/traversing.js",
"src/deferred.js",
"src/outro.js"
],
compare_size: {
files: [ "dist/jquery-migrate.js", "dist/jquery-migrate.min.js" ],
options: {
compress: {
gz: function( contents ) {
return gzip.zip( contents, {} ).length;
}
},
cache: "build/.sizecache.json"
}
},
tests: {
jquery: [
"dev+git",
"min+git.min",
"dev+git.slim",
"min+git.slim.min"
],
"jquery-3": [
"dev+3.x-git",
"min+3.x-git.min",
"dev+3.x-git.slim",
"min+3.x-git.slim.min",
"dev+3.6.3",
"dev+3.6.3.slim",
"dev+3.5.1",
"dev+3.5.1.slim",
"dev+3.4.1",
"dev+3.4.1.slim",
"dev+3.3.1",
"dev+3.3.1.slim",
"dev+3.2.1",
"dev+3.2.1.slim",
"dev+3.1.1",
"dev+3.0.0"
"dev+3.1.1.slim",
"dev+3.0.0",
"dev+3.0.0.slim"
]
},
banners: {
@@ -51,6 +111,12 @@ module.exports = function( grunt ) {
dest: "dist/<%= pkg.name %>.js"
}
},
build: {
all: {
src: "src/migrate.js",
dest: "dist/jquery-migrate.js"
}
},
qunit: {
files: [ "test/**/index.html" ]
},
@@ -73,6 +139,20 @@ module.exports = function( grunt ) {
]
}
},
npmcopy: {
all: {
options: {
destPrefix: "external"
},
files: {
"npo/npo.js": "native-promise-only/lib/npo.src.js",
"qunit/qunit.js": "qunit/qunit/qunit.js",
"qunit/qunit.css": "qunit/qunit/qunit.css",
"qunit/LICENSE.txt": "qunit/LICENSE.txt"
}
}
},
uglify: {
all: {
files: {
@@ -85,17 +165,17 @@ module.exports = function( grunt ) {
sourceMapName: "dist/jquery-migrate.min.map",
report: "min",
output: {
"ascii_only": true,
ascii_only: true,
// Support: Android 4.0 only
// UglifyJS 3 breaks Android 4.0 if this option is not enabled.
// This is in lieu of setting ie8 for all of mangle, compress, and output
"ie8": true
ie8: true
},
banner: "/*! jQuery Migrate v<%= pkg.version %>" +
" | (c) <%= pkg.author.name %> | jquery.org/license */",
compress: {
"hoist_funs": false,
hoist_funs: false,
loops: false,
// Support: IE <11
@@ -116,33 +196,13 @@ module.exports = function( grunt ) {
},
frameworks: [ "qunit" ],
files: [
"https://code.jquery.com/jquery-3.x-git.min.js",
"https://releases.jquery.com/git/jquery-3.x-git.min.js",
"dist/jquery-migrate.min.js",
"src/compareVersions.js",
"test/testinit.js",
"test/migrate.js",
"test/core.js",
"test/ajax.js",
"test/attributes.js",
"test/css.js",
"test/data.js",
"test/deferred.js",
"test/effects.js",
"test/event.js",
"test/offset.js",
"test/serialize.js",
"test/traversing.js",
{ pattern: "dist/jquery-migrate.js", included: false, served: true },
{ pattern: "test/**/*.@(js|css|jpg|html|xml)", included: false, served: true }
...karmaFilesExceptJQueryAndMigrate
],
client: {
clearContext: false,
qunit: {
showUI: true,
testTimeout: 5000
}
qunit: karmaQunitConfig
},
reporters: [ "dots" ],
autoWatch: false,
@@ -151,9 +211,58 @@ module.exports = function( grunt ) {
singleRun: true
},
main: {
browsers: [ "ChromeHeadless", "FirefoxHeadless" ]
},
// The Chrome sandbox doesn't work on Travis.
browsers: [ isTravis ? "ChromeHeadlessNoSandbox" : "ChromeHeadless" ]
"jquery-slim": {
browsers: [ "ChromeHeadless", "FirefoxHeadless" ],
options: {
files: [
"https://releases.jquery.com/git/jquery-3.x-git.slim.min.js",
"dist/jquery-migrate.min.js",
...karmaFilesExceptJQueryAndMigrate
]
}
},
esmodules: {
browsers: [ "ChromeHeadless", "FirefoxHeadless" ],
options: {
files: [
"https://releases.jquery.com/git/jquery-3.x-git.slim.min.js",
{ pattern: "src/migrate.js", type: "module" },
// Silence console warnings to avoid flooding the console.
{ pattern: "src/migratemute.js", type: "module" },
// Only object entries with `type: "js"` get
// the `type: "module"` tweak.
...karmaFilesExceptJQueryAndMigrate.map( file => {
if ( file && typeof file === "object" && file.type === "js" ) {
return {
...file,
type: "module"
};
} else {
return file;
}
} ),
{
pattern: "src/**",
included: false,
type: "module",
served: true
}
],
client: {
qunit: {
...karmaQunitConfig,
plugin: "esmodules"
}
}
}
},
// To debug tests with Karma:
@@ -183,8 +292,17 @@ module.exports = function( grunt ) {
// Integrate jQuery migrate specific tasks
grunt.loadTasks( "build/tasks" );
grunt.registerTask( "print_old_node_message", ( ...args ) => {
var task = args.join( ":" );
grunt.log.writeln( "Old Node.js detected, running the task \"" + task + "\" skipped..." );
} );
// Just an alias
grunt.registerTask( "test", [ "karma:main" ] );
grunt.registerTask( "test", [
"karma:main",
"karma:jquery-slim",
"karma:esmodules"
] );
grunt.registerTask( "lint", [
@@ -192,13 +310,23 @@ module.exports = function( grunt ) {
// would run the dist target first which would point to errors in the built
// file, making it harder to fix them. We want to check the built file only
// if we already know the source files pass the linter.
"eslint:dev",
"eslint:dist"
runIfNewNode( "eslint:dev" ),
runIfNewNode( "eslint:dist" )
] );
grunt.registerTask( "build", [ "concat", "uglify", "lint" ] );
grunt.registerTask( "default", [ "build", "test" ] );
grunt.registerTask( "default-no-test", [
"npmcopy",
"build",
"uglify",
"lint",
"compare_size"
] );
grunt.registerTask( "default", [
"default-no-test",
"test"
] );
// For CI
grunt.registerTask( "ci", [ "build", "test" ] );
grunt.registerTask( "ci", [ "default" ] );
};

View File

@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/jquery/jquery-migrate.svg?branch=master)](https://travis-ci.org/jquery/jquery-migrate)
![CI Status](https://github.com/jquery/jquery-migrate/actions/workflows/node.js.yml/badge.svg?branch=main)
#### NOTE: To upgrade to jQuery 3.0, you first need version 1.12.x or 2.2.x. If you're using an older version, first upgrade to one of these versions using [jQuery Migrate 1.x](https://github.com/jquery/jquery-migrate/tree/1.x-stable#readme), to resolve any compatibility issues. For more information about the changes made in jQuery 3.0, see the [upgrade guide](https://jquery.com/upgrade-guide/3.0/) and [blog post](https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/).
@@ -7,13 +7,26 @@ Upgrading libraries such as jQuery can be a lot of work, when breaking changes h
That way you can spot and fix what otherwise would have been errors, until you no longer need jQuery Migrate and can remove it.
## Version compatibility
The following table indicates which jQuery Migrate versions can be used with which jQuery versions:
| jQuery version | jQuery Migrate version |
|----------------|-------------------------|
| 1.x | 1.x |
| 2.x | 1.x |
| 3.x | 3.x / 4.x<sup>[1]</sup> |
| 4.x | 3.x / 4.x<sup>[1]</sup> |
[1] NOTE: jQuery Migrate 4.x only supports the same browser as jQuery 4.x does. If you need to support Edge Legacy, Internet Explorer 9-10 or iOS 7+ (and not just 3 latest versions), use jQuery Migrate 3.x.
## Usage
In your web page, load this plugin *after* the script tag for jQuery, for example:
```html
<script src="https://code.jquery.com/jquery-3.0.0.js"></script>
<script src="https://code.jquery.com/jquery-migrate-3.1.0.js"></script>
<script src="https://code.jquery.com/jquery-3.6.3.js"></script>
<script src="https://code.jquery.com/jquery-migrate-3.4.1.js"></script>
```
## Download
@@ -26,8 +39,8 @@ The production build is minified and does not generate console warnings. It will
|--|-------------|------------|
| Debugging enabled | <p align="center">✓</p> | |
| Minified | | <p align="center">✓</p> |
| Latest release (*may be hotlinked if desired*) | [jquery-migrate-3.1.0.js](https://code.jquery.com/jquery-migrate-3.1.0.js) | [jquery-migrate-3.1.0.min.js](https://code.jquery.com/jquery-migrate-3.1.0.min.js) |
| \* Latest work-in-progress build | [jquery-migrate-git.js](https://code.jquery.com/jquery-migrate-git.js) | [jquery-migrate-git.min.js](https://code.jquery.com/jquery-migrate-git.min.js) |
| Latest release (*may be hotlinked if desired*) | [jquery-migrate-3.4.1.js](https://code.jquery.com/jquery-migrate-3.4.1.js) | [jquery-migrate-3.4.1.min.js](https://code.jquery.com/jquery-migrate-3.4.1.min.js) |
| \* Latest work-in-progress build | [jquery-migrate-git.js](https://releases.jquery.com/git/jquery-migrate-git.js) | [jquery-migrate-git.min.js](https://releases.jquery.com/git/jquery-migrate-git.min.js) |
\* **Work-in-progress build:** Although this file represents the most recent updates to the plugin, it may not have been thoroughly tested. We do not recommend using this file on production sites since it may be unstable; use the released production version instead.
@@ -37,7 +50,7 @@ The production build is minified and does not generate console warnings. It will
The development version of the plugin displays warnings in the browser console. Older browsers such as IE9 doesn't support the console interface. No messages will be generated unless you include a debugging library such as [Firebug Lite](https://getfirebug.com/firebuglite) before including the jQuery Migrate plugin. Developers can also inspect the `jQuery.migrateWarnings` array to see what error messages have been generated.
All warnings generated by this plugin start with the string "JQMIGRATE". A list of the warnings you may see are in [warnings.md](https://github.com/jquery/jquery-migrate/blob/master/warnings.md).
All warnings generated by this plugin start with the string "JQMIGRATE". A list of the warnings you may see are in [warnings.md](https://github.com/jquery/jquery-migrate/blob/main/warnings.md).
## Migrate Plugin API
@@ -54,6 +67,16 @@ This plugin adds some properties to the `jQuery` object that can be used to prog
`jQuery.migrateVersion`: This string property indicates the version of Migrate in use.
`jQuery.migrateDeduplicateWarnings`: By default, Migrate only gives a specific warning once. If you set this property to `false` it will give a warning for every occurrence each time it happens. Note that this can generate a lot of output, for example when a warning occurs in a loop.
`jQuery.migrateDisablePatches`: Disables patches by their codes. You can find a code for each patch in square brackets in [warnings.md](https://github.com/jquery/jquery-migrate/blob/main/warnings.md). A limited number of warnings doesn't have codes defined and cannot be disabled. These are mostly setup issues like using an incorrect version of jQuery or loading Migrate multiple times.
`jQuery.migrateDisablePatches`: Disables patches by their codes.
`jQuery.migrateIsPatchEnabled`: Returns `true` if a patch of a provided code is enabled and `false` otherwise.
`jQuery.UNSAFE_restoreLegacyHtmlPrefilter`: A deprecated alias of `jQuery.migrateEnablePatches( "self-closed-tags" )`
## Reporting problems
Bugs that only occur when the jQuery Migrate plugin is used should be reported in the [jQuery Migrate Issue Tracker](https://github.com/jquery/jquery-migrate/issues) and should be accompanied by an executable test case that demonstrates the bug. The easiest way to do this is via an online test tool such as [jsFiddle.net](https://jsFiddle.net/) or [jsbin.com](https://jsbin.com). Use the development version when you are reporting bugs.

1
node_modules/jquery-migrate/build/.sizecache.json generated vendored Normal file
View File

@@ -0,0 +1 @@
{"":{"version":0.4,"tips":{"1.x-stable":"4bd0c1fadc7b87a64d0cd09d906803e244382fda","main":"384b9ab72abdd211a33ef36e62725a66f90bb2c1"}}," last run":{"dist/jquery-migrate.js":{"":31978,"gz":10085},"dist/jquery-migrate.min.js":{"":13620,"gz":4903}},"1.x-stable":{"dist/jquery-migrate.js":{"":23888,"gz":7985},"dist/jquery-migrate.min.js":{"":10254,"gz":4079}},"main":{"dist/jquery-migrate.js":{"":31978,"gz":10085},"dist/jquery-migrate.min.js":{"":13620,"gz":4903}}}

View File

@@ -1,7 +0,0 @@
#
scp ../dist/jquery-migrate.js jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/jquery-migrate-git.js
curl http://code.origin.jquery.com/jquery-migrate-git.js?reload
scp ../dist/jquery-migrate.min.js jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/jquery-migrate-git.min.js
curl http://code.origin.jquery.com/jquery-migrate-git.min.js?reload

View File

@@ -3,22 +3,27 @@
* JQuery Migrate Plugin Release Management
*/
"use strict";
// Debugging variables
var dryrun = false,
skipRemote = false;
var fs = require( "fs" ),
child = require( "child_process" ),
path = require( "path" ),
chalk = require( "chalk" );
import fs from "fs";
import child from "child_process";
import path from "path";
import chalk from "chalk";
import enquirer from "enquirer";
var releaseVersion,
nextVersion,
isBeta,
pkg,
prompt = enquirer.prompt,
repoURL = "git@github.com:jquery/jquery-migrate.git",
branch = "master",
branch = "main",
// Windows needs the .cmd version but will find the non-.cmd
// On Windows, also ensure the HOME environment variable is set
@@ -187,19 +192,33 @@ function makeReleaseCopies( next ) {
next();
}
function publishToNPM( next ) {
async function publishToNPM( next ) {
const { input: otp } = await prompt( {
type: "input",
name: "input",
message: "Enter one-time password if you have 2FA enabled and press Enter.\n" +
"Otherwise, just press Enter."
} );
// Don't update "latest" if this is a beta
if ( isBeta ) {
exec( npmCmd, [ "publish", "--tag", "beta" ], next, skipRemote );
exec( npmCmd, [
"publish",
"--tag",
"beta",
...( otp ? [ "--otp", otp ] : [] )
], next, skipRemote );
} else {
exec( npmCmd, [ "publish" ], next, skipRemote );
exec( npmCmd, [
"publish",
...( otp ? [ "--otp", otp ] : [] )
], next, skipRemote );
}
}
function setNextVersion( next ) {
updateSourceVersion( nextVersion );
updatePackageVersion( nextVersion, "master" );
updatePackageVersion( nextVersion, "main" );
git( [ "commit", "-a", "--no-verify", "-m", "Updating the source version to " + nextVersion ],
next );
}
@@ -269,7 +288,7 @@ function updateReadmeVersion() {
}
function setBlobVersion( s, v ) {
return s.replace( /\/blob\/(?:(\d+\.\d+[^\/]+)|master)/, "/blob/" + v );
return s.replace( /\/blob\/(?:(\d+\.\d+[^\/]+)|main)/, "/blob/" + v );
}
function writeJsonSync( fname, json ) {

72
node_modules/jquery-migrate/build/tasks/build.js generated vendored Normal file
View File

@@ -0,0 +1,72 @@
/**
* A build task that compiles jQuery Migrate JS modules into one bundle.
*/
"use strict";
module.exports = function( grunt ) {
const path = require( "path" );
const rollup = require( "rollup" );
const rootFolder = path.resolve( `${ __dirname }/../..` );
const srcFolder = path.resolve( `${ rootFolder }/src` );
const read = function( fileName ) {
return grunt.file.read( `${ srcFolder }/${ fileName }` );
};
// Catch `// @CODE` and subsequent comment lines event if they don't start
// in the first column.
const wrapper = read( "wrapper.js" )
.split( /[\x20\t]*\/\/ @CODE\n(?:[\x20\t]*\/\/[^\n]+\n)*/ );
const inputRollupOptions = {};
const outputRollupOptions = {
// The ESM format is not actually used as we strip it during
// the build; it's just that it doesn't generate any extra
// wrappers so there's nothing for us to remove.
format: "esm",
intro: wrapper[ 0 ]
.replace( /\n*$/, "" ),
outro: wrapper[ 1 ]
.replace( /^\n*/, "" )
};
grunt.registerMultiTask(
"build",
"Build jQuery Migrate ECMAScript modules, embed date/version",
async function() {
const done = this.async();
try {
const version = grunt.config( "pkg.version" );
const dest = this.files[ 0 ].dest;
const src = this.files[ 0 ].src[ 0 ];
inputRollupOptions.input = path.resolve( `${ rootFolder }/${ src }` );
const bundle = await rollup.rollup( inputRollupOptions );
const { output: [ { code } ] } = await bundle.generate( outputRollupOptions );
const compiledContents = code
// Embed Version
.replace( /@VERSION/g, version )
// Embed Date
// yyyy-mm-ddThh:mmZ
.replace(
/@DATE/g,
( new Date() ).toISOString()
.replace( /:\d+\.\d+Z$/, "Z" )
);
grunt.file.write( `${ rootFolder }/${ dest }`, compiledContents );
grunt.log.ok( `File '${ dest }' created.` );
done();
} catch ( err ) {
done( err );
}
} );
};

View File

@@ -19,7 +19,9 @@ module.exports = function( grunt ) {
browserSets = JSON.parse( browserSets );
}
timeout = timeout || 1000 * 60 * 15;
tests = grunt.config( "tests" ).jquery;
tests = grunt.config( "tests" )[
Array.isArray( browserSets ) ? browserSets[ 0 ] : browserSets ||
"jquery" ];
if ( pull ) {
jobName = "Pull <a href='https://github.com/jquery/jquery-migrate/pull/" +
@@ -35,7 +37,6 @@ module.exports = function( grunt ) {
pluginjQuery[ 0 ] + "&jquery=" + pluginjQuery[ 1 ];
} );
// TODO: create separate job for git so we can do different browsersets
testswarm.createClient( {
url: config.swarmUrl
} )

View File

@@ -1,8 +1,23 @@
{
"extends": "../src/.eslintrc.json",
"root": true,
"extends": "../src/.eslintrc.json",
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
},
"globals": {
"define": false,
"module": true,
"Proxy": false,
"Reflect": false
},
"rules": {
// That is okay for the built version
"no-multiple-empty-lines": "off"
"no-multiple-empty-lines": "off",
"one-var": "off"
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@
"title": "jQuery Migrate",
"description": "Migrate older jQuery code to jQuery 3.0+",
"main": "dist/jquery-migrate.js",
"version": "3.1.0",
"version": "3.4.1",
"homepage": "https://github.com/jquery/jquery-migrate",
"author": {
"name": "OpenJS Foundation and other contributors",
@@ -18,7 +18,7 @@
},
"license": "MIT",
"scripts": {
"build": "grunt build",
"build": "grunt default-no-test",
"test": "grunt test",
"ci": "grunt ci"
},
@@ -26,25 +26,31 @@
"jquery": ">=3 <4"
},
"devDependencies": {
"chalk": "2.4.2",
"chalk": "5.0.1",
"commitplease": "3.2.0",
"eslint-config-jquery": "2.0.0",
"grunt": "1.0.4",
"grunt-cli": "1.3.2",
"grunt-contrib-concat": "1.0.1",
"enquirer": "2.3.6",
"eslint": "8.11.0",
"eslint-config-jquery": "3.0.0",
"eslint-plugin-import": "2.25.4",
"grunt": "1.5.3",
"grunt-cli": "1.4.3",
"grunt-compare-size": "0.4.2",
"grunt-contrib-uglify": "4.0.1",
"grunt-contrib-watch": "1.1.0",
"grunt-eslint": "21.0.0",
"grunt-karma": "3.0.2",
"karma": "4.1.0",
"karma-browserstack-launcher": "1.5.1",
"karma-chrome-launcher": "2.2.0",
"karma-firefox-launcher": "1.1.0",
"karma-qunit": "3.1.2",
"jquery": "3.4.1",
"load-grunt-tasks": "5.0.0",
"qunit": "2.4.1",
"testswarm": "1.1.0"
"grunt-eslint": "24.0.0",
"grunt-karma": "4.0.2",
"grunt-npmcopy": "0.2.0",
"gzip-js": "0.3.2",
"karma": "6.3.17",
"karma-browserstack-launcher": "1.6.0",
"karma-chrome-launcher": "3.1.1",
"karma-firefox-launcher": "2.1.2",
"karma-qunit": "4.1.2",
"load-grunt-tasks": "5.1.0",
"native-promise-only": "0.8.1",
"qunit": "2.19.1",
"rollup": "2.70.1",
"testswarm": "1.1.2"
},
"keywords": [
"jquery",

View File

@@ -27,111 +27,116 @@ This is _not_ a warning, but a console log message the plugin shows when it firs
**Solution:** Remove all but the latest version of the jQuery Migrate plugin. See the [README](https://github.com/jquery/jquery-migrate/#readme) for more information on usage and upgrading from older versions.
### JQMIGRATE: Attribute selector with '#' must be quoted
### JQMIGRATE: Attribute selector with '#' was not fixed
### \[selector-empty-id\] JQMIGRATE: jQuery( '#' ) is not a valid selector
**Cause:** Selectors consisting of just `#` are not valid CSS syntax so `jQuery( '#' )` is an invalid call but it used to return an empty jQuery object before jQuery 3.0. In later versions this selector throws an error.
**Solution**: Don't call `jQuery` with just `"#"`. If you construct your ID selector dynamically, make sure the string appended to `"#"` is not empty.
### \[selector-hash\] JQMIGRATE: Attribute selector with '#' must be quoted
### \[selector-hash\] JQMIGRATE: Attribute selector with '#' was not fixed
**Cause:** Selectors such as `a[href=#main]` are not valid CSS syntax because the value contains special characters that are not quoted. Until jQuery 1.11.3/2.1.4 this was accepted, but the behavior is non-standard and was never documented. In later versions this selector throws an error. *In some cases with complex selectors, Migrate may not attempt a repair.* In those cases a fatal error will be logged on the console and you will need to fix the selector manually.
**Solution**: Put quotes around any attribute values that have special characters, e.g. `a[href="#main"]`. The warning message contains the selector that caused the problem, use that to find the selector in the source files.
### JQMIGRATE: jQuery is not compatible with Quirks Mode
### \[quirks\] JQMIGRATE: jQuery is not compatible with Quirks Mode
**Cause:** A browser runs in "quirks mode" when the HTML document does not have a `<!doctype ...>` as its first non-blank line, or when the doctype in the file is invalid. This mode causes the browser to emulate 1990s-era (HTML3) behavior. In Internet Explorer, it also causes many high-performance APIs to be hidden in order to better emulate ancient browsers. jQuery has never been compatible with, or tested in, quirks mode.
**Solution:** Put a [valid doctype](http://www.w3.org/QA/2002/04/valid-dtd-list.html) in the document and ensure that the document is rendering in standards mode. The simplest valid doctype is the HTML5 one, which we highly recommend: `<!doctype html>` . The jQuery Migrate plugin does not attempt to fix issues related to quirks mode.
### JQMIGRATE: jQXHR.success is deprecated and removed
### JQMIGRATE: jQXHR.error is deprecated and removed
### JQMIGRATE: jQXHR.complete is deprecated and removed
### \[jqXHR-methods\] JQMIGRATE: jQXHR.success is deprecated and removed
### \[jqXHR-methods\] JQMIGRATE: jQXHR.error is deprecated and removed
### \[jqXHR-methods\] JQMIGRATE: jQXHR.complete is deprecated and removed
**Cause:** The `.success()`, `.error()`, and `.complete()` methods of the `jQXHR` object returned from `jQuery.ajax()` have been deprecated since jQuery 1.8 and were removed in jQuery 3.0.
**Solution:** Replace the use of these methods with the standard Deferred methods: `.success()` becomes `.done()`, `.error()` becomes `.fail()`, and `.complete()` becomes `.always()`.
### JQMIGRATE: jQuery.fn.error() is deprecated
### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.error() is deprecated
**Cause:** The `$().error()` method was used to attach an "error" event to an element but has been removed in 1.9 to reduce confusion with the `$.error()` method which is unrelated and has not been deprecated. It also serves to discourage the temptation to use `$(window).error()` which does not work because `window.onerror` does not follow standard event handler conventions. The `$().error()` method was removed in jQuery 3.0.
**Solution:** Change any use of `$().error(fn)` to `$().on("error", fn)`.
### JQMIGRATE: jQuery.fn.load() is deprecated
### JQMIGRATE: jQuery.fn.unload() is deprecated
### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.load() is deprecated
### \[shorthand-removed-v3\] JQMIGRATE: jQuery.fn.unload() is deprecated
**Cause:** The `.load()` and `.unload()` event methods attach a "load" and "unload" event, respectively, to an element. They were deprecated in 1.9 and removed in 3.0 to reduce confusion with the AJAX-related `.load()` method that loads HTML fragments and which has not been deprecated. Note that these two methods are used almost exclusively with a jQuery collection consisting of only the `window` element. Also note that attaching an "unload" or "beforeunload" event on a window via any means can impact performance on some browsers because it disables the document cache (bfcache). For that reason we strongly advise against it.
**Solution:** Change any use of `$().load(fn)` to `$().on("load", fn)` and `$().unload(fn)` to `$().on("unload", fn)`.
### JQMIGRATE: deferred.pipe() is deprecated
### \[deferred-pipe\] JQMIGRATE: deferred.pipe() is deprecated
**Cause**: The `.pipe()` method on a `jQuery.Deferred` object was deprecated as of jQuery 1.8, when the `.then()` method was changed to perform the same function.
**Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0.
### JQMIGRATE: jQuery.fx.interval is deprecated
### \[fx-interval\] JQMIGRATE: jQuery.fx.interval is deprecated
**Cause**: As of jQuery 3.0 the `jQuery.fx.interval` property can be used to change the animation interval _only_ on browsers that do not support the `window.requestAnimationFrame()` method. That is currently only Internet Explorer 9 and the Android Browser. Once support is dropped for these browsers, the property will serve no purpose and it will be removed.
**Solution**: Find and remove code that changes or uses `jQuery.fx.interval`. If the value is being used by code in your page or a plugin, the code may be making assumptions that are no longer valid. The default value of `jQuery.fx.interval` is `13` (milliseconds), which could be used instead of accessing this property.
### JQMIGRATE: jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()
### \[andSelf\] JQMIGRATE: jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()
**Cause**: The `.andSelf()` method has been renamed to `.addBack()` as of jQuery 1.9 to better reflect its purpose of adding back the previous set of results. The old alias was removed in jQuery 3.0.
**Solution**: Replace any use of `.andSelf()` with `.addBack()`.
### JQMIGRATE: jQuery.fn.size() is deprecated and removed; use the .length property
### \[size\] JQMIGRATE: jQuery.fn.size() is deprecated and removed; use the .length property
**Cause**: The `.size()` method returns the number of elements in the current jQuery object, but duplicates the more-efficient `.length` property which provides the same functionality. As of jQuery 1.9 the `.length` property is the preferred way to retrieve this value. jQuery 3.0 no longer contains the `.size()` method.
**Solution**: Replace any use of `.size()` with `.length`.
### JQMIGRATE: jQuery.data() always sets/gets camelCased names
### \[data-camelCase\] JQMIGRATE: jQuery.data() always sets/gets camelCased names
**Cause:** The page is attempting to set or get a jQuery data item using kebab case, e.g. `my-data`, when a `my-data` item has been set directly on the jQuery data object. jQuery 3.0 always exclusively uses camel case, e.g., `myData`, when it accesses data items via the `.data()` API and does not find kebab case data in that object.
**Cause:** The page is attempting to set or get a jQuery data item using kebab case, e.g. `my-data`, when a `my-data` item has been set directly on the jQuery data object. jQuery 3.0 always exclusively uses camel case, e.g., `myData`, when it accesses data items via the `.data()` API and does not find kebab case data in that object.
**Solution:** Either 1) Always use the `.data()` API to set or get data items, 2) Always use camelCase names when also setting properties directly on jQuery's data object, or 3) Always set properties directly on the data object without using the API call to set or get data by name. Never mix direct access to the data object and API calls with kebab case names.
### JQMIGRATE: jQuery.fn.removeAttr no longer sets boolean properties
### \[removeAttr-bool\] JQMIGRATE: jQuery.fn.removeAttr no longer sets boolean properties
**Cause**: Prior to jQuery 3.0, using `.removeAttr()` on a boolean attribute such as `checked`, `selected`, or `readonly` would also set the corresponding named *property* to `false`. This behavior was required for ancient versions of Internet Explorer but is not correct for modern browsers because the attribute represents the initial value and the property represents the current (dynamic) value.
**Solution**: It is almost always a mistake to use `.removeAttr( "checked" )` on a DOM element. The only time it might be useful is if the DOM is later going to be serialized back to an HTML string. In all other cases, `.prop( "checked", false )` should be used instead.
### JQMIGRATE: jQuery.fn.offset() requires a valid DOM element
### JQMIGRATE: jQuery.fn.offset() requires an element connected to a document
### \[offset-valid-elem\] JQMIGRATE: jQuery.fn.offset() requires a valid DOM element
**Cause:** In earlier versions of jQuery, the `.offset()` method would return a value of `{ top: 0, left: 0 }` for some cases of invalid input. jQuery 3.0 throws errors in some of these cases. The selected element in the jQuery collection must be a DOM element that is currently in a document. Text nodes, the `window` object, plain JavaScript objects, and disconnected elements are not valid input to the `.offset()` method. jQuery *may* throw an error in those cases but in general does not guarantee specific results with invalid inputs.
**Cause:** In earlier versions of jQuery, the `.offset()` method would return a value of `{ top: 0, left: 0 }` for some cases of invalid input. jQuery 3.0 throws errors in some of these cases. The selected element in the jQuery collection must be a DOM element that has a `getBoundingClientRect` method. Text nodes, the `window` object, and plain JavaScript objects are not valid input to the `.offset()` method. jQuery *may* throw an error in those cases but in general does not guarantee specific results with invalid inputs.
**Solution**: Do not attempt to get or set the offset information of invalid input.
### JQMIGRATE: jQuery.param() no longer uses jQuery.ajaxSettings.traditional
### \[param-ajax-traditional\] JQMIGRATE: jQuery.param() no longer uses jQuery.ajaxSettings.traditional
**Cause:** As of jQuery 3.0, the serialization method `jQuery.param` is fully independent of jQuery's ajax module. As a result, it does not look at the `jQuery.ajaxSettings.traditional` flag that affects how form data is encoded. Note that the `jQuery.ajax()` method still honors this flag if you make a request through it.
**Solution:** To continue using the `traditional` flag, pass it explicitly: `jQuery.data( myData, jQuery.ajaxSettings.traditional )`.
**Solution:** To continue using the `traditional` flag, pass it explicitly: `jQuery.param( myData, jQuery.ajaxSettings.traditional )`.
### JQMIGRATE: jQuery.swap() is undocumented and deprecated
### \[swap\] JQMIGRATE: jQuery.swap() is undocumented and deprecated
**Cause**: The `jQuery.swap()` method temporarily exchanges a set of CSS properties. It was never documented as part of jQuery's public API and should not be used because it can cause performance problems due to forced layout. This method has been removed in jQuery 3.0.
**Solution**: Rework the code to avoid calling `jQuery.swap()`, or explicitly set and restore the properties you need to change.
### JQMIGRATE: jQuery.fn.bind() is deprecated
### JQMIGRATE: jQuery.fn.unbind() is deprecated
### JQMIGRATE: jQuery.fn.delegate() is deprecated
### JQMIGRATE: jQuery.fn.undelegate() is deprecated
### \[pre-on-methods\] JQMIGRATE: jQuery.fn.bind() is deprecated
### \[pre-on-methods\] JQMIGRATE: jQuery.fn.unbind() is deprecated
### \[pre-on-methods\] JQMIGRATE: jQuery.fn.delegate() is deprecated
### \[pre-on-methods\] JQMIGRATE: jQuery.fn.undelegate() is deprecated
**Cause:**: These event binding methods have been deprecated in favor of the `.on()` and `.off()` methods which can handle both delegated and direct event binding. Although the older methods are still present in jQuery 3.0, they may be removed as early as the next major-version update.
**Solution**: Change the method call to use `.on()` or `.off()`, the documentation for the old methods include specific instructions. In general, the `.bind()` and `.unbind()` methods can be renamed directly to `.on()` and `.off()` respectively since the argument orders are identical.
### JQMIGRATE: 'ready' event is deprecated
### \[ready-event\] JQMIGRATE: 'ready' event is deprecated
**Cause**: Using one of jQuery's API methods to bind a "ready" event, e.g. `$( document ).on( "ready", fn )`, will cause the function to be called when the document is ready, but only if it is attached before the browser fires its own `DOMContentLoaded` event. That makes it unreliable for many uses, particularly ones where jQuery or its plugins are loaded asynchronously after page load.
**Solution**: Replace any use of `$( document ).on( "ready", fn )` with `$( fn )`. This approach works reliably even when the document is already loaded.
### JQMIGRATE: 'jQuery.easing.NAME' should use only one argument
### \[easing-one-arg\] JQMIGRATE: 'jQuery.easing.NAME' should use only one argument
**Cause**: Additional arguments for `jQuery.easing` methods were never documented and are redundant since the same behavior can be easily achieved without them. When Migrate detects this case, the specified easing function is not used and `"linear"` easing is used instead for the animation.
@@ -155,77 +160,125 @@ jQuery.easing.easeInCubic = function ( p ) {
See jQuery-ui [commit](https://github.com/jquery/jquery-ui/commit/c0093b599fcd58b6ad122ab425c4cc1a4da4a520#diff-9cd789a170c765edcf0f4854db386e1a) for other possible cases.
### JQMIGRATE: jQuery.parseJSON is deprecated; use JSON.parse
### \[parseJSON\] JQMIGRATE: jQuery.parseJSON is deprecated; use JSON.parse
**Cause**: The `jQuery.parseJSON` method in recent jQuery is identical to the native `JSON.parse`. As of jQuery 3.0 `jQuery.parseJSON` is deprecated.
**Solution**: Replace any use of `jQuery.parseJSON` with `JSON.parse`.
### JQMIGRATE: jQuery.isNumeric() should not be called on constructed objects
### \[isNumeric\] JQMIGRATE: jQuery.isNumeric() is deprecated
**Cause**: The intended use case of `jQuery.isNumeric` is to see if its argument is either already a number, or a string that can be converted to a number. In jQuery 3.0 some edge cases changed to not return the same values. In particular, a constructed object (one created with `new MyObject()`) that contains a `.toString()` method is never considered to be numeric, even if that method returns a string that could be converted to a number. Please do not taunt this method.
**Cause**: This method was used by jQuery to determine if certain string arguments could be converted to numbers, but the name led people to apply their own interpretations to what the method means. As a result, it often doesn't meet the needs of specific cases. For example, a 25-character string of only digits is technically a valid number, but JavaScript cannot represent it accurately. The string `"0x251D"` is a valid hexadecimal number but may not be acceptable numeric input to a web form.
**Solution**: Either use a different test for being numeric, or call the object's `.toString()` method before calling the jQuery method: `jQuery.isNumeric( myObject.toString() )`.
**Solution**: Use a test for being numeric that makes sense for the specific situation. For example, instead of `jQuery.isNumeric(string)`, use `isNan(parseFloat(string))` if a floating point number is expected, or `string.test(/^[0-9]{1,8}$/)` if a sequence of 1 to 8 digits is expected.
### JQMIGRATE: jQuery.unique is deprecated; use jQuery.uniqueSort
### \[type\] JQMIGRATE: jQuery.type() is deprecated
**Cause**: This method returns a string that indicates the type of the argument, for example `"number"` or `"function"`. However, as the JavaScript language evolves this method has become problematic because new language constructs might require this function to either return a new string (potentially breaking existing code) or somehow map new constructs into existing strings (again, potentially breaking existing code). Examples of new recent JavaScript features include asynchronous functions, class constructors, `Symbol`s, or functions that act as iterators.
**Solution**: Review code that uses `jQuery.type()` and use a type check that is appropriate for the situation. For example. if the code expects a plain function, check for `typeof arg === "function"`.
### \[unique\] JQMIGRATE: jQuery.unique is deprecated; use jQuery.uniqueSort
**Cause**: The fact that `jQuery.unique` sorted its results in DOM order was surprising to many who did not read the documentation carefully. As of jQuery 3.0 this function is being renamed to make it clear.
**Solution**: Replace all uses of `jQuery.unique` with `jQuery.uniqueSort` which is the same function with a better name.
### JQMIGRATE: jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos
### JQMIGRATE: jQuery.expr.filters is deprecated; use jQuery.expr.pseudos
### \[expr-pre-pseudos\] JQMIGRATE: jQuery.expr\[':'\] is deprecated; use jQuery.expr.pseudos
### \[expr-pre-pseudos\] JQMIGRATE: jQuery.expr.filters is deprecated; use jQuery.expr.pseudos
**Cause:** The standard way to add new custom selectors through jQuery is `jQuery.expr.pseudos`. These two other aliases are deprecated, although they still work as of jQuery 3.0.
**Solution:** Rename any of the older usage to `jQuery.expr.pseudos`. The functionality is identical.
### JQMIGRATE: jQuery.fn.toggleClass( [ boolean ] ) is deprecated
### \[toggleClass-bool\] JQMIGRATE: jQuery.fn.toggleClass( \[ boolean \] ) is deprecated
**Cause:** Calling `.toggleClass()` with no arguments, or with a single Boolean `true` or `false` argument, has been deprecated. Its behavior was poorly documented, but essentially the method saved away the current `class` value in a data item when the class was removed and restored the saved value when it was toggled back. If you do not believe you are specificially trying to use this form of the method, it is possible you are accidentally doing so via an inadvertent undefined value, as `.toggleClass( undefined )` toggles all classes.
**Solution:** If this functionality is still needed, save the current full `.attr( "class" )` value in a data item and restore it when required.
### JQMIGRATE: jQuery.event.props are deprecated and removed
### JQMIGRATE: jQuery.event.props.concat() is deprecated and removed
### JQMIGRATE: jQuery.event.fixHooks are deprecated and removed
### \[event-old-patch\] JQMIGRATE: jQuery.event.props are deprecated and removed
### \[event-old-patch\] JQMIGRATE: jQuery.event.props.concat() is deprecated and removed
### \[event-old-patch\] JQMIGRATE: jQuery.event.fixHooks are deprecated and removed
**Cause:** The code on the page has used the `jQuery.event.props` or `jQuery.event.fixHooks` data structures. These were used in previous versions to affect the properties that are copied from the native event to the jQuery event each time an event is delivered, but they had the potential to create performance issues. Versions of jQuery Mobile before 1.5 make use of this API and require jQuery Migrate to run properly.
**Solution:** The most popular use of these data structures are to add properties for touch or pointer events, and those properties are now supported by default with a newer high-performance approach in jQuery 3.0 that only retrieves the properties on first access. If you are using jQuery Mobile, check the [jquerymobile.com](https://jquerymobile.com) site for updates. If you are using plugins such as [pointerTouch](https://github.com/timmywil/jquery.event.pointertouch) or [touchHooks](https://github.com/aarongloege/jquery.touchHooks), simply remove them as they are no longer needed.
### JQMIGRATE: jQuery(window).on('load'...) called after load event occurred
### \[load-after-event\] JQMIGRATE: jQuery(window).on('load'...) called after load event occurred
**Cause:** The calling code has attempted to attach a `load` event to `window` after the page has already loaded. That means the handler will never run and so is probably not what the caller intended. This can occur when the event attachment is made too late, for example, in a jQuery ready handler. It can also occur when a file is loaded dynamically with jQuery after the page has loaded, for example using the `$.getScript()` method.
**Solution:** If a function `fn` does not actually depend on all page assets being fully loaded, switch to a ready handler `$( fn )` which runs earlier and will aways run `fn` even if the script that contains the code loads long after the page has fully loaded. If `fn` actually does depend on the script being fully loaded, check `document.readyState`. If the value is `"complete"` run the function immediately, otherwise use `$(window).on( "load", fn )`.
### JQMIGRATE: jQuery.holdReady() is deprecated
### \[holdReady\] JQMIGRATE: jQuery.holdReady() is deprecated
**Cause:** The `jQuery.holdReady()` method has been deprecated due to its detrimental effect on the global performance of the page. This method can prevent all the code on the page from initializing for extended lengths of time.
**Solution:** Rewrite the page so that it does not require all jQuery ready handlers to be delayed. This might be accomplished, for example, by late-loading only the code that requires the delay when it is safe to run. Due to the complexity of this method, jQuery Migrate does not attempt to fill the functionality. If the underlying version of jQuery used with jQuery Migrate no longer contains `jQuery.holdReady()` the code will fail shortly after this warning appears.
### JQMIGRATE: jQuery.isWindow() is deprecated
### \[isFunction\] JQMIGRATE: jQuery.isFunction() is deprecated
**Cause:** This method returns `true` if its argument is thought to be a function. It was created to work around bugs in `typeof` implementations in legacy browsers.
**Solution:** Replace any use of `jQuery.isFunction( x )` with `typeof x === "function"`.
### \[isWindow\] JQMIGRATE: jQuery.isWindow() is deprecated
**Cause:** This method returns `true` if its argument is thought to be a `window` element. It was created for internal use and is not a reliable way of detecting `window` for public needs.
**Solution:** Remove any use of `jQuery.isWindow()` from code. If it is truly needed it can be replaced with a check for `obj != null && obj === obj.window` which was the test used inside this method.
### JQMIGRATE: jQuery.fn.click() event shorthand is deprecated
### \[shorthand-deprecated-v3\] JQMIGRATE: jQuery.fn.click() event shorthand is deprecated
**Cause:** The `.on()` and `.trigger()` methods can set an event handler or generate an event for any event type, and should be used instead of the shortcut methods. This message also applies to the other event shorthands, including: blur, focus, focusin, focusout, resize, scroll, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, and contextmenu.
**Solution:** Instead of `.click(fn)` use `.on("click", fn)`. Instead of `.click()` use `.trigger("click")`.
### JQMIGRATE: jQuery.fn.hover() is deprecated
### \[pre-on-methods\] JQMIGRATE: jQuery.fn.hover() is deprecated
**Cause:** The `.hover()` method is a shorthand for the use of the `mouseover`/`mouseout` events. It is often a poor user interface choice because it does not allow for any small amounts of delay between when the mouse enters or exits an area and when the event fires. This can make it quite difficult to use with UI widgets such as drop-down menus. For more information on the problems of hovering, see the [hoverIntent plugin](http://cherne.net/brian/resources/jquery.hoverIntent.html).
**Cause:** The `.hover()` method is a shorthand for the use of the `mouseover`/`mouseout` events. It is often a poor user interface choice because it does not allow for any small amounts of delay between when the mouse enters or exits an area and when the event fires. This can make it quite difficult to use with UI widgets such as drop-down menus. For more information on the problems of hovering, see the [hoverIntent plugin](http://cherne.net/brian/resources/jquery.hoverIntent.html).
**Solution:** Review uses of `.hover()` to determine if they are appropriate, and consider use of plugins such as `hoverIntent` as an alternative. The direct replacement for `.hover(fn1, fn2)`, is `.on("mouseenter", fn1).on("mouseleave", fn2)`.
### JQMIGRATE: jQuery.nodeName() is deprecated
### \[nodeName\] JQMIGRATE: jQuery.nodeName() is deprecated
**Cause:** This public but never-documented method has been deprecated as of jQuery 3.2.0.
**Solution:** Replace calls such as `jQuery.nodeName( elem, "div" )` with a test such as `elem.nodeName.toLowerCase() === "div"`.
### \[cssProps\] JQMIGRATE: jQuery.cssProps is deprecated
**Cause:** The `jQuery.cssProps` property is a public but undocumented object that allows CSS properties with one name to be mapped into another name. It was used for legacy browsers like IE8 that used non-standard names. This object is no longer used inside jQuery since all supported browsers now use the standard CSS property names.
**Solution:** Remove any uses of `jQuery.cssProps` in application code.
### \[isArray\] JQMIGRATE: jQuery.isArray is deprecated; use Array.isArray
**Cause:** Older versions of JavaScript made it difficult to determine if a particular object was a true Array, so jQuery provided a cross-browser function to do the work. The browsers supported by jQuery 3.0 all provide a standard method for this purpose.
**Solution:** Replace any calls to `jQuery.isArray` with `Array.isArray`.
### \[trim\] JQMIGRATE: jQuery.trim is deprecated; use String.prototype.trim
**Cause:** Older versions of IE & Android Browser didn't implement a method to `trim` strings so jQuery provided a cross-browser implementation. The browsers supported by jQuery 3.0 all provide a standard method for this purpose.
**Solution:** Replace any calls to `jQuery.trim( text )` with `text.trim()` if you know `text` is a string; otherwise, you can replace it with `String.prototype.trim.call( text == null ? "" : text )`.
### \[css-number\] JQMIGRATE: Number-typed values are deprecated for jQuery.fn.css( _(property name)_, value )
**Cause:** In past versions, when a number-typed value was passed to `.css()` jQuery converted it to a string and added `"px"` to the end. As the CSS standard has evolved, an increasingly large set of CSS properties now accept values that are unitless numbers, where this behavior is incorrect. It has become impractical to manage these exceptions in the `jQuery.cssNumber` object. In addition, some CSS properties like `line-height` can accept both a bare number `2` or a pixel value `2px`. jQuery cannot know the correct way to interpret `$.css("line-height", 2)` and currently treats it as `"2px"`.
**Solution:** Always pass string values to `.css()`, and explicitly add units where required. For example, use `$.css("line-height", "2")` to specify 200% of the current line height or `$.css("line-height", "2px")` to specify pixels. When the numeric value is in a variable, ensure the value is converted to string, e.g. `$.css("line-height", String(height))` and `$.css("line-height", height+"px")`.
### \[self-closed-tags\] JQMIGRATE: HTML tags must be properly nested and closed: _(HTML string)_
**Cause:** jQuery 3.5.0 changed the way it processes HTML strings. Previously, jQuery would attempt to fix self-closed tags like `<i class="test" />` that the HTML5 specification says are not self-closed, turning it into `<i class="test"></i>`. This processing can create a [security problem](https://nvd.nist.gov/vuln/detail/CVE-2020-11022) with malicious strings, so the functionality had to be removed.
**Solution:** Search for the reported HTML strings and edit the tags to close them explicitly. In some cases the strings passed to jQuery may be created inside the program and thus not searchable. Migrate warning messages include a stack trace that can be used to find the location of the usage in the code.
### \[jsonp-promotion\] JQMIGRATE: JSON-to-JSONP auto-promotion is deprecated
**Cause:** `jQuery.ajax` calls with `dataType: 'json'` with a provided callback are automatically converted by jQuery to JSONP requests unless the options also specify `jsonp: false`. Auto-promoting JSON requests to JSONP introduces a security risk as the developer may be unaware they're not just downloading data but executing code from a remote domain. This auto-promoting behavior is deprecated and will be removed in jQuery 4.0.0.
**Solution:** To trigger a JSONP request, specify the `dataType: "jsonp"` option.