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 http://download.dojotoolkit.org/release-1.6.1/dojo-release-1.6.1-src.tar.gz 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:

http://dojo-toolkit.33424.n3.nabble.com/Error-running-the-build-script-td3211076.html

http://bugs.dojotoolkit.org/ticket/5225

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