[JIRA] (COMETD-336) Update Dojo client to use AMD

11 views
Skip to first unread message

Dylan Schiemann (Created) (JIRA)

unread,
Feb 22, 2012, 4:06:29 AM2/22/12
to comet...@googlegroups.com
Update Dojo client to use AMD
-----------------------------

Key: COMETD-336
URL: http://bugs.cometd.org/browse/COMETD-336
Project: CometD
Issue Type: Task
Components: javascript-dojo
Reporter: Dylan Schiemann


The support for Dojo 1.7.1 and beyond should be updated to use the new AMD module format.

Perhaps in this process it would also make sense to update to use dojox/socket

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: http://bugs.cometd.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


neekfenwick (Commented) (JIRA)

unread,
Feb 27, 2012, 10:36:26 PM2/27/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10843#comment-10843 ]

neekfenwick commented on COMETD-336:
------------------------------------

A patch has been submitted on the Google Group http://groups.google.com/group/cometd-users/browse_thread/thread/bac989bc9f498f1f/eb307de13c976a60#eb307de13c976a60 but I've had trouble getting it to apply.



> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann

> Labels: dojo

rbackhouse rbackhouse (Commented) (JIRA)

unread,
Mar 28, 2012, 11:38:26 AM3/28/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10848#comment-10848 ]

rbackhouse rbackhouse commented on COMETD-336:
----------------------------------------------

I have created a pull request to add AMD support to the javascript-common code.

https://github.com/cometd/cometd/pull/7

I think this will be needed before the javascript-dojo component can be updated.



> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann

> Labels: dojo

Dylan Schiemann (Commented) (JIRA)

unread,
Apr 23, 2012, 4:21:25 PM4/23/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10871#comment-10871 ]

Dylan Schiemann commented on COMETD-336:
----------------------------------------

We're getting closer to a Dojo 1.8 release (1.5-2 months out). We'd like to see this updated to work with Dojo and AMD by then. Can I please get a status update on reviewing these early patches, or on what is needed from the Dojo side to help move this forward?



> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann

> Labels: dojo

Simone Bordet (Resolved) (JIRA)

unread,
May 21, 2012, 8:07:25 AM5/21/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Bordet resolved COMETD-336.
----------------------------------

Assignee: Simone Bordet
Fix Version/s: 2.5.0
Resolution: Fixed

This is now fixed.

It requires cometd applications that use the old Dojo style to add a call to:

{code:javascript}
dojo.registerModulePath('org', '../org');
{code}

that was implicit in CometD pre-2.5.x.

New applications that want to use the old Dojo style may now put the CometD common JavaScript library in the place they want, and adjust the call to {{dojo.registerModulePath(...)}} accordingly.

New applications that use the AMD style may want to use {{tlmSiblingOfDojo:true}} in the script configuration in their HTML (if the {{org}} directory is a sibling of the {{dojo}} directory), or specify a {{packages}} field in the configuration to {{require(...)}}.

> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann
> Assignee: Simone Bordet
> Labels: dojo
> Fix For: 2.5.0

bwa (Commented) (JIRA)

unread,
May 24, 2012, 5:41:25 AM5/24/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10889#comment-10889 ]

bwa commented on COMETD-336:
----------------------------

I'm struggling with running cometd 2.5 beta with CDN. I'm a little confused about how to load dojo/dojox from CDN and the cometd 2.5 from local. I might be because an old cometd is on the CDN Goggle api 1.7 ?

Any example of this would be nice.

> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann
> Assignee: Simone Bordet
> Labels: dojo
> Fix For: 2.5.0-beta1

Simone Bordet (Commented) (JIRA)

unread,
May 24, 2012, 1:30:25 PM5/24/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10890#comment-10890 ]

Simone Bordet commented on COMETD-336:
--------------------------------------

See: http://dojotoolkit.org/documentation/tutorials/1.7/cdn/ and http://dojotoolkit.org/reference-guide/1.7/quickstart/cross-domain.html.

Demo example: https://github.com/cometd/cometd/tree/master/cometd-javascript/examples-dojo/src/main/webapp/dojo-examples/reload.

> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann
> Assignee: Simone Bordet
> Labels: dojo
> Fix For: 2.5.0-beta1
>
>

bwa (Commented) (JIRA)

unread,
May 25, 2012, 6:01:25 AM5/25/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10891#comment-10891 ]

bwa commented on COMETD-336:
----------------------------

Awesome! Will check this out soon.

> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann
> Assignee: Simone Bordet
> Labels: dojo
> Fix For: 2.5.0-beta1
>
>

bwa (Commented) (JIRA)

unread,
May 29, 2012, 3:10:25 AM5/29/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10896#comment-10896 ]

bwa commented on COMETD-336:
----------------------------

I've tried the new demo, but one ting is not clear. /dojox exists on both local and CDN. Do I need to copy the whole 1.7.2 dojox to local and merge in the cometd 2.5 dojox ? Now it seems like the demo is trying to load all /dojox from local, and I have only the /dojox from cometd 2.5.


> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann
> Assignee: Simone Bordet
> Labels: dojo
> Fix For: 2.5.0-beta1
>
>

bwa (Commented) (JIRA)

unread,
May 29, 2012, 3:26:25 AM5/29/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10897#comment-10897 ]

bwa commented on COMETD-336:
----------------------------

I did copy all the 1.7.2 dojox stuff to my application, and it seems like all GET is resolved Ok, but this message occurs in my console

org_cometd.JSON is undefined:

org_cometd.JSON.toJSON = JSON.stringify;

This is in the file cometd.js

> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann
> Assignee: Simone Bordet
> Labels: dojo
> Fix For: 2.5.0-beta1
>
>

bwa (Commented) (JIRA)

unread,
May 29, 2012, 3:45:25 AM5/29/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10898#comment-10898 ]

bwa commented on COMETD-336:
----------------------------

I have copied all the 1.7.2/dojox to local and merged in cometd from cometd 2.5. Now I'm getting a GET /js/org/cometd.js and this file is not found, and it shall not exist ? See attached screenshot

> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann
> Assignee: Simone Bordet
> Labels: dojo
> Fix For: 2.5.0-beta1
>
>

Simone Bordet (Commented) (JIRA)

unread,
May 29, 2012, 3:54:25 AM5/29/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10899#comment-10899 ]

Simone Bordet commented on COMETD-336:
--------------------------------------

Good catch !

I think that CometD's Dojo binding should move to {{/dojox/cometd/main.js}} instead of {{dojox/cometd.js}}.
In this way, you can map in the {{packages}} configuration just for CometD, keeping all the rest at the CDN.

{code:javascript}
require({
packages: [{
name: 'dojox/cometd',
location: '/dojox/cometd'
},{
name: 'org',
location: '/org'
}]
},
...
);
{code}

Let me try this solution.

> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann
> Assignee: Simone Bordet
> Labels: dojo
> Fix For: 2.5.0-beta1
>
> Attachments: screenshot-1.jpg

Simone Bordet (Commented) (JIRA)

unread,
May 29, 2012, 3:56:25 AM5/29/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10900#comment-10900 ]

Simone Bordet commented on COMETD-336:
--------------------------------------

I think that for {{/js/org/cometd.js}} you have another configuration problem that is independent from this one.

> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann
> Assignee: Simone Bordet
> Labels: dojo
> Fix For: 2.5.0-beta1
>
> Attachments: screenshot-1.jpg
>
>

bwa (Commented) (JIRA)

unread,
May 29, 2012, 4:31:26 AM5/29/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10901#comment-10901 ]

bwa commented on COMETD-336:
----------------------------

Hey, this support i FAST ! Great.
I have updated the package ref to /dojox/cometd, and have only dojox/cometd (and org) locally. But now I miss two files ... :

"NetworkError: 404 Not Found - https://localhost:9451/ASAPTrigger/js/dojox/cometd/main.js"
"NetworkError: 404 Not Found - https://localhost:9451/ASAPTrigger/js/org/cometd.js"

I don't understand where these references come from....

> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann
> Assignee: Simone Bordet
> Labels: dojo
> Fix For: 2.5.0-beta1
>
> Attachments: screenshot-1.jpg
>
>

Simone Bordet (Commented) (JIRA)

unread,
May 29, 2012, 4:36:25 AM5/29/12
to comet...@googlegroups.com

[ http://bugs.cometd.org/browse/COMETD-336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10902#comment-10902 ]

Simone Bordet commented on COMETD-336:
--------------------------------------

Please comment on COMETD-375.

> Update Dojo client to use AMD
> -----------------------------
>
> Key: COMETD-336
> URL: http://bugs.cometd.org/browse/COMETD-336
> Project: CometD
> Issue Type: Task
> Components: javascript-dojo
> Reporter: Dylan Schiemann
> Assignee: Simone Bordet
> Labels: dojo
> Fix For: 2.5.0-beta1
>
> Attachments: screenshot-1.jpg
>
>
Reply all
Reply to author
Forward
0 new messages