Getting started with Dojo

Introduction

This article is intended for developers who might consider Dojo for their applications. I assume you understand the basics and you did read the getting started articles/tutorials from dojotoolkit.org.

Recommended Setup

        1. There is no better IDE around than PHPStorm or WebStorm, except you’re writing even SMS with VIM & friends. However, install the “More Dojo” PHPStorm plugin and you get lots of neat coding tools and templates & proper syntax highlighting. Follow all the steps and adjust the Plugin. It also cleans your code from unnecessary AMD modules.
        2. Go Linux or Macintosh, seriously otherwise you will spend a lot of time to get 3th party tools or the compiler working. There are also many, MANY other reasons to not use Windows for serious web development tasks; most important is: don’t be late with recent technologies!
        3. Get a project template from Github:
        4. Download the entire Dojo source code (use the ‘dojo-boilerplate’ project template)! Whilst its very tempting and easy to follow the reference guide on the Dojo’s main page which suggest to include Dojo from CDN, you actually can save time by having the entire source directly in your project. Its including also more illustrative test units and demo applications. To install the entire Dojo framework, its just one line on the shell:

Recommended Links

There are already many plugins and components:

Sandboxes

Recommended plugins

That are some must have plugins:

          • dgrid (lists and grids, provides modern infrastructure for unit-tests, using ‘intern’ and ‘Selenium’)
          • cbtree (check box tree, little outdated but great widget)
          • only as reference(not a plugin), IBM’s recent work (complete re-work for widget infrastructure, documentation, code style guide and testing; recommendable when working on large applications)

Those components might not be of interest for you but I urge you to have a look at them. DGrid and IBM-Js make use of modern techniques like JSDoc and unit testing(intern) which are completely different from the current Dojo toolkit. Dojo-2 will update to those techniques and therefore you’re “in” now!

Example applications beyond the kitchen-sink & Dojo for PHP developers:

Attention, self promo : we’ve created an orthodox file manager  (demo) which makes use of:

      • ‘dgrid’
      • ‘cbtree’ (has also PHP examples)
      • JSON-RPC-2.0 with additional signing
      • a Dojo theme based on ‘claro’ but works with classic jQuery themes
      • Dojo’s SMD proposal (you can switch to JSONP if you like)
      • Node.JS for hot-reloading Dojo/AMD modules in your application, useful for prototyping or tuning large applications which are not fitted for jsFiddle. See the xDojoWatch repo.

Dojo for Java developers

      • You can build on the good old ‘Struts’ which provides JSON-RPC-2.0 filter which works well with Dojo’s SMD proposal
      • TBC

Even more examples

1. Dojo’s source code includes a little application which includes all widgets. You can open it here: http://x4dojo.org/dojo/dijit/themes/themeTester.html

You can browse the source code here http://x4dojo.org/xbox-app/ (soon a real Dojo-Fiddle)

Tbc soon!