Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Move jquery-ui.js into jquery-ui-rails gem #46

joliss opened this Issue · 15 comments

10 participants


Hey guys,

I just packaged up jQuery UI for the asset pipeline:

I was wondering what you thought about moving the jquery-ui.js that's currently shipping with jquery-rails into the jquery-ui-rails gem?

Right now we can't add a "jquery-ui.js" asset to jquery-ui-rails, because it would conflict with jquery-rails's version. (Which of the two gets picked up by Sprockets would be undefined, so that's asking for trouble.) So here's my suggestion:

  • In jquery-rails:

    1. Make one last 2.x release with jquery-ui.js 1.8.17
    2. Remove jquery-ui.js and jquery-ui.min.js from jquery-rails
    3. Bump the major version to 3.0.0-beta1 and release
    4. Put a note in the README that people might need to add the jquery-ui-rails gem with the 3.0.0 beta release if they want to use jquery-ui[1]
  • In jquery-ui-rails:

    1. Add jquery-ui.js (essentially the same as the one that ships with jquery-rails)
    2. Depend on jquery-rails >= 3.0.0-beta1 to avoid conflicts
    3. Bump the version to 1.0.0-beta1 and release

What do you think?

[1] I was thinking whether jquery-rails should depend on jquery-ui-rails so people get jquery-ui automatically. But since jquery-ui-rails adds a bunch of files (like "jquery.ui.datepicker.js") into the asset space that might conceivably conflict with user-supplied jQuery UI assets, I think it's best not to force it onto people, and instead require them to add jquery-ui-rails to their Gemfile if they want it.


Hey @joliss, I definitely like the idea of having jquery-ui in a separate gem, as it's a pain for us to maintain considering none of us really use it. A couple questions/comments:

  • I don't really want to bump jquery-rails a major version just to remove the packaged jquery-ui. I'd rather just remove jquery-ui when we're about to bump the next version anyway.

  • Given the last point, I'm unclear on what the conflict is. The jquery-ui gem has jQueryUI namespaced as jquery.ui.all, compared with jquery-rails being jquery-ui.

  • I agree with your last thought. I don't think there's any need to make jquery-rails depend upon jquery-ui-rails since the majority of people don't use it. And it's as easy as adding it to your Gemfile if people do want to use it.


I'd rather just remove jquery-ui when we're about to bump the next version anyway.

Right, that seems perfectly reasonable.

Given the last point, I'm unclear on what the conflict is. The jquery-ui gem has jQueryUI namespaced as jquery.ui.all, compared with jquery-rails being jquery-ui.

Ah, so the reason why I'm hoping to eventually include a jquery-ui.js file in jquery-ui-rails is that it's part of the official jQuery UI distribution, whereas jquery.ui.all.js actually isn't. I don't think this is an urgent issue though. As you said, let's remove it from jquery-rails next time you guys bump the major version.


Cool, sounds like a plan. I'm going to keep this issue open for now as a reminder.


hey guys, if you guys plan to move jquery.ui to a separate gem, could you please make a gem as well? Or if you know such one already exists?

Thanks for the awesome work of keep rails-jquery


That's not trivial, since you would have to somehow extract the dependencies between jQuery Mobile modules and turn them into Sprockets (Rails asset pipeline) dependencies. They don't use the same system as jQuery UI, so you'd need new code for that.


+1 to extracting


+1 too


Something like adding in jquery-ui-mobile would have to do some detection work to determine if mobile lineage is needed (screen sizes anyone?)


Considering the upcoming update to jQuery 1.9, I would like to bump this one. Looks like jQuery UI has been gemified separately a while ago already. What do you think?


Since JQuery UI isn't being kept up to date in this gem, I like the idea of removing it in favour of jquery-ui-rails. Since it is a removal, I think this change would be best suited for jquery-rails 3.0, which also takes us to JQuery 2.0 and removes support for old IE. (semantic versioning and all that)


I think the fact that jquery-rails includes a file called jquery-ui.js creates the opportunity for a third-party gem to //= require jquery-ui and thus clobber the jquery-ui-rails version.

If that's right, it would be good to pull jquery-ui.js from jquery-rails, or at least rename the file to minimize the chances of accidental clobbering.


I'm on board for this. It's been the eventual plan for a while. @indirect you agree? Think I'll go ahead and yank jquery-ui from jquery-rails and bump to v2.3.

@dsilver829 dsilver829 referenced this issue in activeadmin/activeadmin

Add jquery-ui-rails as a Dependency #2232


I went ahead and created versions 2.2.2 (latest jquery-ujs), and 2.3.0 (jquery 1.10.0 and jquery-ui 1.10.3) for those that want them.

And now, v3.0.0 is released as well with jquery-ui removed.

@JangoSteve JangoSteve closed this
@joliss joliss referenced this issue in joliss/jquery-ui-rails

Adapt to new structure introduced in jQuery UI 1.11.0 #70

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.