The release of Dojo 0.9 on August 20th marks a return to our roots: fast and lean. As Alex mentioned in a previous post, the surface area of the API has been reduced. With this API refactor, things were bound to be left out, and rightly so. The “core” of Dojo needed to be lean so we cut out the fat. But cutting out the fat sometimes removes some useful functions that people use. Fortunately, Dojo 0.9 makes it easy to add features on to it with little hassle.
One feature that wasn’t ported to 0.9’s AJAX IO was multipart transfers. I stumbled across this casualty of the refactor while working on a side-project: a port of Eugene Lazutkin’s webui for OpenWRT from Dojo 0.3 to 0.9. webui is a configuration interface for OpenWRT that takes the approach of trying to do most CPU and RAM intensive operations in the browser rather than use the limited CPU and RAM of the router. For example, when you edit the rules for the router’s firewall, the firewall rules file is downloaded to the browser and dissected in JavaScript. This makes it very easy to add rules in the right places and delete the correct rule without tasking the router with this work. After you’ve modified the firewall rules to suit your needs, the file is re-assembled and uploaded to the router using a multipart transfer. Because of this functionality, multipart transfers are vital to this application.
(more…)