Chandler Server Powered By Dojo 1.0.2
April 7th, 2008 at 2:28 pm (1 month, 1 week ago) by travis under Chandler Hub Service, Chandler Project, Chandler Server DevelopmentThe 0.14.0 release of Chandler Server, pushed live to our open service Chandler Hub on Friday, boasts few obviously new features. Instead we’ve taken this release to merge a branch of development that has been open for several months which moves us to the 1.0 line of the Dojo Javascript Toolkit. Hopefully Hub users have already noticed improved load times and a generally snappier interface as a result of this upgrade, but unsurprisingly the most exciting improvements are in the code.
The first changes I’m excited about are, like our latest release, less wholesale modifications than improvements and commitments to stable APIs with performance enhancement sugar to sweeten the deal. Dojo’s internationalization (i18n) and event APIs have matured to the point where developers can expect to rely on them without fearing a future change like the one we’ve just experienced. As a result we’ve begun the process of migrating our custom i18n code to Dojo’s API, away from the custom, backend dependent code we’ve used in the past. We’ve also started streamlining our use of Dojo’s topic APIs to make our code easier to read and understand. Both these processes are works in progress, so keep an eye on this space for more detailed information in the future.
Several components have also seen essentially complete overhauls, most prominently
the XMLHttpRequest wrappers and Dijit, the full featured HTML/CSS UI toolkit built on
Dojo Core. Instead of using dojo.io.bind and passing callback functions,
method, and header information dojo.xhrGet, dojo.xhrPost and a
handful of other methods accept a variety of arguments, make HTTP requests and return
dojo.Deferred objects. This return value, a port of the asynchronous
task management API introduced by Python’s
Twisted networking library, provides an easy way for developers to manage complex
sets of asynchronous actions like server requests. Since our Web UI data APIs already used
dojo.Deferred internally, this change led to a very nice code reduction.
Dojo’s user interface building API, Dijit, has been greatly improved since Dojo 0.4. In addition to moving to its own namespace as part of Dojo’s overall API flattening, Dijit is better streamlined, better tested, and easier to use. A number of Chandler Server UI components have been ported to the Dijit APIs, and are, as a result, better tested, more modular, and closer to being embeddable outside of our Web UI.
The Dojo team has also been hard at work putting together the next generation of Javascript tools to support high performance rich applications on top of the Open Web. Two of these tools are already finding their way into heavy use within our code base, and are poised to become critical pieces of our infrastructure over the next year.
The first, dojo.data,
is “uniform data access layer” that allows UI components to be built without worrying
about backend data formats. Our user administration interface has been essentially
completely rewritten, but required almost no new UI code. All we had to do
was implement a dojo.data store on top of the Cosmo Management Protocol
(CMP)
and hook it up to Dojo’s
Grid widget
to get full in-place user field editing, “infinite scrolling” for handling
large numbers of users and a handful of other goodies. While our end-user calendar and
item list UIs have not been moved to this API, the ongoing
web widget project
is being built on a new dojo.data store that we hope to eventually
integrate into our current UI.
The second piece of new functionality that I’m excited about is
dojo.query. This do-it-all CSS query function
is the go-to guy for finding pieces of DOM to manipulate. The beauty of this and other
query functions is that they are based on features most web developers eventually expect
to be supported natively by all major web browsers. By allowing developers to start using
these features now we can build advanced web applications that will get trivially more
performant with time, and motivate browser developers to continue implementing this
critical functionality.
In addition to improving the tools we use to build our Web UI, Dojo’s 1.0 line has introduced some major infrastructure improvements in the form of a DOH, a new Dojo-independent testing harness, and a from-scratch rewrite of the Dojo build system. We’ve managed to port all of our tests to DOH by writing some wrappers to avoid a completely rewrite, which has allowed us to take advantage of the very nice test harness bundled with Dojo. Nearly as important as this test framework is the build system that plays a key role in transforming over 1MB of Javascript into a much more digestible 138K loaded in several different stages. The Dojo 1.0 line makes this process much cleaner and easy to understand, as well as offering advanced functionality like layering, which allows us to break our Javascript into large chunks appropriate to different pieces of our UI.
Dojo has been an integral part of our project to build a new kind of information and knowledge management ecosystem and we are lucky to be able to rely on a vibrant community of developers producing a first class piece of software. If you’re interested in digging deeper and helping us integrate even more of the exciting new functionality provided in its latest release, Dojo 1.1, please don’t hesitate to ask questions on our development list, or via IRC on irc.freenode.net in the #cosmo channel.

