Skip to content

no ticket: scorch the earth and retreat on readyState interactive #907

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

Closed
wants to merge 1 commit into from

Conversation

mikesherov
Copy link
Member

well, it was a fun experiment...

Running "compare_size:files" (compare_size) task
Sizes - compared to master
    258456       (-61)  dist/jquery.js                                         
     92553       (-39)  dist/jquery.min.js                                     
     33118       (-13)  dist/jquery.min.js.gz  

@dmethvin dmethvin closed this in a9c2a9b Aug 24, 2012
@rwaldron
Copy link
Member

@dmethvin
Copy link
Member

Yeah, i think of that guy from time to time. 😭

@mikesherov
Copy link
Member Author

Come now, Rick. You can't be suggesting that it wasn't worth investigating. The user had provided clear cases where interactive solved a real world problem. I even believe we could have kept this in and ultimately would've been ok and gotten some benefit. It even lead @dmethvin And I to discover some other bugs that will be affecting users when IE10 comes out, so it's not a complete wash. Also, I learned exactly what conditions IE fails on interactive that we can bring forth to Microsoft. Perhaps I need to learn to be less willing to unleash experiments to users, but I stand by the idea that jQuery should be exploring these things, but perhaps without the same gusto I put forth.

Science does not forward without heaps. - Hubert Farnsworth

@rwaldron
Copy link
Member

@mikesherov <3

@mikesherov
Copy link
Member Author

Group hug!

@dmethvin
Copy link
Member

Yeah, I'm not bugged by it. It's funny that we all were negative-to-meh on it originally, when you look back through the thread.

@mikesherov
Copy link
Member Author

1.8 Vote: 3 Yes 1 No 2 Abstain

@mikesherov
Copy link
Member Author

The sole no? ME

@vadimzak
Copy link

vadimzak commented Apr 7, 2013

Can anyone explain why was pull#901 retreated?
I'm using a similar code and would really like to know if there is a a problem with it,
Thanks!

@mikesherov
Copy link
Member Author

@vadimzak
Copy link

vadimzak commented Apr 7, 2013

Thanks @mikesherov,
But if I understand correctly, comment #15 (and below) state that only IE has the premature .readyState == "interactive" problem, so what was wrong with the old "(doc.attachEvent ? doc.readyState == 'complete' : doc.readyState != 'loading')" line? it should have made all IE versions wait for 'complete' and all other sane browsers wait only for 'loading' and thus fire as early as possible, am I wrong?

@FagnerMartinsBrack
Copy link

@vadimzak
Isn't your example the same as browser sniffing? You are relying in a browser's different behavior to test another completely not related oO
That could be the reason they don't use this code...

@vadimzak
Copy link

vadimzak commented Apr 7, 2013

It is a valid assumption @FagnerMartinsBrack, but in the same DomReady-related code you can find attempts to catch scrolling exceptions (or the lack of them) to detect when some versions of IE have loaded the DOM,
So I don't believe browser sniffing should be an absolute taboo, especially if it is the only way to get the required result.

I was wondering if the development team actually found cases where the previous version (before this fix) did not perform as expected, and if so - couldn't some browser-sniffing be used to make the event better (fire earlyer) on non-IE browsers?

@mikesherov
Copy link
Member Author

@vadimzak, sure. At the time, we weren't really ready for it, and we had also made changes to allow $(document).ready() to be a true deferred... that is it could execute synchronously.

In practice, $(document).ready() was always async because of the order in which the events fired, and when we switched to readyState !== "loading" there were cases where it would execute synchronously, throwing off developer expectations.

At this point, we could probably try again, and it's probably safe in your own code, it just wasn't ready to be deployed to 60% of the internet ;-)

@dmethvin
Copy link
Member

dmethvin commented Apr 8, 2013

I don't see any reward for this risk, we tried it once and it was a mess. Let's see some proof that firing this event earlier leads to faster pages, and that it doesn't cause messy regressions. I just had to deal with chasing this problem down for a client a month ago, they were using 1.8.0 and this was causing all kinds of strange behaviors.

@skaurus
Copy link

skaurus commented Apr 16, 2013

Whoa, a lot happened with my bug. Or "bug". I'm sorry guys, couldn't have foreseen that.

On the other side, right now I'm waiting for 10 minutes for document.ready due to ever loading iframe (it isn't crafted or special in any way, that just happens from time to time in FF and Opera).

Looks like I'm going back to manual check for "interactive".
Sorry again.

mescoda pushed a commit to mescoda/jquery that referenced this pull request Nov 4, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants