[dojo-contributors] common cometd.js for dojo & jquery

Greg Wilkins gregw at mortbay.com
Tue May 5 22:05:33 EDT 2009

Peter E Higgins wrote:
> What is wrong with maintaining is as if it were like sizzle? The real
> thing needed here is a dojo.provide() call, and perhaps a dojox.cometd =
> org.cometd; in the footer. Why can't Dojo "maintain" it's own dojox
> cometd from an external repo. The cometd and dojo projects are under the
> same CLA's no? We could just add the two required lines and leave in
> DojoX as "the Dojo port", and allow all the other libraries to include
> their own packaging in their own versions. Patches could be applied if
> the only natural diff was the two lines and we get to keep the module on
> the CDN's.

If dojo was always built with maven.... then the approach I would
take is for dojox.cometd to consume org.comet javascript as a source
artefact - and auto apply patches to it to wrap the provides and
dojox.cometd= around it.

This would work fine and avoid the risk of patches being made to
dojox version and not feed backstream to the cometd project.

Perhaps the existing build tools could be modified to support
this, but it would still break the run-from-source style of
dojo development.

I sounds like dojo.require("org.cometd", true);  is the closest
thing we have, except that as James has said, it will not
well participate in module loading with onLoad events etc.
Using that will probably work, but I expect might result in
a constant stream of user problems from the onload issues that
James highlights.

So perhaps putting

if(typeof dojo != "undefined"){

in all the org.cometd source files is the best way to go.
It does give dojo some preferred status in cometd, but then
it is a dojo foundation project after all!

My only concern is that we might still need to faff about
with module paths, which will somewhat deprecate the
niceness of just doing a dojo.request("dojox.cometd");

Maybe if the source directory from org.cometd project was
svn cross mounted into dojox/cometd/cometd that could
resolve the module path issue, but it would give us
a mount that would need to be updated to cometd tags
every so often?


More information about the dojo-contributors mailing list