Update jQuery 2.0 #124

ai opened this Issue Apr 18, 2013 · 45 comments


None yet
ai commented Apr 18, 2013

jQuery 2.0 was released.

Maybe we need ship plugin with 2 versions (1.9-1.10 and 2.0-2.1-future)?

To load new one:

#= require jquery2

Ideally the plugin would have both and a method to allow us to send jQuery 1.9 to the browsers not supported by 2.0 while sending the 2.0 ones to the still supported browsers.

Saves a little bandwidth, would require two sets of compiled js files and some IE conditionals though.

If that is too much faff then including both and just changing the require as mentioned above would probably be best.

ai commented Apr 19, 2013

@JangoSteve we wait for new version ^_^

ai commented Apr 22, 2013

@indirect waiting for 2.0 ^_^

jQuery 2 would be great!

nathany commented May 14, 2013

Our app requires IE9 so JQuery 2 support would be great (we have already removed all deprecations and removed jquery-migrate). At the same time, we would use JQuery 1.9 or 1.10 for our web site via an older version of jquery-rails.

ai commented May 29, 2013

There isnt jQuery 2 for Rails about a month. Maybe just addjquery2.js` to gem, to allow include it only in non-IE8 sites (without any hacks with changing version).


Just released v3.0.0 which has jQuery 1.10.0 included. We definitely won't be packaging jQuery 2.0 as the default, but I could probably be on board with adding it as jquery-2.js and allowing it to be swapped out for jquery.js if desired. I first need to make sure that jquery-ujs is compatible with jQuery 2.0 though when I get time.

ai commented May 29, 2013

Cool :)

nathany commented May 29, 2013

@JangoSteve sounds good.

wbyoung commented Jul 11, 2013

+1 for adding 2.0 as an option.

forrest commented Jul 19, 2013

+1 for 2.0

jongold commented Jul 26, 2013

Any progress on this? Would be awesome to use jQuery 2 :)

nathany commented Jul 26, 2013

Do we know if jquery-ujs is compatible with JQuery 2.0?

ai commented Jul 29, 2013

@JangoSteve why not just add jquery-2.0.js to gem?

++ for 2.0! Any updates on this?

nathany commented Jul 29, 2013

JQuery 2.0 was released on April 18th, so it's definitely due time to support here.

First someone needs to ensure that jquery-ujs supports it. I didn't see any tickets or pull requests there for it, whether opened or closed.


JQuery 2.0 isn't newer than 1.9, it just supports less browsers. You're welcome to use it yourself, if you'd like. Or test it with jquery-ujs yourself. But this isn't the jquery-ujs repo, so this is the wrong place to open a ticket for that.

On Jul 29, 2013, at 3:08 PM, Nathan Youngman notifications@github.com wrote:

JQuery 2.0 was released on April 18th, so it's definitely due time to support here.

First someone needs to ensure that jquery-ujs supports it. I didn't see any tickets or pull requests there for it, whether opened or closed.

Reply to this email directly or view it on GitHub.

nathany commented Jul 29, 2013

That's why I provided a link to the jquery-ujs repo, and looked there to see if anything had been done for JQ 2.0 support. In theory it should "just work" but I haven't had time to test it.

ai commented Jul 29, 2013

@indirect jQuery is much faster and jquery-rails is a common way to add jQuery to your site (even if you use CDN with jquery-rails-cdn, you will use jquery-rails on development). So without jQuery 2.0 in jquery-rails I can’t make my site faster (we don’t support IE 8) and there is no sense to make own jquery gem (for example, without jquery-ujs to update jQuery faster).


@nathany yes — but I disagree with your assertion that its "definitely due time to support here". 1.9 is the compatible and maintained version of jQuery. 2.0 is a fork with lower compatibility. If you want that, please go ahead, and we'll add 2.0 to this gem once we figure out a good way to do it without breaking backwards compatibility for people who use this gem.

@ai if you're unhappy, fixing it yourself is always an option.

ai commented Jul 29, 2013

@indirect why you ask about compatibility? We suggest to put jQuery 2.0 is separated file like jquery-2.js.

And jQuery 2 is not only about lower compatibility. We develop mobile site and jQuery 2.0 may improve our perfomance.


As soon as I get some time (hopefully in the next day or so), I'll add it to the jquery-ujs test suite and make sure everything works (at least on the target browsers for jquery 2.0). Once I can confirm that, we can add it as a non-default option for jquery-rails.

nathany commented Jul 30, 2013

@JangoSteve Thanks!

ai commented Aug 20, 2013

@JangoSteve maybe we can help with jQuery 2.0?

ai commented Aug 26, 2013

If you want jQuery 2 and don’t need UJS you can use jquery-cdn gem.

shlima commented Oct 12, 2013
  • 1
matzke commented Oct 29, 2013


komiyak commented Nov 8, 2013


Kallin commented Nov 14, 2013


Preen commented Nov 23, 2013


dennym commented Dec 3, 2013


Any information about what's holding this up?

amir20 commented Dec 9, 2013

I have moved to using bower. You can include any version.

ai commented Dec 9, 2013

Gem jquery-cdn contains latest jQuery 2.0 and can be loaded by better ways (like CDN with fallback).

  • Need in gem

I think we can meanwhile use jquery 1 and 2。
just like:

<!--[if lt IE 9]> <script src="jquery-1.9.0.js"></script> <![endif]--> 
<!--[if gte IE 9]><!--><script src="jquery-2.0.0.js"><</script> <!--<![endif]-->

and maybe,we can identify the browser version come by UA

ai commented Feb 8, 2014

jQuery 2.1.0 is already release and we still haven’t jQuery 2.0 ;)

+1 for jQuery 2 support

@iphilgood iphilgood referenced this issue in brandleadership/kuhsaft Feb 13, 2014

Use Up to Date JQuery #197

+1 to get a jQuery v2.X version supported. CDNs are not always an option for closed network applications.

@mitnal mitnal referenced this issue in rails/jquery-ujs Apr 3, 2014

jQuery 2 support? #368

gotqn commented Apr 15, 2014



Hey everyone. I was just talking with @lucasmazza about what needs to be done to bring this in. The primary reasons I've been hesitant until now is:

  1. Not knowing which version to add to the javascript :defaults. This is a Rails 3.0 issue though, since it doesn't apply anymore with the asset pipeline. So, this can cease to be an issue by simply removing the lib/jquery/rails/railtie.rb, since we don't need to actively support Rails 3.0 anymore.

  2. Potential conflicts with the fact that default rails apps generate the application.js manifest file with require_tree ., which would cause both packaged jquery files to be compiled in the assets. The best solution here is probably to namespace the assets in the vendor/javascript folder of the jquery-rails gem. This way we could prevent both versions from being included by default, while allowing developers to explicitly swap out require jquery with require jquery2 if they'd like.

@lucasmazza and I can go ahead and get the ball moving on both of these so we can finally bundle jQuery 2 for those who prefer it.

jeremy commented Aug 7, 2014

@JangoSteve -

  1. Leaving the current jquery in :defaults would be fine. Dropping 3.0 support works too.
  2. I don't think this is an issue. require_tree . is relative to that file; it won't pull in jquery files from other asset paths.

Please add~

@lucasmazza lucasmazza referenced this issue Sep 1, 2014

Ship both jQuery 1 and jQuery 2. #170

3 of 3 tasks complete


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment