Personal tools
You are here: Home Products Plone Roadmap #139: Standard support for alternate js libraries
Document Actions

#139: Standard support for alternate js libraries

Contents
  1. Definitions
  2. Motivation
  3. Proposal
by Jonah Bossewitch last modified June 11, 2006 - 00:22
Whatever the concensus on the js libraries to support Plone's ajax solutions, third party products may still depend upon alternate javascript libraries. Provisions need to be created to avoid conflict and standardize dependancy specification.
Proposed by
Jonah Bossewitch
Seconded by
Anders Pearson
Proposal type
Process
State
being-discussed

Definitions

Motivation

Resource Registries goes a long way towards allowing third party products to manage and coordinate javascript dependencies. However, with javascript libraries like MochiKit becoming more popular, it is ineveitable that some third party Plone Products may choose to develop using these libraries. Plone may have a preference for what it uses to develop its own ajax functionality, but it should be agnostic with regards to third party javascript development. Trouble is, with popular libraries emerging, it is only a matter of time before multiple products begin wanting to install the same javascript files.


Plone should consider shipping with these libraries, which could be enabled optionally when needed to mitigate the inevitible conflicts that may arise if these libraries are not standardized on. No matter what, some strategy should be devised so that product developers using these libraries do not stomp on each other or conflict with each other.


First, libraries like MochiKit need to be installed under a common key in the registries, or else mulitple copies of the libraries may end up being managed. Second, these libraries come in different versions, and third party tool developers should be writting against the same version of these alternate libraries, or else some applications may end up needing to ship multiple versions of the same libraries.

Proposal

Ship with a MochiKit redistribution. Allow for the Product (or maybe even just a skin) to be optionally installed when specified as a dependency by a third party product. If this doesn't happen, things might start getting chaotic soon.

Size

Posted by Martin Aspeli at April 11, 2006 - 11:17
The other issue is download size. It'd suck to have to download both Prototype.js and Mochikit, say, just because you need two different products that use similar functionality on both.

I would prefer if Plone only shipped with one framework and preferred that framework. I'm not sure how realistic that is, though, given that there's not so much consensus in the community about which is better. Bling uses Prototype/Scriptaculous, Kukit uses Mochikit. I'm sure there are other choices as well.

We need to discuss this more than anything, and let evolution work to discover what's best.

Re: size

Posted by Jonah Bossewitch at April 12, 2006 - 03:00

Yeah, I suppose it might suck to download both Prototype and Mochikit. But it would suck even worse to download Prototype and 2 copies of MochiKit. Or Prototype and 2 copies of Mochikit of different versions which break each other.

This should be addressed, perhaps by convention (store Mochikit under foo key in the resource registry, and prefer a particular version, all other considerations being equal). And is download size of Plone really a problem? Ship with it, and only enable it if a Produce depends upon it?

Alternatively, create a razor thin MochiKit Product in the collective which is nothing but a skin containing MochiKit and an installer to put it in the right place. T hen, products using MochiKit can at least depend upon the same one. This could do most of the trick, but people need to know about it.

/jsb

Plone own js code

Posted by Tarek Ziade at November 30, 2007 - 13:02
Beside having a third party js lib in Plone, I noticed that in the current trunk, the CMFPlone/skins/plone_ecmascript contains a lot of global js functions. IMHO these should all have a namespace, like what livesearch.js do.

I've digged into MLs and Plips but didn't find any info or ongoing work about this.

all js functions in plone could have a top-level namespace like 'plone', then nested namespaces for each functional area for instance. This would avoid name conflicting with other javascripts and provide a self documentation.


For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by