It's not currently being used, which makes it dead weight at the moment. See also #1787222: [meta] Strategy for updating vendor JS libraries within a major stable version.

CommentFileSizeAuthor
#10 1801456-diff.patch775.02 KBRobLoach
#10 1801456-formatpatch.patch795.88 KBRobLoach
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rickvug’s picture

Isn't the real problem that Drupal hasn't adapted to using jQuery UI where possible? It looks suitable for modal dialogs, autocomplete, date widgets, color picker and progress bar, to name a few. It would be great to have more information in this issue on why jQuery UI isn't being used now.

nod_’s picture

Actually, there is one reference to jquery.ui.core in the overlay module. That said when you take it out, everything works fine. It's a leftover from the jQuery UI days of the overlay.

sun’s picture

Issue tags: +jQuery, +JavaScript, +jQuery UI

Related issues:

#675446: Use jQuery UI Autocomplete
#1667742: Add abstracted dialog to core (resolves accessibility bug) (not jQuery UI Dialog, for some unknown reason I never understood)
#1169906: Switch to jQuery UI Menu for the Contextual Links
...

Overall, this seems to be the opposite direction of:
#1666920: [meta] Where/when to use jQuery UI

nod_’s picture

Not necessarily, "never" is a valid answer to the "when" question of using UI. My position about the other issue is well summarized by the title of this one :)

There hasn't been much love for the other issue, that might be saying something too.

Bojhan’s picture

@nod_ I know you would love to remove all jQuery from core. But the whole idea of putting jQueryUI in core, is that we would have access to its great features for drag & drop of blocks/fields. Sadly, none of that ever happened - the idea at the time was that we do not have the resources to develop and sustain that on our own. With the layout stuff coming, do you think we can?

A large part of the challenge is making it accessible, which jQuery is actively pursuing. Our accessibility team is not growing, and similar to the UX-team its only struggling more and more. This is far from a use/not use question, its a question whether we want to develop our own js. for all of the functionality that jQuery UI supports and if we have the team to support that - and this goes beyond the newly found maintainers. It has an impact on the usability team who has to review custom created things, the accessibility team who has to make it all usable, the performance people who have to make sure it doesn't slow drupal down etc.

Also beyond core, how is it used in contrib?

tim.plunkett’s picture

Well, I know that D6 is hellish for a module like FullCalendar. D7 made it a lot easier.

That said, I think this module is a negatively phrased version of #1666920: [meta] Where/when to use jQuery UI, and should be marked as a duplicate.

larowlan’s picture

@sun #1667742: Add abstracted dialog to core (resolves accessibility bug) is a fapi/ajax command wrapper to jquery:ui.dialog
Would love some more eyes on the php side of that patch.
Thanks

effulgentsia’s picture

In fact, #1667742: Add abstracted dialog to core (resolves accessibility bug) came about after much discussion in #1175830: Update to jQuery UI 1.10.2 where jQuery UI dialog was accessibility tested, and larowlan addressed the remaining bugs in a jQuery pull request that scottgonzales from the jQuery UI team said would be committed in time for D8.

I don't know how feasible it would be to find another dialog widget or roll our own that meets our accessibility needs.

RobW’s picture

One of the big issues with jQ UI is size. Custom builds could take that down. I'm sure that's an issue floating around somewhere, something like the "expose modernizr build to module system" issue from a while back.

Also, if I remember correctly the Aloha version that Spark is using is dependent on it. With all the effort being put into pushing Spark into core, it seems like jQ UI is a defacto core dependency.

I love cutting out dead weight, but I think the "how can we use jQuery UI more efficiently" is going to be the real Drupal issue. It might not be possible to chop it down, but we can prune it back.

RobLoach’s picture

Status: Postponed » Needs review
FileSize
795.88 KB
775.02 KB

This will likely fail due to binaries being removed.

I love cutting out dead weight, but I think the "how can we use jQuery UI more efficiently" is going to be the real Drupal issue. It might not be possible to chop it down, but we can prune it back.

The way to do that would be to make it able to use an AMD architecture. Here's jquery-ui-core. We'd have to do the same to each component, and then introduce a package.json to bring them in. In the mean time, I don't see anything wrong with its removal. Of course, if it is needed by anything, exposing it in jQuery UI module is always an option.

webchick’s picture

Status: Active » Postponed

To back up RobW, I totally don't understand why this is being looked into now, while we're still in code thaw. There are definitely Spark patches and blocks and layouts patches forthcoming that wish to make use of this library, as well as numerous patches in the queue that provide incremental improvements that would be fine to go in even as late as code freeze, like adding date pickers to author date fields and what have you.

I'm therefore postponing this, at least until Feature Freeze, if not Code Freeze. It doesn't make any sense to me to rip libraries out until we're sure we're not using them, and there's no reason ripping libraries out needs to happen before Dec. 1.

RobLoach’s picture

Status: Needs review » Postponed

@webchick The reason I was pushing this forward is because it's blocking #1542344: Use AMD for JS architecture. I've talked with Scott Gonzalez from the jQuery UI team, and they currently have no plans to support an AMD architecture. Let's get rid of it for now to un-block AMD. If we need it later on, we could do that, otherwise it's just stalling issues.

I outlined what would be required to have jQuery UI under an AMD structure in the comment above.

effulgentsia’s picture

Views in core is an official initiative and per #8 requires an accessible modal dialog. We can't remove jQuery UI without a clearly identified alternate dialog widget.

nod_’s picture

@Rob, that's not blocking the AMD issue, we can make it work with UI as-is :)

RobLoach’s picture

Let's do it!

mgifford’s picture

What are we using jQuery UI for that can't be done cheaper with native HTML5 & polyfills?

The Government of Canada's WET Toolkit has dropped jQuery UI from their collection of tools because it adds too much to page load times, particularly for mobile users. They can get more for less if they build up from HTML5 rather than working with the larger jQuery UI engine.

Seeing that Drupal 8 is being built for mobile & with html5 this is something to be considered.

Things that can't be handled yet with this approach would be:
- autocomplete
- modal dialog
- contextual links

LewisNyman’s picture

hm, this is a tricky situation. Although it's used lightly in core having a common UI framework for contrib to leverage is a good thing.

There are very few comprehensive UI frameworks that are built to serve both mobile and desktop, a framework either has a desktop-first approach and hence a heavy reliance on jQuery (eg Twitter bootstrap) or aims for a UI framework that imitates mobile OS's (eg Kendo or Sencha Touch).

Adding a mobile UI framework now is risky, especially when the mobile UI is loosely defined in core currently, see: #1595292: Create a style guide for Drupal's mobile UI

klonos’s picture

effulgentsia’s picture

Given autocomplete and dialogs, is there any benefit to keeping this issue open, or should we "won't fix" it and use #1666920: [meta] Where/when to use jQuery UI for ensuring we only use jQuery UI where it's needed?

nod_’s picture

Sun reopened the chosen issue with valid feedback and dialogs will be abstracted enough we don't need to rely on jQuery UI, even if that makes things simpler for us.

quicksketch’s picture

Status: Postponed » Closed (won't fix)

We're now using jQuery UI dialogs in a number of places: the Diff UI, Views, Editor module, and lots of patches in the queue to extend this support. We're definitely not removing jQuery UI in D8 at this point. Any replacements will need to accomodate for these situations.

mgifford’s picture

Version: 8.x-dev » 9.x-dev
Status: Closed (won't fix) » Active

Let's bump it ahead to D9 then.

nod_’s picture

Status: Active » Postponed

Haha it's one of my favorite issue :p

Let's be realistic though, with all the stuff using it now (ckeditor, edit, dialog.js) and the lack of alternatives it can't be not postponed.

Wim Leers’s picture

CKEditor does not use jQuery UI at all. Only the "drag and drop toolbar configuration" part of it uses jQuery UI (sortables & draggables).

Edit does not use jQuery UI explicitly, it only uses an architectural layer from it: jQuery UI Widgets. And it only uses that because Create.js uses it. And many people have expressed towards Create.js developers that the usage of jQuery UI Widgets is a disadvantage, because it is so very confusing.

So that leaves:

  • drupal.dialog (jQuery UI Dialog)
  • drupal.overlay.parent (jQuery UI core)
  • Views UI (jQuery UI Tabs & Dialog)

It of course seems better to not spend energy on getting rid of jQuery UI at this point, but long-term it might make sense. Potentially even after code freeze, if jQuery UI turns out to be preventing good front-end performance (after profiling).

scott.gonzalez’s picture

It of course seems better to not spend energy on getting rid of jQuery UI at this point, but long-term it might make sense. Potentially even after code freeze, if jQuery UI turns out to be preventing good front-end performance (after profiling).

Are you referring to the overhead of loading all the source code or performance problems with usage? I wound encourage you to discuss any problems (if there turn out to be any) upstream before deciding to remove jQuery UI from core. You can file issues at http://bugs.jqueryui.com, or ping me directly. I'm scott_gonzalez on freenode (#drupal-contribute and #jqueryui-dev) or scott.gonzalez@gmail.com for email/jabber.

Wim Leers’s picture

I'm referring to the loading of source code indeed. I personally don't know of any performance problems in jQuery UI's code itself.

effulgentsia’s picture

For whenever this is unpostponed (or if someone feels like doing it before then), an updated issue summary would help. At this point, are the reasons:
- updatability between minor Drupal releases?
- accessibility?
- code loading performance?
- something else?

I think many of these things have already been addressed or are being addressed. For example, for the dialog uses, the jQuery UI code is only loaded when a dialog is actually returned to the user, so there's no performance cost on pages that don't have dialogs, or have potential dialogs that are never opened.

xjm’s picture

temporarily tagging. :)

mitokens’s picture

catch’s picture

Status: Postponed » Closed (won't fix)

This is used by quickedit, seven, ckeditor and locale now. Unless we rewrite all that to use something else, this isn't relevant, so marking "won't fix".

Version: 9.x-dev » 9.0.x-dev

The 9.0.x branch will open for development soon, and the placeholder 9.x branch should no longer be used. Only issues that require a new major version should be filed against 9.0.x (for example, removing deprecated code or updating dependency major versions). New developments and disruptive changes that are allowed in a minor version should be filed against 8.9.x, and significant new features will be moved to 9.1.x at committer discretion. For more information see the Allowed changes during the Drupal 8 and 9 release cycles and the Drupal 9.0.0 release plan.