Skip to content

Commit

Permalink
Core: Drop support for IE <11, iOS <10, Android Browser & PhantomJS
Browse files Browse the repository at this point in the history
Also, update support comments format to match format described in:
jquery/contribute.jquery.org#95 (comment)
with the change from:
jquery/contribute.jquery.org#95 (comment)
(open-ended ranges end with `+`).

Further size reductions will be achieved when we drop Firefox 60, iOS 10
and pre-Chromium Edge versions.

Fixes jquerygh-3950
Fixes jquerygh-4299
  • Loading branch information
mgol committed Apr 23, 2019
1 parent b8d4712 commit 6cc67b6
Show file tree
Hide file tree
Showing 66 changed files with 536 additions and 1,256 deletions.
5 changes: 1 addition & 4 deletions .eslintrc-browser.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@

"extends": "jquery",

// Support: IE <=9 only, Android <=4.0 only
// The above browsers are failing a lot of tests in the ES5
// test suite at http://test262.ecmascript.org.
"parserOptions": {
"ecmaVersion": 3
"ecmaVersion": 5
},

// The browser env is not enabled on purpose so that code takes
Expand Down
43 changes: 7 additions & 36 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,7 @@ module.exports = function( grunt ) {

var fs = require( "fs" ),
gzip = require( "gzip-js" ),
isTravis = process.env.TRAVIS,
oldNode = /^v6\./.test( process.version );

// Support: Node.js <8
// Skip running tasks that dropped support for Node.js 6
// in those Node versions.
function runIfNewNode( task ) {
return oldNode ? "print_old_node_message:" + task : task;
}
isTravis = process.env.TRAVIS;

if ( !grunt.option( "filename" ) ) {
grunt.option( "filename", "jquery.js" );
Expand Down Expand Up @@ -123,10 +115,9 @@ module.exports = function( grunt ) {
testswarm: {
tests: [

// A special module with basic tests, meant for
// not fully supported environments like Android 2.3,
// jsdom or PhantomJS. We run it everywhere, though,
// to make sure tests are not broken.
// A special module with basic tests, meant for not fully
// supported environments like jsdom. We run it everywhere,
// though, to make sure tests are not broken.
"basic",

"ajax",
Expand Down Expand Up @@ -291,23 +282,13 @@ module.exports = function( grunt ) {
"dist/<%= grunt.option('filename').replace('.js', '.min.map') %>",
report: "min",
output: {
"ascii_only": true,

// Support: Android 4.0 only
// UglifyJS 3 breaks Android 4.0 if this option is not enabled.
// This is in lieu of setting ie8 for all of mangle, compress, and output
"ie8": true
"ascii_only": true
},
banner: "/*! jQuery v<%= pkg.version %> | " +
"(c) JS Foundation and other contributors | jquery.org/license */",
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
}
}
}
Expand All @@ -320,13 +301,6 @@ module.exports = function( grunt ) {
// Integrate jQuery specific tasks
grunt.loadTasks( "build/tasks" );

// Support: Node.js <8
// Print a message on Node.js <8 notifying the task is skipped there.
grunt.registerTask( "print_old_node_message", function() {
var task = [].slice.call( arguments ).join( ":" );
grunt.log.writeln( "Old Node.js detected, running the task \"" + task + "\" skipped..." );
} );

grunt.registerTask( "lint", [
"jsonlint",

Expand All @@ -349,10 +323,7 @@ module.exports = function( grunt ) {
grunt.registerTask( "test:fast", "node_smoke_tests" );
grunt.registerTask( "test:slow", [
"promises_aplus_tests",

// Support: Node.js <8
// Karma no longer supports Node.js <8 as it relies on async-await internally.
runIfNewNode( "karma:jsdom" )
"karma:jsdom"
] );

grunt.registerTask( "test", [
Expand Down
11 changes: 5 additions & 6 deletions src/ajax.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
define( [
"./core",
"./var/document",
"./var/isFunction",
"./var/rnothtmlwhite",
"./ajax/var/location",
"./ajax/var/nonce",
Expand All @@ -12,7 +11,7 @@ define( [
"./event/trigger",
"./deferred",
"./serialize" // jQuery.param
], function( jQuery, document, isFunction, rnothtmlwhite, location, nonce, rquery ) {
], function( jQuery, document, rnothtmlwhite, location, nonce, rquery ) {

"use strict";

Expand Down Expand Up @@ -67,7 +66,7 @@ function addToPrefiltersOrTransports( structure ) {
i = 0,
dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];

if ( isFunction( func ) ) {
if ( typeof func === "function" ) {

// For each dataType in the dataTypeExpression
while ( ( dataType = dataTypes[ i++ ] ) ) {
Expand Down Expand Up @@ -541,13 +540,13 @@ jQuery.extend( {
if ( s.crossDomain == null ) {
urlAnchor = document.createElement( "a" );

// Support: IE <=8 - 11, Edge 12 - 15
// Support: IE <=8 - 11+, Edge 12 - 17 only
// IE throws exception on accessing the href property if url is malformed,
// e.g. http://example.com:80x/
try {
urlAnchor.href = s.url;

// Support: IE <=8 - 11 only
// Support: IE <=8 - 11+
// Anchor's host property isn't correctly set when s.url is relative
urlAnchor.href = urlAnchor.href;
s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
Expand Down Expand Up @@ -837,7 +836,7 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
jQuery[ method ] = function( url, data, callback, type ) {

// Shift arguments if data argument was omitted
if ( isFunction( data ) ) {
if ( typeof data === "function" ) {
type = type || callback;
callback = data;
data = undefined;
Expand Down
7 changes: 3 additions & 4 deletions src/ajax/jsonp.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
define( [
"../core",
"../var/isFunction",
"./var/nonce",
"./var/rquery",
"../ajax"
], function( jQuery, isFunction, nonce, rquery ) {
], function( jQuery, nonce, rquery ) {

"use strict";

Expand Down Expand Up @@ -37,7 +36,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {

// Get callback name, remembering preexisting value associated with it
callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
callbackName = s.jsonpCallback = typeof s.jsonpCallback === "function" ?
s.jsonpCallback() :
s.jsonpCallback;

Expand Down Expand Up @@ -88,7 +87,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
}

// Call if it was a function and we have a response
if ( responseContainer && isFunction( overwritten ) ) {
if ( responseContainer && typeof overwritten === "function" ) {
overwritten( responseContainer[ 0 ] );
}

Expand Down
5 changes: 2 additions & 3 deletions src/ajax/load.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
define( [
"../core",
"../core/stripAndCollapse",
"../var/isFunction",
"../core/parseHTML",
"../ajax",
"../traversing",
"../manipulation",
"../selector"
], function( jQuery, stripAndCollapse, isFunction ) {
], function( jQuery, stripAndCollapse ) {

"use strict";

Expand All @@ -25,7 +24,7 @@ jQuery.fn.load = function( url, params, callback ) {
}

// If it's a function
if ( isFunction( params ) ) {
if ( typeof params === "function" ) {

// We assume that it's the callback
callback = params;
Expand Down
2 changes: 1 addition & 1 deletion src/ajax/parseXML.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jQuery.parseXML = function( data ) {
return null;
}

// Support: IE 9 - 11 only
// Support: IE 9 - 11+
// IE throws on parseFromString with invalid input.
try {
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
Expand Down
Loading

0 comments on commit 6cc67b6

Please sign in to comment.