Archives Posts
DOJO needs a package managment!
I needed some locale date and number parsing fucntion for javascript today. As it goes for what the user sees i do usually do parsing and validation on the server-side. But this time i needed something for an admin interface that does also some javascript-based price calculation on the client-side.
So far i searched via Google for Prototype-based Libs on i18n, sprintf and so on. I found JEL (JavaScript Enhancement Library) and gave it try, but hardly to say: it is too bloated and the author implemented much english-language based method, but so far no sprintf, which i find is essential. And in overall the lib was ober 200KB for only doing I18n stuff!
Then i found out DOJO implements Date.POSIX and also a a String.sprintf that seemed very complete and began browsing the DOJO-Website. DOJO so far is IBM-sponsored and it was nice to see it reached a mature stage of development. I don’t like the namespaced function calls in JavaScript much, but on the server side doing java stuff like in GWT would be nice with that.
Still one big problem remains with DOJO: it just fucking hangs my browser and loads too damn slow!
DOJO has a nice dojo.require() which loads required dependencies on-the-fly. I had my own approach on that via the Prototype-based Postload.js. But the main problem with DOJO is that every class has again it’s own dependencies. You just have to inlcude one line of javascript in your HTML header, but when you do following require-statements…
dojo.require("dojo.currency");
dojo.require("dojo.i18n");
… it results in firing up about 40 requests on .js-files! That’s horrible! No wonder, my little Firefox hangs until all files are loaded! So, please, don’t harm the web, DOJO!
I don’t know if there is any solution out by the DOJO team, so please tell me. My conculusion so far is that for default load process of the website the dependencies should be resolved before the page is even sent to the browser. The browser should have just to load one JavaScript-file that is compressed and contains all default dependencies used by DOJO on the page. So far that can only be done having a little reference of all dependencies, so the haeder can be written accordingly.
If there isn’t such a thing someone should do that! So far I think think DOJO is a good for my future use, as long as there isn’t an Prototype- or jQuery-equivalent for i18n.
KAURI has also a nice comparision chart of JavaScript-libraries.
UPDATE #1: Probably i could now also check out localisation-support for Ext.js… which seems to miss parse()-functions (or does it automatically). And in overall i don’t find any great localisation support either
UPDATE #2: There seems to be such a thing for DOJO called DOJO Build System that uses ant. It could be used as base for automatic server-side file generation in PHP… great
I just everyone who uses DOJO is also using it, otherwise I am gonig to hate your websites!

If you look at todays web 2.0 sites you will realize there is often a heavy load on external JavaScript resources, CSS files and probably images. Above compressing and optimizing the files and merging multiple files (also background-images), there is not much room to further optimize the page loading process.