Login Register

[documentation] custom widgets with aol cdn build tutorial

Hi all,
I was not able to find any documentation on building a custom dojo widget that uses dojo from the CDN. Therefore, I spent some time figuring it out myself and created a small tutorial:
http://nileshbansal.blogspot.com/2008/03/creating-custom-dojo-widget-usi...

Now I am not sure, how this tutorial can be included on this site (say in http://dojotoolkit.org/key-links or moving to the book or someplace else) so that others having the same questions can easily locate the answers. Any thoughts?

thanks
Nilesh

Thanks for taking the time

Thanks for taking the time to write it up. I'm not sure how the key-links set is managed, but here I think the following change should be made to your write-up:

You should not code the .xd.js file by hand, but instead run it through the dojo build process. Set up a build profile that has a dependencies.prefixes entry for "blogscope" to a path on your local disk, then run the dojo build process with loader=xdomain, and in the release folder you will get the .xd.js files generated for you.

It is recommended you use the build tool since the format of the .xd.js file may change over time. In fact, it has changed in Dojo 1.1 for multiversion support.

Thanks for the comment. I

Thanks for the comment. I did try to use the dojo build process at first, but I was not able to figure out how exactly to use it. After a few hours of unsuccessful fiddling around with profiles and build system, I discovered, writing these files by hands is easier (which may not be the case in long run). I would appreciate if someone could actually post a tutorial on how to use the build system for the purpose of generating the .xd.js file for third-party custom widgets. In the mean time, I think, manual authoring on .xd.js files would help people like me.

PS: I have updated the post on my blog to reflect on your comment.

specify loader=xdomain

To get x-domain capable versions of your modules, create a build and specify the "loader" flag with a value of "xdomain". You'll need to ensure that your custom modules are included in the "prefixes" area of your profile file, but assuming that works for you, the generated copy of your scripts will all include the x-domain wrapping data and you should then be able to publish your module as an x-domain-loadable resource.

That said, I'm not sure you actually need to do this.

Using an x-domain version of Dojo doesn't mean that your particular modules need to be x-domain processed. It seems the book is silent on this point today. I'll ping James and see if he can't add the relevant details.

Regards

--
Project Lead, The Dojo Toolkit
President, The Dojo Foundation