- Notifications
You must be signed in to change notification settings - Fork20.6k
Core: Drop support for IE <11, iOS <11, Firefox <65, Android Browser & PhantomJS#4347
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ba2c346
to108d0a0
Comparemgol commentedApr 10, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I recommend reviewing with whitespace changes ignored (e.g. viaadding A few open questions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👏 👏
}, | ||
xhrSupported = jQuery.ajaxSettings.xhr(); | ||
support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The scenarios where I've ever seen this used arejQuery.support.cors = true
, that is, just setting the value. I wonder if there are a lot of cases where people check to see if it'strue
in their own code? If so it might be safest to set it totrue
here. Here's an example of some code that would break if we didn't:victorquinn/Backbone.CrossDomain#1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I guess we could add a line with:
jQuery.support.ajax = jQuery.support.cors = true;
todeprecated.js
and add a warning to Migrate for code accessing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It's mainly useful of you want to gracefully degrade and/or fail in browsers without cors which will be none with the new support list. I think it would be better to keep it set to true for a good while indeprecated.js
before removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We could also have Migrate fill in those properties as it's easy to do from outside. Technically speaking, external access tojQuery.support
has never been supported.
mgol commentedApr 10, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
BTW, dropping support for iOS 10 & Firefox 60 (which we'll most likely do before the 4.0 release as we'll drop them around September/October) will cause a further reduction by -272 bytes, getting us to -812 bytes compared to |
3f6f9ea
to40567ca
ComparePer the discussion at the today's meeting, I changed the format of IE support comments from: // Support: IE <=9 - 11 only to: // Support: IE <=9 - 11+ |
I added one more commit removing IE 9-related code from This removal saved additional |
@jquery/core I've been thinking that maybe we should just drop Firefox 60 & iOS 10 in this PR as well. We'll do that anyway in October and it's not very likely we'll release 4.0 before that date. Especially dropping iOS 10 would give us a lot - it has a partially broken module support, early versions had partially broken Shadow DOM support, etc. Dropping it would help not only with library size but also it'd be easier to do all the upcoming major changes like the event system refactor, getting rid of Sizzle etc. if we didn't have to care about iOS 10 and breaking any of current workarounds targeted at it. If, by any chance, we manage to land all those major changes, release an alpha/beta & then stable before we'd normally drop Firefox 60/iOS 10 (not very likely, IMO), we can always update the browser support page for jQuery 4.0 to state explicitly we don't support those browsers. We could later remove that note once they'd be out of our supported browser range anyway. I already have relevant changes ready atmgol@724f955, I could just merge it to this PR. What do you think? |
I agree on the timeline, it seems likely that 4.0.0 could wait for those older browsers to drop below the threshold where we'd need to support them. It definitely cleans up some things! |
074a326
toee2fc25
Comparemgol commentedApr 24, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
New changes LGTM
documentElement.mozMatchesSelector || | ||
documentElement.oMatchesSelector || | ||
documentElement.msMatchesSelector, | ||
matches = documentElement.matches || documentElement.msMatchesSelector, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This could use a// Support
comment since thems
version should go away when we get a Chromium Edge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Good point about a support comment but it won’t go away as IE needs it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Comment added. I only mentioned IE as Edge doesn't need it since 4 versions already.
…& PhantomJSAlso, 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 `+`).Fixesjquerygh-3950Fixesjquerygh-4299
@@ -172,9 +150,6 @@ function domManip( collection, args, callback, ignored ) { | |||
// Keep references to cloned scripts for later restoration | |||
if ( hasScripts ) { | |||
// Support: Android <=4.0 only, PhantomJS 1 only | |||
// push.apply(_, arraylike) throws on ancient WebKit | |||
jQuery.merge( scripts, getAll( node, "script" ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@mgol I was just going back over this PR and wondering about the loss of context here and before otherjQuery.merge
calls...should we switch this topush.apply( scripts, getAll( node, "script" ) )
or have a comment explaining why it avoids that pattern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Right... We no longer care about Android 4.0 or PhantomJS 1 but I remember using thepush.apply
approach may lead to issues like#4320. Perhaps a comment to that effect would be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I created#5298 to track this & other related uses ofpush.apply
vs.jQuery.merge
to consider.
@@ -475,9 +456,6 @@ jQuery.each( { | |||
for ( ; i <= last; i++ ) { | |||
elems = i === last ? this : this.clone( true ); | |||
jQuery( insert[ i ] )[ original ]( elems ); | |||
// Support: Android <=4.0 only, PhantomJS 1 only | |||
// .get() because push.apply(_, arraylike) throws on ancient WebKit | |||
push.apply( ret, elems.get() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Here too; why isn't thispush.apply( ret, elems )
?
A leftover `rboxStyle` was left in the wrapper parameters but not in thedependency array, causing `getStyles` to be undefined in AMD mode.Since `rboxStyle` is no longer used, it's now removed.Refjquerygh-4347
Previously, jQuery.ajaxSettings.xhr, contents were wrapped in a try-catchas we defined jQuery.support.ajax & jQuery.support.cors executed during thejQuery load and we didn't want to crash if IE had native XHR disabled (whichis possible). While jQuery hasn't supported the ActiveX-based XHR since 2.0,jQuery with XHR disabled could still be used for its other features in sucha crippled browser.Sincejquerygh-4347, jQuery.support.ajax & jQuery.support.cors no longer exist, sowe don't need the try-catch anymore.Fixesjquerygh-1967Refjquerygh-4347
Previously, jQuery.ajaxSettings.xhr, contents were wrapped in a try-catchas we defined jQuery.support.ajax & jQuery.support.cors executed during thejQuery load and we didn't want to crash if IE had native XHR disabled (whichis possible). While jQuery hasn't supported the ActiveX-based XHR since 2.0,jQuery with XHR disabled could still be used for its other features in sucha crippled browser.Sincejquerygh-4347, jQuery.support.ajax & jQuery.support.cors no longer exist, sowe don't need the try-catch anymore.Fixesjquerygh-1967Refjquerygh-4347
Previously, jQuery.ajaxSettings.xhr, contents were wrapped in a try-catchas we defined jQuery.support.ajax & jQuery.support.cors executed during thejQuery load and we didn't want to crash if IE had native XHR disabled (whichis possible). While jQuery hasn't supported the ActiveX-based XHR since 2.0,jQuery with XHR disabled could still be used for its other features in sucha crippled browser.Sincegh-4347, jQuery.support.ajax & jQuery.support.cors no longer exist, sowe don't need the try-catch anymore.Fixesgh-1967Closesgh-4467Refgh-4347
Uh oh!
There was an error while loading.Please reload this page.
Summary
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.
Fixesgh-3950
Fixesgh-4299
Checklist
New tests have been added to show the fix or feature worksIf needed, a docs issue/PR was created athttps://github.com/jquery/api.jquery.com