Skip to end of metadata
Go to start of metadata

We need to build dojo/rforms for performance reasons.

Dojo has a modular approach to code. It loads whatever modules are needed when they are needed (based on "require" function). This means that each module/class is loaded separately, thus worsening performance.

Documentation on custom builds is here.

The goal of a custom build is:

  • to combine classes in layers - these are classes that are used on same page(s). For example, if a page uses classes Form and Button, normally the files Form.js and Button.js will be downloaded one by one. We can instead create a layer called "ui-components" that will combine code of two classes so that it could be retrieved with a single http request.
  • to optimize code using shrinksafe.

This is how we build dojo and rforms:

  1. Download dojo 1.6.1 src from and unzip in some folder - lets say dojo-src. Following folders will be inside: dojo, dijit, dojox, util.
  2. Copy rforms and rdfjson folders in dojo-src as well.
  3. Create file p.js and copy following inside:

    Change if needed.

  1. Go to dojo-src/util/buildscripts and execute

This will create dojo-build-1.6.1 folder and will place dojo and rforms "compiled" files there.

  1. Find dojo-build-1.6.1\dojo\dojo1.js and dojo-build-1.6.1\dojo\nls\dojo1_en-us.js and copy them to rforms's project (eg trunk\research-space-rforms\src\main\resources\rforms\lib\dojo\dojo and nls folders).
  1. Include dojo1.js in your html page

Errors that were encountered:

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.