Support for AMD Loaders #7

wants to merge 1 commit into


None yet
2 participants

The OpenCoweb project ( has been using the cometd javascript in an AMD environment for a while now. We have been wrapping the code with a "define" call and it has been working fine.

I saw in that there is plan to add AMD support. I thought I would put together a patch that enables AMD support while keeping backward compatibility.

I have also strengthened the dojo provide check to make it more robust. That path should only be called when Dojo is being run in sync mode.

The AMD define call is only made if the AMD check passes :

if (typeof define === "function" && define.amd)

I have also added AMD support to all the extensions too.

I should note that when I forked the cometd repo one of the tests was failing :


I think it might be due to the fix for COMETD-343 as all the tests were passing about a week ago.

My changes do not appear to break anything else

This comment has been minimized.

Show comment Hide comment

sbordet Nov 23, 2012


Support for AMD has been introduced in CometD 2.5.0.


sbordet commented Nov 23, 2012

Support for AMD has been introduced in CometD 2.5.0.

@sbordet sbordet closed this Nov 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment