The CometD project just announced their first 2.5 beta, which adds AMD support to their Dojo-based JavaScript client, as well as their jQuery client with an AMD loader.
The release notes contain full details. They have set things up such that it will work with AMD syntax, and still work with the legacy dojo.require/dojo.provide syntax.
If you are using the require/provide syntax, you need to register a module path prior to requiring dojox.cometd:
dojo.registerModulePath("org", "../org");
dojo.require("dojox.cometd");
For AMD applications, either use the “tlmSiblingsOfDojo: true” configuration attribute, or use a configuration object specifying the “packages” field and map that to the location of cometd.
CometD 2.5.x ships updated demos that you can use as examples:
* Dojo 1.7 AMD-style demo: the Reload demo, the Chat demo
* Dojo 1.7 non-AMD demo: the Echo demo, the TimeSync demo
Please report any bugs you find to the CometD issue tracking system.
For Dojo 1.8, we will remove dojox/cometd from the repo, and add an svn:externals to the CometD project source code.
Great news ! This will be checked out soon ! Thanks
Hello,
We are regularly testing upgrade of different components in our application and dojo happens to be one of those components. We tested Dojo 1.8.0 that required code change in our application based on your recommendation to add
dojo.registerModulePath("org", "../org");
dojo.require("dojox.cometd");
where dojo.required for cometd is used and that fixed the problem. However, the latest Dojo 1.8.3 (and 1.8.2) with the above change still give us problem and cometD messages are not being displayed on the client side. Do you have any recommendation for the latest version of Dojo?
Any help and direction is much appreciated.
Regards,
Rasoul