From cd41c45d917d18839ab800816070db09a359d5bf Mon Sep 17 00:00:00 2001 From: Michał Gołębiowski-Owczarek Date: Tue, 30 Jul 2024 17:53:47 +0200 Subject: Tests: Update jQuery Migrate from 3.4.1 to 3.5.2, simplify Migrate setup Apart from updating jQuery Migrate, the setup is now changed so that exact Migrate versions are only references when fetching npm packages; other than that, they're represented as `jquery-migrate-1.x` & `jquery-migrate-3.x`. This will allow smaller changes when updating jQuery Migrate in the future. Closes gh-2273 --- Gruntfile.js | 12 +- bower.json | 4 +- external/jquery-migrate-1.4.1/LICENSE.txt | 36 - external/jquery-migrate-1.4.1/jquery-migrate.js | 752 ----------------- external/jquery-migrate-1.x/LICENSE.txt | 36 + external/jquery-migrate-1.x/jquery-migrate.js | 752 +++++++++++++++++ external/jquery-migrate-3.4.1/LICENSE.txt | 36 - external/jquery-migrate-3.4.1/jquery-migrate.js | 1018 ---------------------- external/jquery-migrate-3.x/LICENSE.txt | 36 + external/jquery-migrate-3.x/jquery-migrate.js | 1031 +++++++++++++++++++++++ tests/lib/bootstrap.js | 4 +- 11 files changed, 1865 insertions(+), 1852 deletions(-) delete mode 100644 external/jquery-migrate-1.4.1/LICENSE.txt delete mode 100644 external/jquery-migrate-1.4.1/jquery-migrate.js create mode 100644 external/jquery-migrate-1.x/LICENSE.txt create mode 100644 external/jquery-migrate-1.x/jquery-migrate.js delete mode 100644 external/jquery-migrate-3.4.1/LICENSE.txt delete mode 100644 external/jquery-migrate-3.4.1/jquery-migrate.js create mode 100644 external/jquery-migrate-3.x/LICENSE.txt create mode 100644 external/jquery-migrate-3.x/jquery-migrate.js diff --git a/Gruntfile.js b/Gruntfile.js index 05e83c961..334e4bb1a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -316,13 +316,13 @@ grunt.initConfig( { "jquery-3.7.1/jquery.js": "jquery-3.7.1/dist/jquery.js", "jquery-3.7.1/LICENSE.txt": "jquery-3.7.1/LICENSE.txt", - "jquery-migrate-1.4.1/jquery-migrate.js": - "jquery-migrate-1.4.1/dist/jquery-migrate.js", - "jquery-migrate-1.4.1/LICENSE.txt": "jquery-migrate-1.4.1/LICENSE.txt", + "jquery-migrate-1.x/jquery-migrate.js": + "jquery-migrate-1.x/dist/jquery-migrate.js", + "jquery-migrate-1.x/LICENSE.txt": "jquery-migrate-1.x/LICENSE.txt", - "jquery-migrate-3.4.1/jquery-migrate.js": - "jquery-migrate-3.4.1/dist/jquery-migrate.js", - "jquery-migrate-3.4.1/LICENSE.txt": "jquery-migrate-3.4.1/LICENSE.txt" + "jquery-migrate-3.x/jquery-migrate.js": + "jquery-migrate-3.x/dist/jquery-migrate.js", + "jquery-migrate-3.x/LICENSE.txt": "jquery-migrate-3.x/LICENSE.txt" } } }, diff --git a/bower.json b/bower.json index 1efb14ee2..eec454dea 100644 --- a/bower.json +++ b/bower.json @@ -38,7 +38,7 @@ "jquery-3.6.4": "jquery#3.6.4", "jquery-3.7.0": "jquery#3.7.0", "jquery-3.7.1": "jquery#3.7.1", - "jquery-migrate-1.4.1": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-1.4.1.tgz", - "jquery-migrate-3.4.1": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.4.1.tgz" + "jquery-migrate-1.x": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-1.4.1.tgz", + "jquery-migrate-3.x": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.5.2.tgz" } } diff --git a/external/jquery-migrate-1.4.1/LICENSE.txt b/external/jquery-migrate-1.4.1/LICENSE.txt deleted file mode 100644 index 9dfa07145..000000000 --- a/external/jquery-migrate-1.4.1/LICENSE.txt +++ /dev/null @@ -1,36 +0,0 @@ -Copyright jQuery Foundation and other contributors, https://jquery.org/ - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/jquery/jquery-migrate - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -All files located in the node_modules and external directories are -externally maintained libraries used by this software which have their -own licenses; we recommend you read them, as their terms may differ from -the terms above. diff --git a/external/jquery-migrate-1.4.1/jquery-migrate.js b/external/jquery-migrate-1.4.1/jquery-migrate.js deleted file mode 100644 index 89437ebed..000000000 --- a/external/jquery-migrate-1.4.1/jquery-migrate.js +++ /dev/null @@ -1,752 +0,0 @@ -/*! - * jQuery Migrate - v1.4.1 - 2016-05-19 - * Copyright jQuery Foundation and other contributors - */ -(function( jQuery, window, undefined ) { -// See http://bugs.jquery.com/ticket/13335 -// "use strict"; - - -jQuery.migrateVersion = "1.4.1"; - - -var warnedAbout = {}; - -// List of warnings already given; public read only -jQuery.migrateWarnings = []; - -// Set to true to prevent console output; migrateWarnings still maintained -// jQuery.migrateMute = false; - -// Show a message on the console so devs know we're active -if ( window.console && window.console.log ) { - window.console.log( "JQMIGRATE: Migrate is installed" + - ( jQuery.migrateMute ? "" : " with logging active" ) + - ", version " + jQuery.migrateVersion ); -} - -// Set to false to disable traces that appear with warnings -if ( jQuery.migrateTrace === undefined ) { - jQuery.migrateTrace = true; -} - -// Forget any warnings we've already given; public -jQuery.migrateReset = function() { - warnedAbout = {}; - jQuery.migrateWarnings.length = 0; -}; - -function migrateWarn( msg) { - var console = window.console; - if ( !warnedAbout[ msg ] ) { - warnedAbout[ msg ] = true; - jQuery.migrateWarnings.push( msg ); - if ( console && console.warn && !jQuery.migrateMute ) { - console.warn( "JQMIGRATE: " + msg ); - if ( jQuery.migrateTrace && console.trace ) { - console.trace(); - } - } - } -} - -function migrateWarnProp( obj, prop, value, msg ) { - if ( Object.defineProperty ) { - // On ES5 browsers (non-oldIE), warn if the code tries to get prop; - // allow property to be overwritten in case some other plugin wants it - try { - Object.defineProperty( obj, prop, { - configurable: true, - enumerable: true, - get: function() { - migrateWarn( msg ); - return value; - }, - set: function( newValue ) { - migrateWarn( msg ); - value = newValue; - } - }); - return; - } catch( err ) { - // IE8 is a dope about Object.defineProperty, can't warn there - } - } - - // Non-ES5 (or broken) browser; just set the property - jQuery._definePropertyBroken = true; - obj[ prop ] = value; -} - -if ( document.compatMode === "BackCompat" ) { - // jQuery has never supported or tested Quirks Mode - migrateWarn( "jQuery is not compatible with Quirks Mode" ); -} - - -var attrFn = jQuery( "", { size: 1 } ).attr("size") && jQuery.attrFn, - oldAttr = jQuery.attr, - valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get || - function() { return null; }, - valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set || - function() { return undefined; }, - rnoType = /^(?:input|button)$/i, - rnoAttrNodeType = /^[238]$/, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - ruseDefault = /^(?:checked|selected)$/i; - -// jQuery.attrFn -migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" ); - -jQuery.attr = function( elem, name, value, pass ) { - var lowerName = name.toLowerCase(), - nType = elem && elem.nodeType; - - if ( pass ) { - // Since pass is used internally, we only warn for new jQuery - // versions where there isn't a pass arg in the formal params - if ( oldAttr.length < 4 ) { - migrateWarn("jQuery.fn.attr( props, pass ) is deprecated"); - } - if ( elem && !rnoAttrNodeType.test( nType ) && - (attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) { - return jQuery( elem )[ name ]( value ); - } - } - - // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking - // for disconnected elements we don't warn on $( "