Ticket #12452 (closed PLIP: fixed)
package jquery outside Products.CMFPlone
Reported by: | garbas | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 4.2 |
Component: | JavaScript | Version: | 4.1 |
Keywords: | Cc: |
Description (last modified by garbas) (diff)
Proposer: rok garbas
Seconder: None as yet
Motivation
having jquery packaged in Products.CMFPlone makes it really hard to keep up-to-date with latest development of jquery. also addons don't have clear way to require newer version of jquery, but are forced to come up with a custom solution to replace current jquery.js entry in portal_skins or disable and register new jquery lib in portal_javascript.
As time of writing this PLIP Plone is still using jquery 1.4.4. There are many improvements in speed of jquery and also many new useful things added since 1.4 (current stable jquery release is 1.7.1) which plone addons probably want to take advantage of.
Assumptions
current coverage of javascript code is small, if it even tested. this is also one of the reasons why jquery is not updated more often. if we pack jquery separately we can easily enable newer version of jquery in upcoming plone releases. until we are better at testing javascript i believe this would be best way to keep jquery up-to-date.
Proposal & Implementation
package jquery into separate package, using browser:resource, disable currently used jquery.js and jquery-integration.js. If addons still requires them it should be easy to enable them back, but we should definitely remove them in future.
by default we will still ship with jquery 1.4.4 as we do now, but if addon requires newer jquery version there will be a documented way how to do it.
Deliverables
- plone.app.jquery, where jquery is packed
- upgrade documentation for addons who depend on their own jquery version
Risks
- breaking addons who updated jquery.js ResourceRegistry javascript
- this is not really a risk, but i want to point out that once we separate out jquery from P.CMFPlone we wont update plone just yet, i suggest we keep version 1.4.4 and all future addons (deco is nice example) can update to newer version if needed.
Participants
Rok Garbas, garbas (Real names and usernames, please)
Progress
- ready to be tested
- plip cfg is [here| https://github.com/plone/buildout.coredev/blob/4.2/plips/plip12452-package-jquery-separatly.cfg]
- and code is here: https://github.com/plone/plone.app.jquery
Change History
comment:2 Changed 4 years ago by esteele
- Milestone changed from 4.3 to 4.2
I'd like to go ahead and merge the 1.4 branch into Plone 4.2.
comment:3 Changed 4 years ago by esteele
One note from the FWT: We need to make sure that any packages using jQuery functionality are declaring this as a dependency.
comment:4 Changed 4 years ago by garbas
great, 4.2 good news.
currently i've add it as dependency of Products.CMFPlone as we have done for plone.app.jquerytools, you think we should really go more in depth with this javascript dependency stuff, i don't think we have the infrastructure for this.
i would leave this task for tools such as Fanstatic ( http://www.fanstatic.org).
comment:6 follow-up: ↓ 7 Changed 4 years ago by robgietema
Great work on this package, I think it is a good idea to move jQuery into a separate package.
I have reviewed the package and have some remarks:
- The upgrade steps need to be moved to p.a.upgrade like the rest of the upgrade code
- Can we use the versioning of jQuery itself in the package version so different add ons can depend on a specific version of jQuery? For example: plone.app.jquery version 1.7.1-1 where 1.7.1 is the jQuery version and the -1 the python package version.
comment:7 in reply to: ↑ 6 Changed 4 years ago by garbas
Replying to robgietema:
Great work on this package, I think it is a good idea to move jQuery into a separate package.
I have reviewed the package and have some remarks:
- The upgrade steps need to be moved to p.a.upgrade like the rest of the upgrade code
+1 ... will move it there
- Can we use the versioning of jQuery itself in the package version so different add ons can depend on a specific version of jQuery? For example: plone.app.jquery version 1.7.1-1 where 1.7.1 is the jQuery version and the -1 the python package version.
i think versioning you mentioned is not according to PEP 386 - ( http://www.python.org/dev/peps/pep-0386/#the-new-versioning-algorithm
i think we should start with jquery version number (eg. 1.6.4) and then create post version (eg. 1.6.4.1 or 1.6.4.post1)