After hearing some rave reviews of Dojo on django-dev, I finally got around to checking it out today. Here are my thoughts (with an obvious focus towards) using Dojo with Django).
The good
Dojo is extremely powerful. With very little code I was able to make a really nice drag-and-drop reorderable table, complete with nice zebra striping and add/remove row buttons. (Wilson and I are working on a new kick-ass interface for Django’s “edit_inline” admin views, if anyone cares.)
I find the event system particularly awesome; the fact that the drag-and-drop code generates dragStart and dragEnd events (and friends) lets you do some really powerful stuff. In particular, you can copy (instead of move) the node on an option-drag and with that get yet another step closer to desktop-app usability.
I also like the dojo.require system of loading in bits that you need. All told Dojo is really large — over two megs of code — so some system like this is obviously needed. Props to the team for choosing a nice simple way of doing it.
Dojo’s code itself is quite well written, and most of the time well-commented. There’s some weird idioms in the code — I find the whole extension mechanism a little hard to follow — but they’re easy to get over.
I’m also a big fan of the convenience functions in dojo.dom. They’re the type of functions any Javascripter writes over and over again, so it’s nice to just have them there for you.
The bad
Dojo is really big, both in terms of download size and API size. The second isn’t much of a problem (more on that later, though), but the download size is a sticking point.
The require mechanism and the different downloadable versions are a good way of trying to keep page weight down, but there’s still a noticeable delay the first time I hit a Dojo page without any caching. I’m not sure there’s a way around this, and for a big app like Django’s admin I don’t think it’s an issue. Still, there’s probably more work that could be done here.
As I said, the API size isn’t too much of a problem — or rather, it wouldn’t be, if the documentation was any good. Which brings me to:
The ugly
I would say that Dojo’s documentation sucks, except that there’s no “it” to be sucky. I was eventually able to figure out what I wanted to do be reading through the code, but the fact is that it took me over an hour to write what amounted to 30 lines of code.
This leaves me in a pretty annoying situation: I’m very excited about the cool shit we could do with Django and Dojo, but I fear that without better documentation I’ll probably spend most of my time just reading through Dojo’s code. Yes, it’s well-written, but that’s no excuse for the sorry state of end-user documentation.
Now, I know first-hand how much effort writing good documentation can be — scratch that; writing any documentation is extremely hard — and I’m sure the Dojo folks don’t need me to tell them that they need to get their shit together. All I’m trying to say is that I really hope Dojo’s documentation gets a lot better so I can spend more time using it, and less time scratching my head.
Eugene Lazutkin
Dec. 19th, 2005
6:41 p.m.
A lot of stuff is getting documented as we speak. If you do svn checkout, you will find a lot of documents under "trunk" in "documents". They are unpublished as of yet, but quite usable, if you don't mind ReST. I hope it helps.
Jacob
Dec. 19th, 2005
7:16 p.m.
Ooh, I love ReST :)
I'm checking it out now...
Jeremy Dunck
Dec. 23rd, 2005
12:44 a.m.
Now docs are up here, too:
http://manual.dojotoolkit.org/index.html
Alex Russell
Dec. 23rd, 2005
5:59 a.m.
Jacob,
I'm glad you're finding Dojo less sucky than other ways of doing things.
RE: download size:
If you're not working from a build, the load times are likely to be pretty bad given the synchronous nature of the package system. If you *are* working from a build, we should make sure that what you need for what you're doing is baked into the build. I'd be happy to have Dojo maintain a Django profile so that you only get what you're using. Also, something like mod_deflate does *wonders* for loading modern JS libraries.
Regards
gary
March 24th, 2006
3:50 p.m.
Dojo in my opinion is nothing more than a cool toy. Without documentation it is useless to for any real applications. I find myself spending 20 to 30 times more time figuring out what is happening (in Dojo) than I do writing code. I will say once I have figured it out Dojo is great. The reality is unless you are just playing you can not spend the time Dojo requires.
Recently when we decided not to use Dojo on a project here is the analogy I used:
It's like putting a private pilot who has only been at the controls of single engine aircraft in the cockpit of a 747. Sure he knows how to fly but without some type of training (documentation) he would be lost at the array of controls.
I guess we are all lucky the FAA requires reams of docs
Batiste Bieler
April 16th, 2007
7:12 a.m.
I am glad that Django admin get some ajaxy stuffs. But why have you choosed Dojo instead of simpler framework like JQuery ?
For example, there is a nice JQuery plugin for table sorting :
http://motherrussia.polyester.se/docs/tablesorter/
Jeremy Dunck
April 16th, 2007
7:28 a.m.
Batiste,
This post is pretty old (Dec 2005), and you may note that Dojo still isn't integrated in Django. You illustrate the reason the integration wasn't done-- different people like different JS tools, and there wasn't really an 80/20 JS choice.
You get to choose. ;-)
mike
May 23rd, 2007
7:41 a.m.
You should definetly check out jQuery.
imho the best toolkit ever!
Frédéric
May 26th, 2007
5:37 a.m.
jQuery + ExtJS is a great combination.
Umbertoh
Nov. 15th, 2007
5:21 p.m.
YUI is a favorite of mine... doesn't have all the gadgets but you can build them... much like django... KISS, DRY, etc. etc. love it.
...and it's backed by a serious development team... much like django (seriously... django is pretty serious right?)
C Keene
Feb. 25th, 2008
11:05 a.m.
We are using Dojo 1.0 (released 11/07) for WaveMaker and finding that it seriously rocks. The Dojo community has responded to the criticisms about download size and documentation. We at WaveMaker have contributed a Grid widget, so there is a very powerful widget set in place now.
If you want to see what Dojo can do, download WaveMaker at
http://www.wavemaker.com/downloads
The entire studio is build using Dojo, in fact, we built the WaveMaker studio in Wavemaker!