Skip to content

Commit b9d7458

Browse files
authored
Core: Prepare for Migrate 4.0.0
Changes: * Core: Remove support for jQuery 3.x * Core: Remove patches for breaking changes in jQuery 3.0.0 or older The `self-closed-tags` patch remains, despite being a breaking change in jQuery 3.5.0, not 4.0.0. There are a few reasons for that: 1. It's an exception that a breaking change arrived in a non-major version bump. Some people may be upgrading from jQuery 3.4.0 or older and it's good to make it work for them. 2. The patch is disabled by default, so the concern of people on newer jQuery 3.x upgrading to jQuery 4.x with Migrate 4.x getting patches restoring behavior from an version older than the pre-upgrade one does not exist. 3. This was a pretty big break, it may help people update if we still support it. * Core: Don't reimplement deprecated but not removed APIs This will save space and avoid potential divergence from Core. Also, simplify the `deferred.pipe` patch. * Core: Use `console.info` for deprecations without removals. Also: 1. Group `warnings.md` by this type. 2. Rename `jQuery.migrateWarnings` to `jQuery.migrateMessages`. 3. Rename `jQuery.migrateDeduplicateWarnings` to `jQuery.migrateDeduplicateMessages`. 4. Adding "info" versions of some internal APIs. * Core: Update the package.json description Indicate this version of Migrate helps with updating jQuery to 4.x, not 3.0+. * Docs: Link to jQuery Browser Support page in README.md Also, remove info about poor console support in IE 9; this version of Migrate doesn't support it anyway. Fixes gh-472 Closes gh-555
1 parent a92442f commit b9d7458

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4373
-5168
lines changed

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

-84
This file was deleted.

.github/workflows/browserstack-git.yml .github/workflows/browserstack.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Browserstack (Core git)
1+
name: Browserstack
22

33
on:
44
push:
@@ -63,6 +63,6 @@ jobs:
6363

6464
- name: Test
6565
run: |
66-
npm run test:unit -- -v -c jtr-git.yml \
66+
npm run test:unit -- -v -c jtr-ci.yml \
6767
--browserstack "${{ matrix.BROWSER }}" \
6868
--run-id ${{ github.run_id }} \

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -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

@@ -48,7 +48,7 @@ The production build is minified and does not generate console warnings. It will
4848

4949
## Debugging
5050

51-
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.
51+
The development version of the plugin displays warnings in the browser console. Developers can also inspect the `jQuery.migrateMessages` array to see what error messages have been generated.
5252

5353
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).
5454

@@ -57,17 +57,17 @@ All warnings generated by this plugin start with the string "JQMIGRATE". A list
5757

5858
This plugin adds some properties to the `jQuery` object that can be used to programmatically control and examine its behavior:
5959

60-
`jQuery.migrateWarnings`: This property is an array of string warning messages that have been generated by the code on the page, in the order they were generated. Messages appear in the array only once, even if the condition has occurred multiple times, unless `jQuery.migrateReset()` is called.
60+
`jQuery.migrateMessages`: This property is an array of string warning messages that have been generated by the code on the page, in the order they were generated. Messages appear in the array only once, even if the condition has occurred multiple times, unless `jQuery.migrateReset()` is called.
6161

62-
`jQuery.migrateMute`: Set this property to `true` to prevent console warnings from being generated in the development version. The `jQuery.migrateWarnings` array is still maintained when this property is set, which allows programmatic inspection without console output.
62+
`jQuery.migrateMute`: Set this property to `true` to prevent console warnings from being generated in the development version. The `jQuery.migrateMessages` array is still maintained when this property is set, which allows programmatic inspection without console output.
6363

6464
`jQuery.migrateTrace`: Set this property to `false` if you want warnings but do not want stack traces to appear on the console.
6565

66-
`jQuery.migrateReset()`: This method clears the `jQuery.migrateWarnings` array and "forgets" the list of messages that have been seen already.
66+
`jQuery.migrateReset()`: This method clears the `jQuery.migrateMessages` array and "forgets" the list of messages that have been seen already.
6767

6868
`jQuery.migrateVersion`: This string property indicates the version of Migrate in use.
6969

70-
`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.
70+
`jQuery.migrateDeduplicateMessages`: 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

7272
`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.
7373

build/tasks/minify.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,10 @@ export async function minify( { dir, filename, version } ) {
3434
{
3535
compress: {
3636
hoist_funs: false,
37-
loops: false,
38-
39-
// Support: IE <11
40-
// typeofs transformation is unsafe for IE9-10
41-
// See https://github.com/mishoo/UglifyJS2/issues/2198
42-
typeofs: false
37+
loops: false
4338
},
4439
output: {
4540
ascii_only: true,
46-
47-
// Support: Android 4.0 only, IE 9 only
48-
// This is in lieu of setting ie for all of mangle, compress, and output
49-
ie8: true,
5041
preamble: banner
5142
},
5243
sourceMap: {

eslint.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ export default [
9999
QUnit: false,
100100
sinon: false,
101101
url: false,
102-
expectWarning: false,
103-
expectNoWarning: false,
102+
expectMessage: false,
103+
expectNoMessage: false,
104104
compareVersions: false,
105105
jQueryVersionSince: false,
106106
startIframeTest: false,
@@ -132,8 +132,8 @@ export default [
132132
url: true,
133133
compareVersions: true,
134134
jQueryVersionSince: false,
135-
expectWarning: true,
136-
expectNoWarning: true,
135+
expectMessage: true,
136+
expectNoMessage: true,
137137
startIframeTest: true,
138138
TestManager: true
139139
}

jtr-3.x.yml

-30
This file was deleted.

jtr-git.yml jtr-ci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ runs:
66
- git.min
77
- git.slim
88
- git.slim.min
9+
- 4.0.0-beta.2
10+
- 4.0.0-beta.2.slim
911
plugin:
1012
- dev
1113
- min

jtr-local.yml

+2-13
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,7 @@ flags:
66
- git.min
77
- git.slim
88
- git.slim.min
9-
- 3.x-git
10-
- 3.x-git.min
11-
- 3.x-git.slim
12-
- 3.x-git.slim.min
13-
- 3.7.1
14-
- 3.7.1.slim
15-
- 3.6.4
16-
- 3.5.1
17-
- 3.4.1
18-
- 3.3.1
19-
- 3.2.1
20-
- 3.1.1
21-
- 3.0.0
9+
- 4.0.0-beta.2
10+
- 4.0.0-beta.2.slim
2211

2312
retries: 1

package-lock.json

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

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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 4.x",
55
"main": "dist/jquery-migrate.js",
6-
"version": "3.5.3-pre",
6+
"version": "4.0.0-pre",
77
"type": "module",
88
"homepage": "https://github.com/jquery/jquery-migrate",
99
"author": {
@@ -34,7 +34,7 @@
3434
"test": "npm run test:node_smoke_tests && npm run test:browser"
3535
},
3636
"peerDependencies": {
37-
"jquery": ">=3 <4"
37+
"jquery": ">=4 <5"
3838
},
3939
"devDependencies": {
4040
"chalk": "5.4.1",
@@ -45,7 +45,7 @@
4545
"eslint-plugin-import": "2.29.1",
4646
"globals": "15.3.0",
4747
"husky": "9.0.11",
48-
"jquery": "3.7.1",
48+
"jquery": "4.0.0-beta.2",
4949
"jquery-test-runner": "0.2.1",
5050
"jsdom": "24.1.0",
5151
"native-promise-only": "0.8.1",

0 commit comments

Comments
 (0)