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

Kris Zyp kzyp at dojotoolkit.org
Fri May 29 12:36:46 EDT 2009


In the previous version of Dojo's CometD, all received messages are
published on Dojo's pubsub system. For example if you did:
dojo.subscribe("/cometd/foo", function(){ ..});
And a comet message was received with a topic of "/foo", I believe this
would trigger this subscriber. It doesn't look this would continue to
work with the new cometd.js. Also, the prefix (like "/cometd") was
configurable, which is valuable for situations where you are connecting
to multiple cometd servers (each with their own topic spaces).
Kris

Greg Wilkins wrote:
> All,
>
> Simone and I now have the common cometd.js working with the dojo loader.
>
>
> It is in the http://svn.cometd.org/trunk repository and when it builds
> (using maven) it takes the release of dojo 1.3 and exclude dojox/comet.js
> and dojox/cometd/ directory.
>
> It then replaces it with a new dojox/cometd.js file which does
>
>   dojo.provide("dojox.cometd");
>   dojo.registerModulePath("org","../org");
>   dojo.require("org.cometd");
>
>   org.cometd.JSON.toJSON = dojo.toJson;
>   org.cometd.AJAX.send = function(packet)
>   {
>     ...
>   }
>
> So for now it has the common js in the org/cometd.js location.
> This avoids cross mounts for now and just shows that it works.
>
> The main extensions (timestamp, timesync and ack) are loaded in the
> same way.
>
> Both long poll and xd transports always loaded.  There is no
> longer the option of form encoding the long poll transport.
>
> The jquery API was a little different, but we've done the work
> so almost all existing code will work. I'd be interested in
> hearing feedback to that effect (or otherwise).
>
>
> I think we should let this be used from this build for a
> few weeks at least before we contemplate replacing the
> current version in dojox.
>
> cheers
>
>
>
>
>
>
>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
>
>   


More information about the dojo-contributors mailing list