" ).appendTo( "#qunit-fixture" ),
+
+ // No warning, no need to fix
+ okays = [
+ "a[href='#some-anchor']",
+ "[data-id=\"#junk\"]",
+ "div[data-selector='a[href=#main]']",
+ "input[value~= '[strange*=#stuff]']"
+ ],
+
+ // Fixable, and gives warning
+ fixables = [
+ "a[href=#]",
+ "a[href*=#]:not([href=#]):first-child",
+ ".space a[href=#]",
+ "a[href=#some-anchor]",
+ "link[rel*=#stuff]",
+ "p[class *= #junk]",
+ "a[href=space#junk]"
+ ],
+
+ // False positives that still work
+ positives = [
+ "div[data-selector='a[href=#main]']:first",
+ "input[value= '[strange*=#stuff]']:eq(0)"
+ ],
+
+ // Failures due to quotes and jQuery extensions combined
+ failures = [
+ "p[class ^= #junk]:first",
+ "a[href=space#junk]:eq(1)"
+ ];
+
+ expectNoWarning( assert, "Perfectly cromulent selectors are unchanged", function() {
+ okays.forEach( function( okay ) {
+ assert.equal( jQuery( okay, markup ).length, 1, okay );
+ assert.equal( markup.find( okay ).length, 1, okay );
+ } );
+ } );
+
+ expectWarning( assert, "Values with unquoted hashes are quoted",
+ fixables.length * 2, function() {
+ fixables.forEach( function( fixable ) {
+ assert.equal( jQuery( fixable, markup ).length, 1, fixable );
+ assert.equal( markup.find( fixable ).length, 1, fixable );
+ } );
+ } );
+
+ expectWarning( assert, "False positives", positives.length * 2, function() {
+ positives.forEach( function( positive ) {
+ assert.equal( jQuery( positive, markup ).length, 1, positive );
+ assert.equal( markup.find( positive ).length, 1, positive );
+ } );
+ } );
+
+ expectWarning( assert, "Unfixable cases", failures.length * 2, function() {
+ failures.forEach( function( failure ) {
+ try {
+ jQuery( failure, markup );
+ assert.ok( false, "Expected jQuery() to die!" );
+ } catch ( err1 ) { }
+ try {
+ markup.find( failure );
+ assert.ok( false, "Expected .find() to die!" );
+ } catch ( err2 ) { }
+ } );
+ } );
+
+ // Ensure we don't process jQuery( x ) when x is a function
+ expectNoWarning( assert, "ready function with attribute selector", function() {
+ try {
+ jQuery( function() {
+ if ( jQuery.thisIsNeverTrue ) {
+ jQuery( "a[href=#]" );
+ }
+ } );
+ } catch ( e ) {}
+ } );
+} );
+
QUnit.test( "jQuery.expr.pseudos aliases", function( assert ) {
assert.expect( 7 );
diff --git a/warnings.md b/warnings.md
index 42ca9d61..ae975ccb 100644
--- a/warnings.md
+++ b/warnings.md
@@ -1,6 +1,6 @@
# jQuery Migrate Plugin - Warning Messages
-**NOTE: This page lists the messages for jQuery Migrate 3.0. If you are using an earlier version, see the documentation on [the 1.x-stable branch](https://github.com/jquery/jquery-migrate/blob/1.x-stable/warnings.md).**
+**NOTE: This page lists the messages for jQuery Migrate 3.x. If you are using an earlier version, see the documentation on [the 1.x-stable branch](https://github.com/jquery/jquery-migrate/blob/1.x-stable/warnings.md).**
To allow developers to identify and fix compatibility issues when migrating older jQuery code, the development (uncompressed) version of the plugin generates console warning messages whenever any of its functionality is called. The messages only appear once on the console for each unique message.
@@ -15,9 +15,9 @@ All messages generated by this plugin start with the text "JQMIGRATE" for easy i
This is _not_ a warning, but a console log message the plugin shows when it first loads to indicate whether warnings will be shown on the console when appropriate. As of version 1.4.0 this message is also shown with production builds. The use jQuery Migrate in production has performance impacts and can complicate debugging as it modifies the normal behavior of the version of jQuery being used.
-### JQMIGRATE: jQuery 3.0.0+ REQUIRED
+### JQMIGRATE: jQuery 3.x REQUIRED
-**Cause:** The page does not have a version of jQuery installed, or is using a version of jQuery older than 3.0.0. The jQuery Migrate plugin is not intended to be used for those cases. Any messages that follow this one may not be accurate, or the page may not run properly at all.
+**Cause:** The page does not have a version of jQuery installed, or is using a version of jQuery 4.0.0 or newer or older than 3.0.0. The jQuery Migrate plugin is not intended to be used for those cases. Any messages that follow this one may not be accurate, or the page may not run properly at all.
**Solution:** See the [README](https://github.com/jquery/jquery-migrate/#readme) for more information on usage and upgrading from older versions.
@@ -191,14 +191,6 @@ See jQuery-ui [commit](https://github.com/jquery/jquery-ui/commit/c0093b599fcd58
**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"`.
-### \[push\] JQMIGRATE: jQuery.fn.push() is deprecated and removed; use .add or convert to an array
-### \[sort\] JQMIGRATE: jQuery.fn.sort() is deprecated and removed; convert to an array before sorting
-### \[splice\] JQMIGRATE: jQuery.fn.splice() is deprecated and removed; use .slice or .not with .eq
-
-**Cause**: jQuery used to add the Array `push`, `sort` & `splice` methods to the jQuery prototype. They behaved differently to other jQuery APIs - they modify the jQuery collections in place, they don't play nice with APIs like `.end()`, they were also never documented.
-
-**Solution**: Replace `.push( node )` with `.add( node )`, `.splice( index )` with `.not( elem.eq( index ) )`. In more complex cases, call `.toArray()` first, manipulate the resulting array and convert back to the jQuery object by passing the resulting array to `$()`.
-
### \[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.
@@ -230,7 +222,7 @@ See jQuery-ui [commit](https://github.com/jquery/jquery-ui/commit/c0093b599fcd58
**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 )`.
+**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 always 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 )`.
### \[holdReady\] JQMIGRATE: jQuery.holdReady() is deprecated
From 8d20816194c6c5b1ff4c8eb82c25f652bf3db873 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
Date: Wed, 6 Nov 2024 09:51:51 +0100
Subject: [PATCH 02/11] Core: Don't reimplement deprecated but not removed APIs
This will save space and avoid potential divergence from Core.
To minimize risk, this only handles APIs still present in jQuery 4.x.
---
src/jquery/core.js | 35 +++--------------------------------
src/jquery/event.js | 33 ++++++++++++---------------------
2 files changed, 15 insertions(+), 53 deletions(-)
diff --git a/src/jquery/core.js b/src/jquery/core.js
index c1f8b311..26d47a0f 100644
--- a/src/jquery/core.js
+++ b/src/jquery/core.js
@@ -2,9 +2,7 @@ import { jQueryVersionSince } from "../compareVersions.js";
import { migratePatchAndWarnFunc } from "../main.js";
import "../disablePatches.js";
-var arr = [],
- slice = arr.slice,
- class2type = {},
+var class2type = {},
// Require that the "whitespace run" starts from a non-whitespace
// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
@@ -116,34 +114,7 @@ if ( jQueryVersionSince( "3.3.0" ) ) {
// arguments.
// jQuery.proxy is deprecated to promote standards (specifically Function#bind)
// However, it is not slated for removal any time soon
- migratePatchAndWarnFunc( jQuery, "proxy",
- function( fn, context ) {
- var tmp, args, proxy;
-
- if ( typeof context === "string" ) {
- tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- args = slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
- return proxy;
- }, "proxy",
- "jQuery.proxy() is deprecated"
- );
+ migratePatchAndWarnFunc( jQuery, "proxy", jQuery.proxy,
+ "proxy", "DEPRECATED: jQuery.proxy()" );
}
diff --git a/src/jquery/event.js b/src/jquery/event.js
index 5a5ea9a1..e7a6c4b8 100644
--- a/src/jquery/event.js
+++ b/src/jquery/event.js
@@ -96,13 +96,9 @@ jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
function( _i, name ) {
// Handle event binding
- migratePatchAndWarnFunc( jQuery.fn, name, function( data, fn ) {
- return arguments.length > 0 ?
- this.on( name, null, data, fn ) :
- this.trigger( name );
- },
- "shorthand-deprecated-v3",
- "jQuery.fn." + name + "() event shorthand is deprecated" );
+ migratePatchAndWarnFunc( jQuery.fn, name, jQuery.fn[ name ], "shorthand-deprecated-v3",
+ "DEPRECATED: jQuery.fn." + name + "() event shorthand" );
+
} );
// Trigger "ready" event only once, on document ready
@@ -118,20 +114,15 @@ jQuery.event.special.ready = {
}
};
-migratePatchAndWarnFunc( jQuery.fn, "bind", function( types, data, fn ) {
- return this.on( types, null, data, fn );
-}, "pre-on-methods", "jQuery.fn.bind() is deprecated" );
-migratePatchAndWarnFunc( jQuery.fn, "unbind", function( types, fn ) {
- return this.off( types, null, fn );
-}, "pre-on-methods", "jQuery.fn.unbind() is deprecated" );
-migratePatchAndWarnFunc( jQuery.fn, "delegate", function( selector, types, data, fn ) {
- return this.on( types, selector, data, fn );
-}, "pre-on-methods", "jQuery.fn.delegate() is deprecated" );
-migratePatchAndWarnFunc( jQuery.fn, "undelegate", function( selector, types, fn ) {
- return arguments.length === 1 ?
- this.off( selector, "**" ) :
- this.off( types, selector || "**", fn );
-}, "pre-on-methods", "jQuery.fn.undelegate() is deprecated" );
+migratePatchAndWarnFunc( jQuery.fn, "bind", jQuery.fn.bind,
+ "pre-on-methods", "jQuery.fn.bind() is deprecated" );
+migratePatchAndWarnFunc( jQuery.fn, "unbind", jQuery.fn.unbind,
+ "pre-on-methods", "jQuery.fn.unbind() is deprecated" );
+migratePatchAndWarnFunc( jQuery.fn, "delegate", jQuery.fn.delegate,
+ "pre-on-methods", "jQuery.fn.delegate() is deprecated" );
+migratePatchAndWarnFunc( jQuery.fn, "undelegate", jQuery.fn.undelegate,
+ "pre-on-methods", "jQuery.fn.undelegate() is deprecated" );
+
migratePatchAndWarnFunc( jQuery.fn, "hover", function( fnOver, fnOut ) {
return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver );
}, "pre-on-methods", "jQuery.fn.hover() is deprecated" );
From 75c35bcc2ec27d52a354026d1c7722acad36c7c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
Date: Tue, 19 Nov 2024 23:14:47 +0100
Subject: [PATCH 03/11] Attributes: Update warnings.md to not mention jQuery
4.0
---
warnings.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/warnings.md b/warnings.md
index ae975ccb..465be03c 100644
--- a/warnings.md
+++ b/warnings.md
@@ -106,13 +106,13 @@ This is _not_ a warning, but a console log message the plugin shows when it firs
### \[boolean-attributes\] JQMIGRATE: Boolean attribute 'NAME' value is different from its lowercased name
### \[boolean-attributes\] JQMIGRATE: Boolean attribute 'NAME' value is not set to its lowercased name
-**Cause**: Prior to jQuery 4.0, when calling `.attr( name, value )` with any non-`false` non-`null` `value`, jQuery would actually set it to `name`. Similarly, regardless of the actual value, `.attr( name )` used to return `name` lowercased. jQuery 4.0 removes this special behavior.
+**Cause**: When calling `.attr( name, value )` with any non-`false` non-`null` `value`, jQuery would actually set it to `name`. Similarly, regardless of the actual value, `.attr( name )` used to return `name` lowercased. This behavior is deprecated.
**Solution**: Always set boolean attributes to their names, whether when using jQuery (`.attr( name, name )`), native APIs (`.setAttribute( name, name )`) or directly in HTML (``).
### \[attr-false\] JQMIGRATE: Setting the non-ARIA non-boolean attribute 'NAME' to false
-**Cause**: Prior to jQuery 4.0, calling `.attr( name, false )` was only removing the attribute when `name` was a boolean attribute; otherwise, it was setting the attribute value to `"false"`. In jQuery 4.x, it will remove any non-ARIA attribute.
+**Cause**: Calling `.attr( name, false )` only removes the attribute when `name` is a boolean attribute; otherwise, it sets the attribute value to `"false"`. This behavior is deprecated for non-ARIA attributes.
**Solution**: If you want to set the value of an attribute to `"false"`, wrap it in quotes: `.attr( name, "false" )`.
From 946c36fb8f41bfcb83a0417f3759026d6687527f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
Date: Sat, 4 Jan 2025 13:53:57 +0100
Subject: [PATCH 04/11] Build: Rename more `main`s to `3.x-stable`s
---
.github/workflows/browser-tests.yml | 2 +-
.github/workflows/browserstack.yml | 2 +-
.github/workflows/filestash.yml | 2 +-
CONTRIBUTING.md | 6 +++---
README.md | 6 +++---
build/release.js | 6 +++---
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/.github/workflows/browser-tests.yml b/.github/workflows/browser-tests.yml
index 10426204..e6890e41 100644
--- a/.github/workflows/browser-tests.yml
+++ b/.github/workflows/browser-tests.yml
@@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- - main
+ - 3.x-stable
env:
NODE_VERSION: 22.x
diff --git a/.github/workflows/browserstack.yml b/.github/workflows/browserstack.yml
index 03c58b0b..705625f1 100644
--- a/.github/workflows/browserstack.yml
+++ b/.github/workflows/browserstack.yml
@@ -3,7 +3,7 @@ name: Browserstack
on:
push:
branches:
- - main
+ - 3.x-stable
# Once a week every Tuesday
schedule:
- cron: "12 2 * * 2"
diff --git a/.github/workflows/filestash.yml b/.github/workflows/filestash.yml
index 4f1a9279..34f83b68 100644
--- a/.github/workflows/filestash.yml
+++ b/.github/workflows/filestash.yml
@@ -3,7 +3,7 @@ name: Filestash
on:
push:
branches:
- - main
+ - 3.x-stable
permissions:
contents: read # to fetch code (actions/checkout)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 69865b1d..dd91e121 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -78,16 +78,16 @@ Change directory to the newly created dir `jquery-migrate/`:
$ cd jquery-migrate
```
-Add the jQuery Migrate `main` as a remote (e.g. `upstream`):
+Add the jQuery Migrate `3.x-stable` as a remote (e.g. `upstream`):
```bash
$ git remote add upstream git@github.com:jquery/jquery-migrate.git
```
-Get in the habit of pulling in the "upstream" main to stay up to date as jQuery Migrate receives new commits:
+Get in the habit of pulling in the "upstream" `3.x-stable` to stay up to date as jQuery Migrate receives new commits:
```bash
-$ git pull upstream main
+$ git pull upstream 3.x-stable
```
Install the necessary dependencies:
diff --git a/README.md b/README.md
index bd615a60..3eb27665 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-
+
#### 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/).
@@ -50,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/main/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/3.x-stable/warnings.md).
## Migrate Plugin API
@@ -69,7 +69,7 @@ This plugin adds some properties to the `jQuery` object that can be used to prog
`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. You can find a code for each patch in square brackets in [warnings.md](https://github.com/jquery/jquery-migrate/blob/3.x-stable/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.
diff --git a/build/release.js b/build/release.js
index 92242abe..6dd74e05 100644
--- a/build/release.js
+++ b/build/release.js
@@ -22,7 +22,7 @@ var releaseVersion,
prompt = enquirer.prompt,
repoURL = "git@github.com:jquery/jquery-migrate.git",
- branch = "main",
+ branch = "3.x-stable",
// Windows needs the .cmd version but will find the non-.cmd
// On Windows, also ensure the HOME environment variable is set
@@ -211,7 +211,7 @@ async function publishToNPM( next ) {
function setNextVersion( next ) {
updateSourceVersion( nextVersion );
- updatePackageVersion( nextVersion, "main" );
+ updatePackageVersion( nextVersion, "3.x-stable" );
git( [ "commit", "-a", "--no-verify", "-m", "Updating the source version to " + nextVersion ],
next );
}
@@ -281,7 +281,7 @@ function updateReadmeVersion() {
}
function setBlobVersion( s, v ) {
- return s.replace( /\/blob\/(?:(\d+\.\d+[^\/]+)|main)/, "/blob/" + v );
+ return s.replace( /\/blob\/(?:(\d+\.\d+[^\/]+)|3.x-stable)/, "/blob/" + v );
}
function writeJsonSync( fname, json ) {
From 7f1aa2163b65ae9d1944f1ce0b9bf38ab4910e9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
Date: Sun, 5 Jan 2025 00:19:52 +0100
Subject: [PATCH 05/11] Event: Reimplement APIs deprecated in jQuery 3.0/3.1
This fixes tests with 3.0/3.1 slim builds.
---
src/jquery/event.js | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/src/jquery/event.js b/src/jquery/event.js
index e7a6c4b8..c0cce65e 100644
--- a/src/jquery/event.js
+++ b/src/jquery/event.js
@@ -114,15 +114,25 @@ jQuery.event.special.ready = {
}
};
-migratePatchAndWarnFunc( jQuery.fn, "bind", jQuery.fn.bind,
- "pre-on-methods", "jQuery.fn.bind() is deprecated" );
-migratePatchAndWarnFunc( jQuery.fn, "unbind", jQuery.fn.unbind,
- "pre-on-methods", "jQuery.fn.unbind() is deprecated" );
-migratePatchAndWarnFunc( jQuery.fn, "delegate", jQuery.fn.delegate,
- "pre-on-methods", "jQuery.fn.delegate() is deprecated" );
-migratePatchAndWarnFunc( jQuery.fn, "undelegate", jQuery.fn.undelegate,
- "pre-on-methods", "jQuery.fn.undelegate() is deprecated" );
-
+// Support: jQuery <3.2.0 only
+// jQuery 3.0.x & 3.1.x used to not include the deprecated module in the slim build.
+// To maintain compatibility with those versions, we need to reimplement APIs
+// deprecated in them.
+// See https://github.com/jquery/jquery/blob/3.1.1/src/deprecated.js
+migratePatchAndWarnFunc( jQuery.fn, "bind", function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+}, "pre-on-methods", "jQuery.fn.bind() is deprecated" );
+migratePatchAndWarnFunc( jQuery.fn, "unbind", function( types, fn ) {
+ return this.off( types, null, fn );
+}, "pre-on-methods", "jQuery.fn.unbind() is deprecated" );
+migratePatchAndWarnFunc( jQuery.fn, "delegate", function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+}, "pre-on-methods", "jQuery.fn.delegate() is deprecated" );
+migratePatchAndWarnFunc( jQuery.fn, "undelegate", function( selector, types, fn ) {
+ return arguments.length === 1 ?
+ this.off( selector, "**" ) :
+ this.off( types, selector || "**", fn );
+}, "pre-on-methods", "jQuery.fn.undelegate() is deprecated" );
migratePatchAndWarnFunc( jQuery.fn, "hover", function( fnOver, fnOut ) {
return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver );
}, "pre-on-methods", "jQuery.fn.hover() is deprecated" );
From 182359ffb754427eaf4fe78ae8569468d34e6867 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
Date: Sun, 5 Jan 2025 00:23:44 +0100
Subject: [PATCH 06/11] Tests: Test on jQuery 3.1.1.slim in non-BrowserStack
browser tests
jQuery <3.2.0 doesn't include the deprecated module in the slim build so it
makes sense to test on one of these versions in slim mode even on PRs.
---
jtr-local.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/jtr-local.yml b/jtr-local.yml
index 2fdfd1c8..e0ab114b 100644
--- a/jtr-local.yml
+++ b/jtr-local.yml
@@ -14,6 +14,7 @@ flags:
- 3.3.1
- 3.2.1
- 3.1.1
+ - 3.1.1.slim
- 3.0.0
retries: 1
From e891cfc05e610b7a34fa8b729dd110406c05c8fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
Date: Sun, 5 Jan 2025 00:26:39 +0100
Subject: [PATCH 07/11] Build: Stop testing on iOS 10
As of January 2025, iOS 10 is a tier 4 device on BrowserStack:
https://www.browserstack.com/device-tiers
That leads to devices with this iOS version often not being available and
failing our tests. Remove it from the test matrix. Also, add comments explaining
the status of tests on various iOS versions, including iOS 7 that we stopped
testing on a long time ago.
Ref jquery/jquery#5606
---
.github/workflows/browserstack.yml | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/browserstack.yml b/.github/workflows/browserstack.yml
index 705625f1..8708e0a6 100644
--- a/.github/workflows/browserstack.yml
+++ b/.github/workflows/browserstack.yml
@@ -51,9 +51,19 @@ jobs:
- '__iOS_13'
- '__iOS_12'
- '__iOS_11'
- - '__iOS_10'
+
+ # iOS 10 is a tier 4 device as of January 2025 and its availability
+ # is poor, leading to frequent test timeouts. Skip testing on it.
+ # See https://www.browserstack.com/device-tiers
+ # - '__iOS_10'
+
+ # Versions below are not officially supported by BrowserStack as
+ # they use emulators instead of real devices. We include them as
+ # long as they still work.
- '__iOS_9'
- '__iOS_8'
+ # iOS 7 emulators no longer work properly
+ # - '__iOS_7'
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
From fb1f74bf790ef5f3103fa1c034732d099723eb2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
Date: Tue, 14 Jan 2025 12:55:56 +0100
Subject: [PATCH 08/11] Build: Update a vulnerable dependency
---
package-lock.json | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 96b7569f..32208064 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -879,10 +879,11 @@
"license": "MIT"
},
"node_modules/cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true,
+ "license": "MIT",
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
From 5505f7f134d06304efe5b36d29bd3fbce74d43c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
Date: Mon, 27 Jan 2025 19:03:15 +0100
Subject: [PATCH 09/11] Core: Update the package.json description
Indicate this version of Migrate helps with updating jQuery to 3.x, not 3.0+.
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index c52a71ce..4679a577 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "jquery-migrate",
"title": "jQuery Migrate",
- "description": "Migrate older jQuery code to jQuery 3.0+",
+ "description": "Migrate older jQuery code to jQuery 3.x",
"main": "dist/jquery-migrate.js",
"version": "3.5.3-pre",
"type": "module",
From 4a66dab8dcbe72ed929b5f1a8e0e093a3d5cd002 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
Date: Tue, 28 Jan 2025 00:46:02 +0100
Subject: [PATCH 10/11] Docs: Link to jQuery Browser Support page in README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 3eb27665..b2dd5339 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ The following table indicates which jQuery Migrate versions can be used with whi
| 3.x | 3.x |
| 4.x | 4.x |
-Each jQuery Migrate version supports the same browsers that the jQuery version used with it.
+Each jQuery Migrate version supports the same browsers that the jQuery version used with it. See the [jQuery Browser Support page](https://jquery.com/browser-support/) for more information.
## Usage
From cf6a09e0d45785bb9bc99a94ff0c80f6d06b7ffc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?=
Date: Tue, 18 Feb 2025 00:57:44 +0100
Subject: [PATCH 11/11] Docs: Address code review remarks
---
README.md | 2 +-
src/jquery/ajax.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index b2dd5339..283bb01f 100644
--- a/README.md
+++ b/README.md
@@ -40,7 +40,7 @@ The production build is minified and does not generate console warnings. It will
| Debugging enabled |
✓
| |
| Minified | |
✓
|
| Latest release (*may be hotlinked if desired*) | [jquery-migrate-3.5.2.js](https://code.jquery.com/jquery-migrate-3.5.2.js) | [jquery-migrate-3.5.2.min.js](https://code.jquery.com/jquery-migrate-3.5.2.min.js) |
-| \* Latest work-in-progress build | [jquery-migrate-3.x-git.js](https://releases.jquery.com/git/jquery-migrate-3.x-git.js) | [jquery-migrate-3.x-git.min.js](https://releases.jquery.com/git/jquery-migrate-3.x-git.min.js) |
+| \* Latest work-in-progress 3.x build | [jquery-migrate-3.x-git.js](https://releases.jquery.com/git/jquery-migrate-3.x-git.js) | [jquery-migrate-3.x-git.min.js](https://releases.jquery.com/git/jquery-migrate-3.x-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.
diff --git a/src/jquery/ajax.js b/src/jquery/ajax.js
index 9c2bf679..8f982626 100644
--- a/src/jquery/ajax.js
+++ b/src/jquery/ajax.js
@@ -43,7 +43,7 @@ jQuery.ajaxSetup( {
// Register this prefilter before the jQuery one. Otherwise, a promoted
// request is transformed into one with the script dataType, and we can't
// catch it anymore.
-// jQuery <4 already contains this prefixer; don't duplicate the whole logic,
+// jQuery <4 already contains this prefilter; don't duplicate the whole logic,
// but only enough to know when to warn.
jQuery.ajaxPrefilter( "+json", function( s ) {