Skip to content

Commit 562f26c

Browse files
authored
Core: Accept only jQuery 3.x-4.x
Closes gh-470
1 parent 7ae3a9f commit 562f26c

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ Upgrading libraries such as jQuery can be a lot of work, when breaking changes h
77

88
That way you can spot and fix what otherwise would have been errors, until you no longer need jQuery Migrate and can remove it.
99

10+
## Version compatibility
11+
12+
The following table indicates which jQuery Migrate versions can be used with which jQuery versions:
13+
14+
| jQuery version | jQuery Migrate version |
15+
|----------------|-------------------------|
16+
| 1.x | 1.x |
17+
| 2.x | 1.x |
18+
| 3.x | 3.x / 4.x<sup>[1]</sup> |
19+
| 4.x | 3.x / 4.x<sup>[1]</sup> |
20+
21+
[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.
22+
1023
## Usage
1124

1225
In your web page, load this plugin *after* the script tag for jQuery, for example:

src/main.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import "./disablePatches.js";
1010
return;
1111
}
1212

13-
// Need jQuery 3.0.0+ and no older Migrate loaded
14-
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ) {
15-
window.console.log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" );
13+
// Need jQuery 3.x-4.x and no older Migrate loaded
14+
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ||
15+
jQueryVersionSince( "5.0.0" ) ) {
16+
window.console.log( "JQMIGRATE: jQuery 3.x-4.x REQUIRED" );
1617
}
1718
if ( jQuery.migrateWarnings ) {
1819
window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" );

0 commit comments

Comments
 (0)