Skip to content

Commit 0a61d7d

Browse files
authored
Core: Remove support for jQuery 4.x
Changes: * Core: Remove support for jQuery 4.x * 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. * Attributes: Update warnings.md to not mention jQuery 4.0 * Build: Rename more `main`s to `3.x-stable`s * Event: Reimplement APIs deprecated in jQuery 3.0/3.1 This fixes tests with 3.0/3.1 slim builds. * 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. * 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. * Build: Update a vulnerable dependency * Core: Update the package.json description Indicate this version of Migrate helps with updating jQuery to 3.x, not 3.0+. * Docs: Link to jQuery Browser Support page in README.md Closes gh-554 Ref gh-555 Ref jquery/jquery#5606
1 parent a92442f commit 0a61d7d

33 files changed

+409
-809
lines changed

.github/workflows/browser-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- main
7+
- 3.x-stable
88

99
env:
1010
NODE_VERSION: 22.x

.github/workflows/browserstack-git.yml

-68
This file was deleted.

.github/workflows/browserstack-3.x.yml .github/workflows/browserstack.yml

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: Browserstack (Core 3.x)
1+
name: Browserstack
22

33
on:
44
push:
55
branches:
6-
- main
6+
- 3.x-stable
77
# Once a week every Tuesday
88
schedule:
99
- cron: "12 2 * * 2"
@@ -51,9 +51,19 @@ jobs:
5151
- '__iOS_13'
5252
- '__iOS_12'
5353
- '__iOS_11'
54-
- '__iOS_10'
54+
55+
# iOS 10 is a tier 4 device as of January 2025 and its availability
56+
# is poor, leading to frequent test timeouts. Skip testing on it.
57+
# See https://www.browserstack.com/device-tiers
58+
# - '__iOS_10'
59+
60+
# Versions below are not officially supported by BrowserStack as
61+
# they use emulators instead of real devices. We include them as
62+
# long as they still work.
5563
- '__iOS_9'
5664
- '__iOS_8'
65+
# iOS 7 emulators no longer work properly
66+
# - '__iOS_7'
5767
steps:
5868
- name: Checkout
5969
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -79,6 +89,6 @@ jobs:
7989

8090
- name: Test
8191
run: |
82-
npm run test:unit -- -v -c jtr-3.x.yml \
92+
npm run test:unit -- -v -c jtr-ci.yml \
8393
--browserstack "${{ matrix.BROWSER }}" \
8494
--run-id ${{ github.run_id }} \

.github/workflows/filestash.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Filestash
33
on:
44
push:
55
branches:
6-
- main
6+
- 3.x-stable
77

88
permissions:
99
contents: read # to fetch code (actions/checkout)
@@ -47,5 +47,5 @@ jobs:
4747
4848
- name: Upload to Filestash
4949
run: |
50-
rsync dist/jquery-migrate.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-migrate-git.js
51-
rsync dist/jquery-migrate.min.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-migrate-git.min.js
50+
rsync dist/jquery-migrate.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-migrate-3.x-git.js
51+
rsync dist/jquery-migrate.min.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-migrate-3.x-git.min.js

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Make sure you have reproduced the bug with all browser extensions and add-ons di
4747

4848
### Try the latest version of jQuery Migrate
4949

50-
Bugs in old versions of jQuery Migrate may have already been fixed. In order to avoid reporting known issues, make sure you are always testing against the [latest build](https://releases.jquery.com/git/jquery-migrate-git.js). We cannot fix bugs in older released files, if a bug has been fixed in a subsequent version of jQuery Migrate the site should upgrade.
50+
Bugs in old versions of jQuery Migrate may have already been fixed. In order to avoid reporting known issues, make sure you are always testing against the [latest build](https://releases.jquery.com/git/jquery-migrate-3.x-git.js). We cannot fix bugs in older released files, if a bug has been fixed in a subsequent version of jQuery Migrate the site should upgrade.
5151

5252
### Simplify the test case
5353

@@ -78,16 +78,16 @@ Change directory to the newly created dir `jquery-migrate/`:
7878
$ cd jquery-migrate
7979
```
8080

81-
Add the jQuery Migrate `main` as a remote (e.g. `upstream`):
81+
Add the jQuery Migrate `3.x-stable` as a remote (e.g. `upstream`):
8282

8383
```bash
8484
$ git remote add upstream [email protected]:jquery/jquery-migrate.git
8585
```
8686

87-
Get in the habit of pulling in the "upstream" main to stay up to date as jQuery Migrate receives new commits:
87+
Get in the habit of pulling in the "upstream" `3.x-stable` to stay up to date as jQuery Migrate receives new commits:
8888

8989
```bash
90-
$ git pull upstream main
90+
$ git pull upstream 3.x-stable
9191
```
9292

9393
Install the necessary dependencies:

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![CI Status](https://github.com/jquery/jquery-migrate/actions/workflows/node.js.yml/badge.svg?branch=main)
1+
![CI Status](https://github.com/jquery/jquery-migrate/actions/workflows/node.js.yml/badge.svg?branch=3.x-stable)
22

33
#### 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/).
44

@@ -11,14 +11,14 @@ That way you can spot and fix what otherwise would have been errors, until you n
1111

1212
The following table indicates which jQuery Migrate versions can be used with which jQuery versions:
1313

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> |
14+
| jQuery version | jQuery Migrate version |
15+
|----------------|------------------------|
16+
| 1.x | 1.x |
17+
| 2.x | 1.x |
18+
| 3.x | 3.x |
19+
| 4.x | 4.x |
2020

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.
21+
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.
2222

2323
## Usage
2424

@@ -40,7 +40,7 @@ The production build is minified and does not generate console warnings. It will
4040
| Debugging enabled | <p align="center">✓</p> | |
4141
| Minified | | <p align="center">✓</p> |
4242
| 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) |
43-
| \* 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) |
43+
| \* 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) |
4444

4545

4646
\* **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.
@@ -50,7 +50,7 @@ The production build is minified and does not generate console warnings. It will
5050

5151
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.
5252

53-
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).
53+
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).
5454

5555

5656
## Migrate Plugin API
@@ -69,7 +69,7 @@ This plugin adds some properties to the `jQuery` object that can be used to prog
6969

7070
`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.
7171

72-
`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.
72+
`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.
7373

7474
`jQuery.migrateDisablePatches`: Disables patches by their codes.
7575

build/release.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var releaseVersion,
2222
prompt = enquirer.prompt,
2323

2424
repoURL = "[email protected]:jquery/jquery-migrate.git",
25-
branch = "main",
25+
branch = "3.x-stable",
2626

2727
// Windows needs the .cmd version but will find the non-.cmd
2828
// On Windows, also ensure the HOME environment variable is set
@@ -211,7 +211,7 @@ async function publishToNPM( next ) {
211211

212212
function setNextVersion( next ) {
213213
updateSourceVersion( nextVersion );
214-
updatePackageVersion( nextVersion, "main" );
214+
updatePackageVersion( nextVersion, "3.x-stable" );
215215
git( [ "commit", "-a", "--no-verify", "-m", "Updating the source version to " + nextVersion ],
216216
next );
217217
}
@@ -281,7 +281,7 @@ function updateReadmeVersion() {
281281
}
282282

283283
function setBlobVersion( s, v ) {
284-
return s.replace( /\/blob\/(?:(\d+\.\d+[^\/]+)|main)/, "/blob/" + v );
284+
return s.replace( /\/blob\/(?:(\d+\.\d+[^\/]+)|3.x-stable)/, "/blob/" + v );
285285
}
286286

287287
function writeJsonSync( fname, json ) {

jtr-3.x.yml jtr-ci.yml

File renamed without changes.

jtr-local.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ version: 1
22

33
flags:
44
jquery:
5-
- git
6-
- git.min
7-
- git.slim
8-
- git.slim.min
95
- 3.x-git
106
- 3.x-git.min
117
- 3.x-git.slim
@@ -18,6 +14,7 @@ flags:
1814
- 3.3.1
1915
- 3.2.1
2016
- 3.1.1
17+
- 3.1.1.slim
2118
- 3.0.0
2219

2320
retries: 1

package-lock.json

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jquery-migrate",
33
"title": "jQuery Migrate",
4-
"description": "Migrate older jQuery code to jQuery 3.0+",
4+
"description": "Migrate older jQuery code to jQuery 3.x",
55
"main": "dist/jquery-migrate.js",
66
"version": "3.5.3-pre",
77
"type": "module",

0 commit comments

Comments
 (0)