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

Update jQuery to v2 for browsers it supports #1353

Closed
wants to merge 1 commit into from

Conversation

davidmurdoch
Copy link

This also adds an IE conditional comment fallback to jQuery 1.9.1 for old IE.

Add conditional comment fallback to jQuery 1.9.1 for old IE.
@d8uv
Copy link

d8uv commented Apr 23, 2013

Modern (Non-IE and IE10) browsers don't use IE's conditional comments, so the jQuery include for 1.9 is commented out, leaving jQuery 2.0.

@FagnerMartinsBrack
Copy link
Contributor

That's a good one

@necolas
Copy link
Member

necolas commented Apr 24, 2013

Going to pass on this. I don't think the extra code, maintenance, or potential for discrepancies between versions is worth it. Thanks though.

@necolas necolas closed this Apr 24, 2013
@davidmurdoch
Copy link
Author

FYI: This method was recommended by the jQuery team: http://blog.jquery.com/2013/03/01/jquery-2-0-beta-2-released/

RE: discrepancies
jQuery stated in their latest blog post that "In keeping with our pledge to minimize API divergence between the 1.x and 2.x branches, we’ll be releasing a jQuery 1.10 within a couple of months that incorporates the bug fixes and differences reported from both the 1.9 and 2.0 beta cycles." and "jQuery 2.0 is API-compatible with 1.9".

Hopefully that should help ease concerns over the potential for discrepancies.

RE: extra code
The extra code only adds ~38 bytes (gzipped); jQuery 2.0 saves ~3960 gzipped bytes, for supported browsers. Now I know that jQuery will be cached, so it is a one time cost, whereas the HTML isn't, however, it will still take about 100 pages loads to cancel out those byte savings (and even more if users replace the 2.0 code with a custom build!). :-)

RE: maintenance
:-/

@mathiasbynens
Copy link
Member

@necolas, any chance you’d reconsider this? My vote is to pull this in and have this pattern in the final HTML5 Boilerplate release to support oldIE.

We’ll remove the code anyway as soon as we drop oldIE support in HTML5 Boilerplate.

@roblarsen
Copy link
Member

I'm with @mathiasbynens I think this is a good idea with very little negative.

Plus, we all know that the jQuery version updates are handled by people looking for easy GitHub cred anyway :)

@necolas
Copy link
Member

necolas commented Apr 25, 2013

@mathiasbynens v5.0.0 will still support IE 8. I just don't think the idea of debugging 2 different versions of the library, even if the jQuery team hope to keep them as close as possible.

@asuh
Copy link

asuh commented Apr 25, 2013

@necolas You could go with two concurrent branches of H5Bp with the current version being standard and the 2.0 version being in its own branch. I'm sure its kinda a pain but I bet there's many devs who would be just as eager to have this project with no oldIE support at all.

@davidmurdoch
Copy link
Author

@Roblarson, I know you were just joking with that comment, but even the small/easy contributions are important, especially so for the new githubber or programmer needing to get their feet wet before jumping in.

After re-reading the latest blog post I'm not too sure jQuery itself is confident in the parity between 1.9.1 and 2.0.0:

we’ll be releasing a jQuery 1.10 within a couple of months that incorporates the bug fixes and differences reported from both the 1.9 and 2.0 beta cycles.

Hm. I may have pulled (git it? heh, I'm on a roll) the trigger on this too soon. It may be better to wait until they release v1.10.0?


On another note: from what I understand, the code paths taken by modern browsers in 2.0 shouldn't differ that much from what they'd have taken in 1.9.1; essentially: jQuery 2.0 = jQuery 1.9.1 - oldIE. I know 2.0 is much more than that, but a good chunk of the code is still the same.


Maybe @dmethvin can provide some further insight and perhaps a recommendation? :-)

@dmethvin
Copy link

I would stay with the 1.x line until h5bp wants to drop support for old IE. Although the conditional comment approach lets you use 2.x for some browsers, it does introduce the possibility of version differences and most people won't be testing well enough to find them. During the 2.0 beta we've seen that although we have really tried to keep the documented APIs in sync, there are undocumented behaviors that some people depend on that may be different.

At some point h5bp can switch to 2.x and add a note that anyone needing to support old IE should switch back to 1.x themselves.

@roblarsen
Copy link
Member

@davidmurdoch I was joking in the context of the maintenance issue on this project, since maintenance hers goes beyond just the revving of version numbers, but I definitely appreciate the value that commits like that bring to both the project and to the individual contributors. It can be a very cool thing for people to get their first commit on a big project. I wasn't diminishing those contributions at all. Every bit helps.

@davidmurdoch
Copy link
Author

Thanks, @dmethvin, super helpful as usual.

I think that puts the final nail in the coffin, at least for a couple years. I'll try to work this discussion into the H5BP Wiki sometime in the next week, maybe in a new page in the JavaScript section?

@ChrisWojcik
Copy link

If your codebase might need to be at all different depending on which branch of jQuery is being used, I think that argues conclusively for determining browser support requirements up front and just using the one version you want.

@necolas
Copy link
Member

necolas commented Apr 25, 2013

Thanks for all the follow up details. These sorts of things are always a bit tricky; it's unfortunate that IE 8 is hanging on and looks like it will be around for a while longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants