Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update jQuery 2.0 #124

Closed
ai opened this Issue · 45 comments
@ai
ai commented

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
@rurounijones

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
ai commented

@JangoSteve we wait for new version ^_^

@ai
ai commented

@indirect waiting for 2.0 ^_^

@itay-grudev

jQuery 2 would be great!

@nathany

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
ai commented

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).

@JangoSteve
Owner

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
ai commented

Cool :)

@nathany

@JangoSteve sounds good.

@wbyoung

+1 for adding 2.0 as an option.

@forrest

+1 for 2.0

@jongold

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

@nathany

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

@ai
ai commented

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

@dbchristopher

++ for 2.0! Any updates on this?

@nathany

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.

@indirect
Owner
@nathany

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
ai commented

@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).

@indirect
Owner

@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
ai commented

@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.

@JangoSteve
Owner

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.

@ai
ai commented

@JangoSteve maybe we can help with jQuery 2.0?

@ai
ai commented

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

@matzke

+1

@komiyak

+1

@Kallin

+1

@Preen

+1

@dennym

+1

@dbchristopher

Any information about what's holding this up?

@amir20

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

@ai
ai commented

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

@KODerFunk
  • Need in gem
@borisding1994

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
ai commented

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

@yan-hoose

+1 for jQuery 2 support

@iphilgood iphilgood referenced this issue in screenconcept/kuhsaft
Closed

Use Up to Date JQuery #197

@lightswitch05

+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
Closed

jQuery 2 support? #368

@gotqn

+1

@JangoSteve
Owner

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
Owner

@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.

@PikachuEXE

Please add~

@lucasmazza lucasmazza referenced this issue
Merged

Ship both jQuery 1 and jQuery 2. #170

3 of 3 tasks complete
@rafaelfranca
Owner

No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.