Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Prepare for Migrate 4.0.0 #555

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/workflows/browser-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ jobs:
npm run test:unit -- -b ${{ matrix.BROWSER }} -h \
--jquery-migrate ${{ matrix.MIGRATE_VERSION }} \
--jquery git --jquery git.min --jquery git.slim --jquery git.slim.min \
--jquery 3.x-git --jquery 3.x-git.min --jquery 3.x-git.slim --jquery 3.x-git.slim.min \
--jquery 3.7.1 --jquery 3.7.1.slim \
--jquery 3.6.4 --jquery 3.5.1 --jquery 3.4.1 \
--jquery 3.3.1 --jquery 3.2.1 --jquery 3.1.1 --jquery 3.0.0 \
--retries 1

ie:
Expand Down Expand Up @@ -85,10 +81,6 @@ jobs:
npm run test:ie -- ^
--jquery-migrate ${{ env.MIGRATE_VERSION }} ^
--jquery git --jquery git.min --jquery git.slim --jquery git.slim.min ^
--jquery 3.x-git --jquery 3.x-git.min --jquery 3.x-git.slim --jquery 3.x-git.slim.min ^
--jquery 3.7.1 --jquery 3.7.1.slim ^
--jquery 3.6.4 --jquery 3.5.1 --jquery 3.4.1 ^
--jquery 3.3.1 --jquery 3.2.1 --jquery 3.1.1 --jquery 3.0.0 ^
--retries 1

safari:
Expand Down Expand Up @@ -121,8 +113,4 @@ jobs:
npm run test:safari -- \
--jquery-migrate ${{ env.MIGRATE_VERSION }} \
--jquery git --jquery git.min --jquery git.slim --jquery git.slim.min \
--jquery 3.x-git --jquery 3.x-git.min --jquery 3.x-git.slim --jquery 3.x-git.slim.min \
--jquery 3.7.1 --jquery 3.7.1.slim \
--jquery 3.6.4 --jquery 3.5.1 --jquery 3.4.1 \
--jquery 3.3.1 --jquery 3.2.1 --jquery 3.1.1 --jquery 3.0.0 \
--retries 1
91 changes: 0 additions & 91 deletions .github/workflows/browserstack-3.x.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Browserstack (Core git)
name: Browserstack

on:
push:
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ That way you can spot and fix what otherwise would have been errors, until you n

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> |
| jQuery version | jQuery Migrate version |
|----------------|------------------------|
| 1.x | 1.x |
| 2.x | 1.x |
| 3.x | 3.x |
| 4.x | 4.x |

[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.
Each jQuery Migrate version supports the same browsers that the jQuery version used with it.

## Usage

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

## Debugging

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.
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.migrateMessages` 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).

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

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

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

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

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

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

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

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

Expand Down
11 changes: 1 addition & 10 deletions build/tasks/minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,10 @@ export async function minify( { dir, filename, version } ) {
{
compress: {
hoist_funs: false,
loops: false,

// Support: IE <11
// typeofs transformation is unsafe for IE9-10
// See https://github.com/mishoo/UglifyJS2/issues/2198
typeofs: false
loops: false
},
output: {
ascii_only: true,

// Support: Android 4.0 only, IE 9 only
// This is in lieu of setting ie for all of mangle, compress, and output
ie8: true,
preamble: banner
},
sourceMap: {
Expand Down
8 changes: 4 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export default [
QUnit: false,
sinon: false,
url: false,
expectWarning: false,
expectNoWarning: false,
expectMessage: false,
expectNoMessage: false,
compareVersions: false,
jQueryVersionSince: false,
startIframeTest: false,
Expand Down Expand Up @@ -132,8 +132,8 @@ export default [
url: true,
compareVersions: true,
jQueryVersionSince: false,
expectWarning: true,
expectNoWarning: true,
expectMessage: true,
expectNoMessage: true,
startIframeTest: true,
TestManager: true
}
Expand Down
17 changes: 9 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "jQuery Migrate",
"description": "Migrate older jQuery code to jQuery 3.0+",
"main": "dist/jquery-migrate.js",
"version": "3.5.3-pre",
"version": "4.0.0-pre",
"type": "module",
"homepage": "https://github.com/jquery/jquery-migrate",
"author": {
Expand Down Expand Up @@ -34,7 +34,7 @@
"test": "npm run test:node_smoke_tests && npm run test:browser"
},
"peerDependencies": {
"jquery": ">=3 <4"
"jquery": ">=4 <5"
},
"devDependencies": {
"@types/selenium-webdriver": "4.1.22",
Expand All @@ -52,7 +52,7 @@
"express-body-parser-error-handler": "1.0.7",
"globals": "15.3.0",
"husky": "9.0.11",
"jquery": "3.7.1",
"jquery": "4.0.0-beta.2",
"jsdom": "24.1.0",
"native-promise-only": "0.8.1",
"qunit": "2.21.0",
Expand Down
Loading
Loading