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

jQuery 2.1.1 #1303

Closed
chiplay opened this issue May 8, 2014 · 25 comments
Closed

jQuery 2.1.1 #1303

chiplay opened this issue May 8, 2014 · 25 comments

Comments

@chiplay
Copy link
Contributor

chiplay commented May 8, 2014

Needs a bower update for the latest version of jQuery.

Although I'm curious if hardcoding the range is the best way? Manually updating the bower file with each jQuery (backbone / underscore) release isn't the end of the world, and probably safest, but does bower support ranges for ~. Eg. ~1.8.0 - 2.1.0? We use ~1.0.0 format for most of our bower libs to avoid this issue, but never had to support a range.

@samccone
Copy link
Member

samccone commented May 8, 2014

@chiplay The reason we have a range is because people who have older versions of marionette who are depending on old IE support in the pre 2.x branch of jquery should not experience a break when they update versions of marionette. (i.e if they have jquery 1.8 ... bump marionette to 1.8.5 ... run bower install ... jquery will not be bumped unless they call bower update <--- breaking)

@jamesplease
Copy link
Member

@samccone I think the broader issue here is that our upper limit to the range is limiting. We aren't even getting bug fixes. We should investigate if we can / want to have two ranges (which I think requires the use of the || operator). Something like:

^1.8 || ~2.1

but not quite, because we would have a gap between 1.8 and 2.1.

@jamesplease jamesplease reopened this May 8, 2014
@jamiebuilds
Copy link
Member

Couldn't it just be "1.8.0 - 2.1.x"?

@Anachron
Copy link

Anachron commented May 8, 2014

@thejameskyle no, how is that possible? 1.9 will be the same like 2.2, which would be possible to break Marionette support. 1.x is IE6 stack, 2.x is up to date browser stack.

@jamiebuilds
Copy link
Member

@Anachron I don't see the problem. Our current bower version is "1.8.0 - 2.1.0". So "1.8.0 - 2.1.x" would just allow for jQuery 2.1 patches

@samccone
Copy link
Member

samccone commented May 8, 2014

ye old jquery wars

@Anachron
Copy link

Anachron commented May 8, 2014

@thejameskyle You are right! I think https://github.com/marionettejs/backbone.marionette/blob/master/bower.json#L42 should be

"jquery": "1.8.x || 2.1.x"

instead. You never know which update will break compatibility.

@jamesplease
Copy link
Member

I don't think we should use x...it pulls in unofficial releases (stuff after the hyphen)

@jamiebuilds
Copy link
Member

@Anachron I highly doubt jQuery is going to break compatibility in 1.0 above 1.8.0, since the API is the same in 2.0.0 and above (so far). My company also uses 1.9.1 with no problems so I think the range works best.

@jamiebuilds
Copy link
Member

@jmeas what? I don't think so... I remember a discussion about needing 2.1.x-x in order to pull in unofficial releases, at least in bower.

@Anachron
Copy link

Anachron commented May 8, 2014

Okay guys, here is my suggestion: If you use "jquery": "1.8.x || 2.1.x" then you can check later versions too and add them as you wish (like "jquery": "1.8.x || 1.9.x || 2.1.x || 2.2.x", maybe looks weird, but it's safe. I like to have a safe app. I don't trust external developers to not break their stuff, as I know everyone makes mistakes.

@samccone
Copy link
Member

samccone commented May 8, 2014

+1 for "jquery": "1.8.x || 1.9.x || 2.1.x || 2.2.x"

@jamiebuilds
Copy link
Member

That should actually be:
"1.8.x || 1.9.x || 1.10.x || 1.11.x || 2.0.x || 2.1.x || 2.2.x" **
because we're compatible with all of those.

Or we can assume jquery 1.12-2.0 isn't going to change core features that haven't been changed in a very long time, even in future 2.x versions...
"1.8.x - 2.2.x"

@Anachron
Copy link

Anachron commented May 8, 2014

@thejameskyle sorry I have to disagree here. Range is wrong in this case. Imagine that 1.15.0 will break compatibilty, it would be merged if the user has 1.x jQuery. 2.x users wont be affected, as this would be something like 2.7.x and not included in the range.

Its a special case for semver, thus I recommend not using ranges from 1.x to 2.x.

@jamiebuilds
Copy link
Member

jQuery has pretty long-standing plans, it's silly to be so concerned it's going to break the few core features we depend on (along with thousands upon thousands of other plugins/frameworks).

Backbone doesn't even declare jQuery as a hard dependency. In the future, Marionette shouldn't either, the amount we depend on jQuery should only be reduced and it should be made to work with any alternative including native APIs. That's a larger discussion though.

@jamesplease
Copy link
Member

@jmeas what? I don't think so... I remember a discussion about needing 2.1.x-x in order to pull in unofficial releases, at least in bower.

Bower uses node-semver, the same thing npm uses. The docs don't explicitly state it, but it's suggested that prereleases are included in the .x syntax, as it includes -0 at the end of the equivalent range.

It's easy to verify that it does, in fact, pull these guys in by setting up a simple node script:

var semver = require('semver');

var test = semver.satisfies('1.2.3-4', '1.2.x');

// true
console.log('Test', test);

UPDATE

So @thejameskyle might be write about bower, based on this PR. If that's the case then we're good to use .x as long as we don't ever add jQuery back to the package.json.

@jamesplease
Copy link
Member

👍 for "1.8.0 - 2.1.x".

It seems unlikely to me that jQuery would include a breaking change in a future 1.x release. //cc @gnarf @bobholt @ajpiano @cowboy @rwaldron @vladikoff could one of you verify this?

@jamesplease
Copy link
Member

ajpiano verified in IRC:

[09:10:27]  <jmeas>  would anyone here know how likely/unlikely it is that jquery would release a breaking API change in 1.x?
[09:18:19]  <@ajpiano>   jmeas very very very very very unlikely

My vote is for 1.8.0 - 2.1.x. What do you guys think?

@Anachron
Copy link

I think I am missing something.

1.11.x (IE6-8) is 2.1 (IE >= 9)
1.12.x (IE6-8) is 2.2 (IE >= 9)
1.13.x (IE6-8) is 2.3 (IE >= 9)

is that right?

So if you support 1.12.x (for IE6-8), why not support 2.2.x (for IE >= 9)?

@jamiebuilds
Copy link
Member

@Anachron because 2.2 doesn't exist yet, and we can bet on 1.x not changing.
@jmeas You know I'm all for it.

@Anachron
Copy link

@thejameskyle but 1.12 doesn't exist yet too, but still you wanna support it.

@ahumphreys87
Copy link
Member

@Anachron we have spoken to jquery core who say that 1.x is highly unlikely to introduce breaking changes. So we can target all versions of 1.x.

2.x on the other hand may get breaking changes - so we will need to verify support before adding them in.

@jamesplease
Copy link
Member

I think @Anachron is pointing out a non-semver-related fact about jQuery: 2.1 has the same exact functionality as 1.11, but doesn't support older browsers. And 2.2 === 1.12, and so on. This is in the introducing 2.0 blogpost, where they say:

In the future, we will be maintaining feature parity between 1.10 and 2.0, 1.11 and 2.1, etc.

In other words, we can assume jQuery follows semver and just use ^1.8 - ^2.0

@jamesplease
Copy link
Member

Resolved in 1.8.6

@Anachron
Copy link

Finally! Thanks god. 👍

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

No branches or pull requests

6 participants