In a prior article
The 8.5 kit install of DDE supplies the .js source files, while the 8.5 Domino server kit supplies both the .js layer file and a gziped copy of it - it has a .js.gz extension and is as small as possible.
Here's a table that shows the impact of packaging:
Dojo Layer Build
View, 8.5 Discussion app
26 requests ( 24% )
535 KB ( 69% )
Document in Read mode 'Main Topic'
1 request ( 25% )
Document in Edit mode 'Main Topic'
42 requests ( 75% )
171 KB ( 66% )
In order to use the Dojo build tools, we'll need to create a directory structure somewhere (ex. c:\temp ) for the build process. It should look like this:
Put the 'ibm' directory from the 8.5 DDE install: \data\domino\js\dojo-1.1.1\ibm into the above -ibm directory.
Download Shrinksafe from the Dojo site: http://download.dojotoolkit.org/release-1.1.1/ and unzip into the above -shrinksafe directory.
Download the Dojo 1.1.1 sources from the same site, and put them into the above -src directory.
Unzip the dojo-release-1.1.1-test.zip file attached to this document into the above -test directory - it contains the implementation of the 'TestRichTest' class in TestRichText.js, the build.cmd file, and the test.profile.js build profile.
(If gzip.exe is not on your path, you may want to download it from http://www.gzip.org/ and place it here as well.)
The contents of TestRichText,js are explained in the earlier article describing how to extend Domino's rich text editor.
The build.cmd file creates the environment needed by the Dojo build and runs it, then makes a copy of the result before invoking gzip, because gzip replaces the input with the output, then copies the .gz files back to the work directory.
This is the line which sets the options for the Dojo build:
call build action=release profile=test symbol=short optimize=shrinksafe cssOptimize=comments version=%DojoVersion%
The 'profile=test' is what points the build to our 'test.profile.js' file - the other options are well documented here:
Take a look at the 'test.profile.js' file - you'll see that it identifies the contents of the layer file, and because it's in its own package ('test'), it provides the path - relative to dojo.js - to the test directory.
To run the build, open a command prompt window in the the dojo-release-1.1.1-src directory and set the DojoSourceDir environment variable to the above -src directory:
c:\temp\\dojo-release-1.1.1-test > set DojoSourceDir=C:\temp\dojo-release-1.1.1-src
and then run the build:
c:\temp\\dojo-release-1.1.1-test > build.cmd
This will create a 'work' directory (c:\temp\dojo-release-1.1.1-test\work) where the build takes place, and the result will be placed in the 'work\release\dojo' directory (c:\temp\dojo-release-1.1.1-test\work\release\dojo). Here you will find all the layer files and their .gz counterparts, just as the Domino server kit installs them.
Copy the 'test' directory to your Domino server's data\domino\js\dojo-1.1.1 directory, restart the http task, and your class is in production. You can use tools like FireFox's firebug to get the statistics that show how much this saves for you.