#212: Use jQuery Javascript Library

Contents
  1. Definitions
  2. Motivation
  3. Assumptions
  4. Proposal
  5. Implementation
  6. Deliverables
  7. Risks
  8. Progress log
  9. Participants
by Florian Schulze last modified Jan 21, 2010 07:28 AM

Switch to jQuery for all of Plones Javascripts.

Proposed by
Florian Schulze
Seconded by
Martijn Pieters
Proposal type
Architecture
Assigned to release
Repository branch
plone_ecmascript
State
completed

Definitions

 

Motivation

There are a lot of Javascript libraries out there. We want to switch to one of them to lessen the burden of maintenance of custom Javascripts in Plone and to make it easier to write new functionality. Also cssQuery has shown to be too slow for our grown needs and it's not actively developed anymore. jQuery includes a very fast and complete replacement for cssQuery. Preferably the resulting code should have improved readability, and the library used should not preclude the use of other Javascript libraries.

Assumptions

It is assumed (and already proven) that jQuery and all rewritten Javascripts together are not bigger then the existing Javascripts.

Proposal

We include jQuery, which is a well developed and maintained Javascript library. Rewrite the existing Javascripts in Plone to take full advantage of jQuerys features.

Implementation

Include jQuery in the 3rd party skin layer. Rewrite the existing Javascripts. Provide backward compatibility wrappers where needed, like nodeutils.js and cssQuery.

Deliverables

  • Rewrite existing Javascripts
  • Add jQuery to 3rd party skin layer and add to ResourceRegistries
  • Make sure the interaction with KSS works

Risks

The biggest risk is, that 3rd party products depending on Plones Javascripts or cssQuery may break. For the existing Plone Javascripts this is rather unlikely and we provide backward compatibility wrappers. For cssQuery it's possible to replace the backward compatibility wrapper with the real cssQuery if needed.

Progress log

Martijn already rewrote all existing Javascripts and it's proven that together with jQuery the resulting merged JS file is smaller then the one in Plone 3.0. Initial tests with KSS indicate that there are no problems from this change. We'll need to create a cssQuery compatibility layer (not hard) and ensure that all recent JS bugfixes are included in the rewritten code.

Participants

Martijn Pieters
Florian Schulze

Comments (6)

Martijn Pieters Dec 13, 2007 10:25 PM
Abstained
Andreas Zeidler Dec 13, 2007 11:11 PM
Gilles Lenfant Dec 19, 2007 03:44 PM
Actually, several extension packages (PloneArticle, Collage, and others) are shipped with their own copy of jQuery. Of course, potential JS conflict issues raise.
Tom Lazar Dec 20, 2007 01:14 PM
+1 (!)
Raphael Ritz Dec 20, 2007 01:50 PM
+1 (I'm no expert here by no means but I'm confident Martijn and Florian know that they are doing here. AFAICT this is also handled in close collaboration with the KSS crowd so that's good)
Danny Bloemendaal Dec 22, 2007 03:58 PM
+1 but only if this cannot be covered by KSS.