#212: Use jQuery Javascript Library
- Contents
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

