Ticket #12350 (closed PLIP: fixed)
Integrate selected portions of jQueryUI
Reported by: | smcmahon | Owned by: | toutpt |
---|---|---|---|
Priority: | minor | Milestone: | 5.0 |
Component: | JavaScript | Version: | 4.1 |
Keywords: | Cc: | itconsense@… |
Description (last modified by garbas) (diff)
Proposer: Steve McMahon Seconder:
Motivation
Several hoped-for components for forthcoming Plone 4.x versions require interactivity that isn't currently available from our included JavaScript libraries. In particular, flexible drag-and-drop and autocomplete support will be needed for plone.app.theming and for reference and tagging fields for dexterity.
These are also going to be popular requirements for major add-ons, like PFG (already using jQueryUI for d-n-d). Providing the basic functionality with Plone would help avoid having multiple solutions to the same problem bulking up page download.
Assumptions
We assume that it is possible and realistic to build a jQueryUI component set for drag-and-drop and autocomplete without needing the jQueryUI Theme Framework.
Proposal & Implementation
Create plone.app.jquery, supplying selected components of jQueryUI, including draggable, droppable, sortable and autocomplete as browser resources, registered with the portal_javascripts registry. Some CSS support may be needed for autocomplete.
The jQueryUI set will not include any widgets that require jQueryUI's theme framework or effect library.
The default portal_javascripts settings will enable these resources only for auth users.
Deliverables
A plone.app.jqueryui package.
Documentation added to the JavaScript section of the Plone developer manual.
Progress
Risks
Even without the theme framework, these are big components. A minified package with jQueryUI's core, autocomplete and d-n-d will be somewhere near 100KB (minified, but not gzipped). This will add tangibly to the time for the first page load after authentication.
Not including the full jQuery theme framework, effect and widget library has its own risks. Some package developers will want these and may push for requiring them (or may just add them to popular add ons and create a de facto requirement).
Participants
SteveM Timo Nathan Gotcha toutpt
Change History
comment:2 Changed 4 years ago by optilude
+1 from me, for what it's worth.
I assume you mean 'plone.app.jqueryui' not 'plone.app.jquery' under "Proposal & Implementation".
I wonder if it may not be prudent to ship with more of jQuery UI, but leave all but the components listed above disabled by default. We want to avoid a situation where different add-ons ship their own, conflicting versons, and this way we can have a 'known good' version for Plone. That has its own risks, of course.
Martin
comment:3 Changed 4 years ago by toutpt
Extended implementation proposal
I propose to rename collective.js.jqueryui to plone.app.jqueryui with some changes/improvements.
- hide the controlpanel (proposed by optilude)
This control panel is more for developers&integrators than for normal users.
- add a global include condition
We manage every plugins inside the portal javascripts, so we should let integrators be able to change include params of every plugins at once.
- change the default install to only install selected plugins and not all
collective.js.jqueryui include every plugins for compatbility purpose, this will be not the case with plone.app.jqueryui.
- add tests.
why doing this
- easier to maintain
- let integrators&dev use the full jqueryui
- fighting addons which trying to provide their own version of jqueryui
Some hints on collective.js.jqueryui
- started in 2009
- used (more than 25 000 downloads: http://pythonpackages.com/downloads/collective.js.jqueryui )
- well maintained
- cover all known issues of jqueryui and Plone and document them
comment:6 Changed 4 years ago by toutpt
I have done a first sprint around this:
plip added to buildout: https://github.com/plone/buildout.coredev/blob/4.2/plips/plip12350-jqueryui.cfg plone.app.jqueryui implemented without tests.
Registration of resources simplified using a browser view to load all plugins. Plugins are selected using the portal_registry. Each change call a cookResources. No UI at all. The viewlet l10.datepicker has been backported too.
I also would like to include a branch of plone.formwidget.autocomplete based on plone.app.jqueryui (Already discussed with Martin Aspelli)
TODO: add tests.
The code is on my github account at the moment because I can't neither add a repo to github/plone or fork a repo to github/plone. So how could I my repo ?
comment:7 Changed 4 years ago by eleddy
- Version set to 4.1
- severity set to Untriaged
the most important thing at this moment is to let us know if this is still a draft or not. the fwt would like to officially discuss it because it could impact other plips. code location isn't important know but talk to rok likely to see how to get it there. we would like to officially get this in the process.
comment:10 Changed 4 years ago by eleddy
- Status changed from new to confirmed
- Description modified (diff)
comment:11 Changed 4 years ago by eleddy
It seems like this is required for #12227 - is that the case? Is that plip already using these changes?
comment:12 Changed 4 years ago by toutpt
#12227 plone.app.theming optilude-ace doesn't depends on jqueryui as far as I know and have seen in the code. ACE doesn't depends on it. May be I'm wrong. This plip just include selected plugins of jqueryui inside plone's resources registries.
Let me know if I need to change anything.
comment:14 Changed 4 years ago by eleddy
Sorry for the late response, is this PLIP more or less ready? We are starting to merge in 4.3 and would like to include if thats the case. Otherwise approved for 4.4! We are still looking for a champion but will get one soon. Please let us know when its ready for review
comment:15 Changed 4 years ago by garbas
- Description modified (diff)
It was mentioned that Deco would use jqueryui's drag-n-drop, but that not the case anymore. i've fixed that with description.
I'm still -1 on this one and there is no real reason for shipping it with Plone. if addons like PFG depends on it then it can be also be managed outside Plone, until we ship PFG with Plone.
Then there is mention of dexterity widgets using jquery ui? which widgets are this? since plip description does not list them.
also if there was intention to include "draggable, droppable, sortable" just because of deco then this is not the case anymore and not sure if autocomplete is good enough reason to include jqueryui with plone. big dependency for one feature, i believe there must be a js library that for autocomplete that does similar things that jqueryui version do, especially since i know there are lot of ppl like me hating jqueryui :) (reason to drop jqueryui drag-n-drop for deco was that its not working across iframes, smaller more flexible drag-n-drop library was used).
comment:16 Changed 4 years ago by thet
the jQuery autosuggest is an very interesting alternative to the jQuery UI autocomplete:
demo: http://code.drewwilson.com/entry/autosuggest-jquery-plugin
repository: https://github.com/wuyuntao/jquery-autosuggest/
and it says that it's less than 10kB minified.
comment:17 Changed 4 years ago by eleddy
Timeline update: we would like to have all development complete by June 30th and everything reviewed by July 11th for the 4.3 release.. Please let the FWT know via here or the mailing list if you don't think things will be ready by that time.
comment:18 Changed 4 years ago by smcmahon
I'll take responsibility for researching the status of this PLIP and reporting.
comment:19 follow-up: ↓ 20 Changed 4 years ago by toutpt
Status of the plip IMO: almost ready but a question asked 5 month ago, about the process has never been answered.
The code is on my github account at the moment because I can't neither add a repo to github/plone or fork a repo to github/plone. So how could I my repo ?
It is my first plip, so if nobody answer I will not be able to finish that work.
comment:20 in reply to: ↑ 19 Changed 4 years ago by eleddy
Replying to toutpt:
Status of the plip IMO: almost ready but a question asked 5 month ago, about the process has never been answered.
The code is on my github account at the moment because I can't neither add a repo to github/plone or fork a repo to github/plone. So how could I my repo ?
It is my first plip, so if nobody answer I will not be able to finish that work.
Do you have general access to plone core github? Please hop into #plone or #plone-framework and ping one of the admins to get it sorted.
comment:21 Changed 4 years ago by kleist
- Status changed from new to confirmed
Confirming, just to clean up the "Untriaged Tickets" report.
comment:22 Changed 4 years ago by eleddy
- Milestone changed from 4.3 to 4.4
Since we aren't seeing any merging happening, we are pushing this to 4.4.
comment:23 Changed 3 years ago by toutpt
I would like to go back on what I have proposed before.
I would like either to
- keep collective.js.jqueryui maintainer. It's used in a lot's of addons and well referenced over the web. So we will remove plone.app.jqueryui repository. The rewrite is useless and not needed (all contributors of c.js.jqueryui are already core developers)
or
- do not integrate it in the core at all and let it as a collective addon.
To make it core we need a dependency somewhere and from what I know the only parts of Plone which need it should be the jqueyrui branch of plone.formwidget.autocomplete (the current release is still not compatbile with jqueryui)
So I would be glade that someone take position here and help me at least to decide what to do.
Thanks
comment:24 Changed 3 years ago by davisagli
I think that we should keep the collective.js.jqueryui package, but add it to the official Plone versions and say that it is the recommended way to include Jquery UI within Plone.
It makes sense that since there are already a lot of addons which use collective.js.jqueryui and it is the de facto standard, we should continue to use it rather than renaming the package just for the sake of renaming it. But I think we do want an official recommendation, so that it is easier to update things like plone.formwidget.autocomplete to use jqueryui when it makes sense.
I'll try to confirm this with the framework team in our meeting tomorrow. If the others agree, I don't see any risk to adding the version to versions.cfg for Plone 4.3.
comment:25 Changed 3 years ago by toutpt
What has been choosed by the FT ? Do we pin c.js.jqueryui in Plone and on which one ?
comment:27 Changed 3 years ago by kleist
According to http://plone.293351.n2.nabble.com/Status-of-jQueryUI-in-Plone-tp7563653p7563695.html, collective.js.jqueryui has now been added to the KGS for Plone 4.3 and 4.4
comment:28 Changed 3 years ago by toutpt
- Status changed from confirmed to closed
- Resolution set to fixed
comment:29 Changed 3 years ago by thet
even if it's closed ... if jquery ui is too much to deliver with plone (+1 from me), why not including a lightweight drag/drop library, just as: https://github.com/haberman/jdragdrop
this one might not be too widespread at the moment, but read it's README. sounds very promising.
regarding the jquery UI autocomplete plugin: i prefer Select2 (included in plone.app.widgets). i guess you've heard about it since the last update of this PLIP.
comment:30 Changed 3 years ago by garbas
@thet: jdragdrop looks promising especially since its using same API as jquery.event.drag/drop so we could replace it without changing any of the rest of the code. i'll add it in todo ro reevaluate it when i'll be working on deco.
plone.app.widgets also includes jquery.event.drag/drop library for Orderable Multi Select widget.