<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Digital Carpenter - Doculicious</title>
    <link>http://www.digitalcarpenter.com.au/</link>
    <description>Build the web your way</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    <pubDate>Mon, 12 Jan 2009 13:22:15 GMT</pubDate>

    <image>
        <url>http://www.digitalcarpenter.com.au/templates/competition/img/s9y_banner_small.png</url>
        <title>RSS: Digital Carpenter - Doculicious - Build the web your way</title>
        <link>http://www.digitalcarpenter.com.au/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Doculicious.com Launch FAQ</title>
    <link>http://www.digitalcarpenter.com.au/archives/25-Doculicious.com-Launch-FAQ.html</link>
            <category>Business</category>
            <category>Doculicious</category>
            <category>Startups</category>
    
    <comments>http://www.digitalcarpenter.com.au/archives/25-Doculicious.com-Launch-FAQ.html#comments</comments>
    <wfw:comment>http://www.digitalcarpenter.com.au/wfwcomment.php?cid=25</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.digitalcarpenter.com.au/rss.php?version=2.0&amp;type=comments&amp;cid=25</wfw:commentRss>
    

    <author>nospam@example.com (Chris Carpenter)</author>

    <pubDate>Mon, 12 Jan 2009 10:15:26 +0000</pubDate>
    <guid isPermaLink="false">http://www.digitalcarpenter.com.au/archives/25-guid.html</guid>
    
</item>
<item>
    <title>Decreasing AJAX web app loading times</title>
    <link>http://www.digitalcarpenter.com.au/archives/24-Decreasing-AJAX-web-app-loading-times.html</link>
            <category>Doculicious</category>
            <category>Web Development</category>
    
    <comments>http://www.digitalcarpenter.com.au/archives/24-Decreasing-AJAX-web-app-loading-times.html#comments</comments>
    <wfw:comment>http://www.digitalcarpenter.com.au/wfwcomment.php?cid=24</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.digitalcarpenter.com.au/rss.php?version=2.0&amp;type=comments&amp;cid=24</wfw:commentRss>
    

    <author>nospam@example.com (Chris Carpenter)</author>
    <content:encoded>
    &lt;p&gt;When developing &lt;a href=&quot;http://www.doculicious.com&quot; title=&quot;Create web forms that download PDF files.&quot;&gt;Doculicious&lt;/a&gt;, one of my main concerns was how fast the heavy JavaScript parts would load and run in the browser. &lt;a href=&quot;http://www.doculicious.com&quot; title=&quot;Create web forms that download PDF files.&quot;&gt;Doculicious&lt;/a&gt; uses a fairly customised version of the &lt;a href=&quot;http://dojotoolkit.org/&quot;&gt;Dojo Toolkit&lt;/a&gt;, and the raw files that were being loaded for some pages added up to over 550KB - made up of about 50 individual files, all being loaded by Dojo with its packaging system. This was fine for development and great for debugging, but I knew I had to do something before this went into production. In this post I&#039;ll talk about some of the things we use in &lt;a href=&quot;http://www.doculicious.com&quot; title=&quot;Create web forms that download PDF files.&quot;&gt;Doculicious&lt;/a&gt; to make our JavaScript smaller and load faster, but still easy to develop on. Hopefully it should be general enough to help anyone who has a site using JavaScript, but we use Dojo so is a bit focused on its packaging system which includes multiple files at run-time. If your app doesn&#039;t use Dojo but has multiple JavaScript files, you&#039;ll probably still get some benefit out of this.&lt;/p&gt;

&lt;p&gt;There are 2 main ways to speed up a JavaScript application - Make the JavaScript load faster into the browser, and make it run quicker. There&#039;s a great article at IBM developerWorks called &lt;a href=&quot;http://www.ibm.com/developerworks/web/library/wa-aj-perform/?ca=dgr-lnxw01FasterAjax&quot;&gt;AJAX performance analysis&lt;/a&gt; that goes into both of these. The first section talks about the tools to use in Web application development - &lt;a href=&quot;http://getfirebug.com/&quot;&gt;Firebug&lt;/a&gt; and &lt;a href=&quot;http://developer.yahoo.com/yslow/&quot;&gt;YSlow&lt;/a&gt;, which are both required tools on any development box I use. The next goes into reducing the network transfer time, and this is where I&#039;ll focus on what we did with doculicious.&lt;/p&gt;

&lt;h4&gt;Reducing File Size and HTTP requests&lt;/h4&gt;&lt;p&gt;The Dojo Toolkit uses a packaging system similar to Java, and it&#039;s a great way to separate out all the files and keep them organised and easy to develop. We&#039;ve created our own package for doculicious and one of our JavaScript heavy pages may require up to 50 individual files to be included. Because of current &lt;a href=&quot;http://www.ajaxperformance.com/2006/12/18/circumventing-browser-connection-limits-for-fun-and-profit/&quot;&gt;browser connection limits&lt;/a&gt;, this is way too much, and it&#039;s much better to limit the number of JavaScript files to one or two instead of loading many. &lt;/p&gt;

&lt;p&gt;What I wanted to do for doculicious was to create individual files for each JS heavy page, with each file including just the JavaScript code it needed. This individual file could then be used with the dojo.js file so that all the required JavaScript for a page would be in 2 files. Because Dojo automatically includes JS files depending on which widgets and functions are used, I needed to define which ones were used on which page so that I could join them all together. Firebug is great for this, and using the &lt;span style=&quot;font-weight: bold;&quot;&gt;Net&lt;/span&gt; tab quickly lets you see all the included JS files:&lt;/p&gt;
&lt;img src=&quot;http://www.digitalcarpenter.com.au/uploads/firebug.png&quot; style=&quot;margin: 10px 10px 0pt 0pt;&quot; title=&quot;Firebug&quot; alt=&quot;Firbug&quot; /&gt;

&lt;p&gt;My initial goal was to create a range of &quot;base&quot; files that could be concatenated together in an Ant script to create a JavaScript file for any doculicious page. Using Firebug to find the common files across each of our pages, I made a list of all the Dojo specific files that were needed, and also of our custom doculicious files. At this point I realised that each of our pages used very similar Dojo functions and widgets, so I made the decision to manually join these together into one file that could be included across all the files I needed. This is probably not the best thing to do if you are using the latest version of Dojo or another packaging system, as when changes are made it will be harder to integrate them, but our base Dojo is version 0.4.3 and I do not plan on upgrading it. We&#039;ve only found a couple of bugs over the past 18 months, so I&#039;m comfortable that this base is stable. &lt;/p&gt;

&lt;p&gt;Concatenating your JavaScript into a single file is great for production code, but you still need to develop on it. So when doing this we need to keep our individual files available for development, while having a simple process to make the production code. I use Eclipse with the MyEclipse plugin as my IDE. The JavaScript project is structured like below, with the &lt;span style=&quot;font-weight: bold;&quot;&gt;js&lt;/span&gt; folder being included in the web project so that it is deployed along with it:&lt;/p&gt;

&lt;pre&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;JavaScript Project&lt;/span&gt;
&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;buildscripts&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;build&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;functions&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;widgets&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;lib&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - build.xml
&amp;#160;&amp;#160; -&lt;span style=&quot;font-weight: bold;&quot;&gt; js&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;digitalcarpenter&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;system&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - Command.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - DocumentState.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - State.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - ...
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;widgets
&lt;/span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - Canvas.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - Elements.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - ...
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - &lt;span style=&quot;font-weight: bold;&quot;&gt;dojo&lt;/span&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - dojo_functions_widgets_minimal.js
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; - dojo.js
&lt;/pre&gt;
Underneath the &lt;span style=&quot;font-weight: bold;&quot;&gt;dojo&lt;/span&gt; folder is the &lt;span style=&quot;font-weight: bold;&quot;&gt;dojo_functions_widgets_minimal.js&lt;/span&gt; file which contains all the dojo functions and widgets that our pages need. The &lt;span style=&quot;font-weight: bold;&quot;&gt;digitalcarpenter&lt;/span&gt; folder is our base package, and contains all our individual JavaScript files, including widgets and system classes. Under the &lt;span style=&quot;font-weight: bold;&quot;&gt;buildscripts&lt;/span&gt; folder is our build file and a &lt;span style=&quot;font-weight: bold;&quot;&gt;build&lt;/span&gt; folder to hold temp files. The &lt;span style=&quot;font-weight: bold;&quot;&gt;lib&lt;/span&gt; folder holds some tools we will use later. The ant script is pretty basic, here&#039;s what it does:
&lt;ol&gt;&lt;li&gt;At the beginning we define the paths that are used and the files we are going to create.&lt;/li&gt;&lt;li&gt;We then build the directory structure for the build&lt;/li&gt;&lt;li&gt;Then in&amp;#160;&lt;span style=&quot;font-weight: bold;&quot;&gt;copy&lt;/span&gt; we move all the files we are going to use into the &lt;span style=&quot;font-weight: bold;&quot;&gt;build/functions&lt;/span&gt; and &lt;span style=&quot;font-weight: bold;&quot;&gt;build/widgets&lt;/span&gt;. Taking care to not move stuff that isn&#039;t needed, such as testing files, images and css.&lt;/li&gt;&lt;li&gt;Next we define a regular expression replace to remove all lines with &quot;dojo.require&quot; on them. This line is the way Dojo knows which files to include, and it&#039;s not needed in our final file because all the code is together. In fact things break if these are left in. Depending on which JS library you use, you may not need to do something similar when cancatenating your files together.&lt;/li&gt;&lt;li&gt;The next area is where we actually create our specific file. First we copy the base file to our working directory, then we concat all the individual files together, appending them to this file. Order may be important. Some of the widgets in our code include other widgets, so they need to be added before-hand.&lt;/li&gt;&lt;li&gt;The last step is calling ./lib/custom_rhino.jar. This is the Dojo &lt;a href=&quot;http://dojotoolkit.org/docs/shrinksafe&quot;&gt;ShrinkSafe&lt;/a&gt; application which removes comments and shrinks down the code. I highly recommend that you use this. ShrinkSafe has worked great for all of my JS, and I&#039;ve never had errors. Because it parses the JavaScript it does a great job. It will even tell me if I&#039;ve left some horrible bug in the code.&lt;/li&gt;&lt;li&gt;At the end is the &lt;span style=&quot;font-weight: bold;&quot;&gt;create&lt;/span&gt; and &lt;span style=&quot;font-weight: bold;&quot;&gt;clean&lt;/span&gt; methods you use to run the whole thing.&lt;/li&gt;&lt;/ol&gt;&lt;div style=&quot;overflow: scroll; height: 400px;&quot;&gt;&lt;pre&gt;
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;
&amp;lt;project name=&quot;DigitalCarpenter_JavaScript&quot; default=&quot;create&quot;
	basedir=&quot;.&quot;&amp;gt;
	&amp;lt;description&amp;gt;
		Creates the javascript files needed for Doculicious.
	&amp;lt;/description&amp;gt;
	&amp;lt;!-- set global properties for this build --&amp;gt;
	&amp;lt;property name=&quot;build&quot; location=&quot;build&quot; /&amp;gt;
	&amp;lt;property name=&quot;widgets&quot; location=&quot;${build}/widgets&quot; /&amp;gt;
	&amp;lt;property name=&quot;functions&quot; location=&quot;${build}/functions&quot; /&amp;gt;
	&amp;lt;property name=&quot;lib&quot; location=&quot;lib&quot; /&amp;gt;
	&amp;lt;property name=&quot;dojo_src&quot; location=&quot;${basedir}/../js/dojo&quot; /&amp;gt;
	&amp;lt;property name=&quot;dc_src&quot; location=&quot;${basedir}/../js/digitalcarpenter&quot; /&amp;gt;
	
	&amp;lt;property name=&quot;dojo_base&quot; value=&quot;dojo_base&quot; /&amp;gt;
	&amp;lt;property name=&quot;dojo_minimal&quot; value=&quot;dojo_functions_widgets_minimal&quot; /&amp;gt;
	&amp;lt;property name=&quot;base_workshop_dojo_file&quot; value=&quot;workshop_dojo&quot; /&amp;gt;
	&amp;lt;property name=&quot;document_workshop_js&quot; value=&quot;document_workshop&quot; /&amp;gt;

	&amp;lt;target name=&quot;init&quot;&amp;gt;
		&amp;lt;!-- Create the build directory structure used to create the JS files --&amp;gt;
		&amp;lt;mkdir dir=&quot;${build}&quot; /&amp;gt;
		&amp;lt;mkdir dir=&quot;${widgets}&quot; /&amp;gt;
		&amp;lt;mkdir dir=&quot;${functions}&quot; /&amp;gt;
	&amp;lt;/target&amp;gt;
	
	&amp;lt;target name=&quot;copy&quot; depends=&quot;init&quot;&amp;gt;
		&amp;lt;copy file=&quot;${dojo_src}/${base_workshop_dojo_file}.js&quot; todir=&quot;${build}&quot; /&amp;gt;
		&amp;lt;copy file=&quot;${dojo_src}/${dojo_minimal}.js&quot; todir=&quot;${build}&quot; /&amp;gt;
		&amp;lt;copy todir=&quot;${functions}&quot;&amp;gt;
			&amp;lt;fileset dir=&quot;${dc_src}/system&quot; /&amp;gt;
		&amp;lt;/copy&amp;gt;
		&amp;lt;copy todir=&quot;${widgets}&quot; includeEmptyDirs=&quot;false&quot;&amp;gt;
			&amp;lt;fileset dir=&quot;${dc_src}/widget&quot;&amp;gt;
				&amp;lt;exclude name=&quot;&lt;u&gt;_package_&lt;/u&gt;.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;ButtonField.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;InlineEditor.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;RichEditor.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;TestWidget.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;Popup.js&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;templates/*&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;templates/buttons/*&quot; /&amp;gt;
				&amp;lt;exclude name=&quot;templates/images/*&quot; /&amp;gt;
			&amp;lt;/fileset&amp;gt;
		&amp;lt;/copy&amp;gt;
	&amp;lt;/target&amp;gt;
	
	&amp;lt;target name=&quot;remove_dojorequires&quot; depends=&quot;copy&quot;&amp;gt;
		&amp;lt;replaceregexp match=&#039;dojo.require&#039; replace=&quot;//dojo.require&quot; byline=&quot;true&quot;&amp;gt;
			&amp;lt;fileset dir=&quot;${widgets}&quot;/&amp;gt;
		&amp;lt;/replaceregexp&amp;gt;
		
		&amp;lt;replaceregexp match=&#039;dojo.require&#039; replace=&quot;//dojo.require&quot; byline=&quot;true&quot;&amp;gt;
			&amp;lt;fileset dir=&quot;${functions}&quot;/&amp;gt;
		&amp;lt;/replaceregexp&amp;gt;
	&amp;lt;/target&amp;gt;

	&amp;lt;target name=&quot;document_workshop&quot; depends=&quot;remove_dojorequires&quot;&amp;gt;
		&amp;lt;copy file=&quot;${build}/${base_workshop_dojo_file}.js&quot; 
                               tofile=&quot;${build}/${document_workshop_js}.js&quot; /&amp;gt;
		&amp;lt;!-- NOTE: The order of the below files is important -
		            later code expects the previous code to be available --&amp;gt;
		&amp;lt;concat destfile=&quot;${build}/${document_workshop_js}.js&quot; append=&quot;true&quot;&amp;gt;
	    	&amp;lt;filelist id=&quot;dw_functions&quot; dir=&quot;${functions}&quot;&amp;gt;
			    &amp;lt;file name=&quot;Utils.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;SHA1.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;Constants.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;Command.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;DocState.js&quot;/&amp;gt;
			&amp;lt;/filelist&amp;gt;
			&amp;lt;filelist id=&quot;dw_widgets&quot; dir=&quot;${widgets}&quot;&amp;gt;
				&amp;lt;!-- file name=&quot;Resizer.js&quot;/ --&amp;gt;
			    &amp;lt;file name=&quot;ImagePicker.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;FloatingImagePicker.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;TextField.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;Element.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;Canvas.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;ColorPalette.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;FontSizePicker.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;FontPicker.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;RichTextToolbar.js&quot;/&amp;gt;
			    &amp;lt;file name=&quot;Dialog.js&quot;/&amp;gt;
			&amp;lt;/filelist&amp;gt;
	  	&amp;lt;/concat&amp;gt;
	  	
	  	&amp;lt;antcall target=&quot;-rhino-compress&quot;&amp;gt;
			&amp;lt;param name=&quot;srcFile&quot; value=&quot;${build}/${document_workshop_js}&quot; /&amp;gt;
		&amp;lt;/antcall&amp;gt;
		&amp;lt;!-- Copy the completed file to the js/dojo directory - 
                           will overwrite the one already there --&amp;gt;
		&amp;lt;copy overwrite=&quot;true&quot; 
                               file=&quot;${build}/${document_workshop_js}.js&quot; 
                               tofile=&quot;${dojo_src}/${document_workshop_js}.js&quot; /&amp;gt;
	&amp;lt;/target&amp;gt;
	
	&amp;lt;target name=&quot;-rhino-compress&quot; unless=&quot;nostrip&quot;&amp;gt;
		&amp;lt;copy overwrite=&quot;true&quot; file=&quot;${srcFile}.js&quot; tofile=&quot;${srcFile}.uncompressed.js&quot; /&amp;gt;
		&amp;lt;java jar=&quot;./lib/custom_rhino.jar&quot; 
                              failonerror=&quot;true&quot; 
                              fork=&quot;true&quot; 
                              logerror=&quot;true&quot; 
                              output=&quot;${srcFile}.js&quot;&amp;gt;
			&amp;lt;arg value=&quot;-strict&quot; /&amp;gt;
			&amp;lt;arg value=&quot;-opt&quot;/&amp;gt;
			&amp;lt;arg value=&quot;-1&quot; /&amp;gt;
			&amp;lt;arg value=&quot;-c&quot; /&amp;gt;
			&amp;lt;arg value=&quot;${srcFile}.uncompressed.js&quot; /&amp;gt;
		&amp;lt;/java&amp;gt;
	&amp;lt;/target&amp;gt;
	
	&amp;lt;target name=&quot;create&quot; depends=&quot;clean, init, copy, remove_dojorequires, document_workshop&quot; 
                          description=&quot;creates the javascript files&quot;&amp;gt;
		&amp;lt;echo message=&quot;All done! :)&quot; /&amp;gt;
	&amp;lt;/target&amp;gt;

	&amp;lt;target name=&quot;clean&quot; description=&quot;clean up&quot;&amp;gt;
		&amp;lt;!-- Clean up the files used --&amp;gt;
		&amp;lt;delete dir=&quot;${build}&quot; /&amp;gt;
		&amp;lt;delete dir=&quot;${widgets}&quot; /&amp;gt;
		&amp;lt;delete dir=&quot;${functions}&quot; /&amp;gt;
	&amp;lt;/target&amp;gt;
&amp;lt;/project&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Cool, we&#039;ve now got our Ant file ready to create the individual files. The example above creates only one file. Our production one creates a couple of different files. Because this allows you to pick and choose individual files you can customise the generated JS very specifically. Doculicious has two main &quot;applications&quot;. One is the front end web form and the other is the template/style creator. They use similar functions and widgets, but doing it this way I can save about 30kb on the uncompressed files by only including the stuff each page needs. &lt;/p&gt;

&lt;p&gt;Now when I&#039;m developing on my code I can just comment out the single file call at the top of the HTML page and uncomment the dojo.require lines to use the individual files, allowing us to program on nicely formatted files that have comments and line breaks. When everything&#039;s tested and ready for prod we just re-comment the dojo.requires, uncomment the individual line, run &lt;span style=&quot;font-weight: bold;&quot;&gt;ant create&lt;/span&gt; and increment the jsVersion variable so that clients get the new version.&lt;/p&gt;
&lt;div&gt;&lt;pre&gt;
&amp;lt;!-- Comment out the following line to test the individual js files
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;http://www.digitalcarpenter.com.au/js/dojo/document_workshop.js?v${jsVersion }&quot;&amp;gt;&amp;lt;/script&amp;gt;		 
--&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
	&amp;lt;!-- Uncomment these to test the individual js files--&amp;gt;
	dojo.require(&quot;digitalcarpenter.widget.Element&quot;);
	dojo.require(&quot;digitalcarpenter.widget.Canvas&quot;);
	dojo.require(&quot;digitalcarpenter.system.DocState&quot;);
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now our production code is all nicely together in one file. We still have commented and formatted code to develop on, and running it all through ShrinkSafe has also lowered the file size. Our uncompressed file has gone from 370KB to 262KB, but most importantly we&#039;ve gone from about 50 individual file calls to 2. The file size still seems large, but with mod_deflate on Apache2 it comes down to 68KB and with aggressive caching, clients should only need to download it when we change it.&lt;/p&gt;


  &lt;div class=&quot;flockcredit&quot; style=&quot;text-align: right; color: #CCC; font-size: x-small;&quot;&gt;Blogged with the &lt;a href=&quot;http://www.flock.com/blogged-with-flock&quot; style=&quot;color: #999; font-weight: bold;&quot; target=&quot;_new&quot; title=&quot;Flock Browser&quot;&gt;Flock Browser&lt;/a&gt;&lt;/div&gt;&lt;!-- technorati tags begin --&gt;&lt;p style=&quot;font-size:10px;text-align:right;&quot;&gt;Tags: &lt;a href=&quot;http://technorati.com/tag/AJAX&quot; rel=&quot;tag&quot;&gt;AJAX&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/Web%20development&quot; rel=&quot;tag&quot;&gt;Web development&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/%20web%202.0&quot; rel=&quot;tag&quot;&gt; web 2.0&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/%20JavaScript&quot; rel=&quot;tag&quot;&gt; JavaScript&lt;/a&gt;, &lt;a href=&quot;http://technorati.com/tag/%20&quot; rel=&quot;tag&quot;&gt; &lt;/a&gt;&lt;/p&gt;&lt;!-- technorati tags end --&gt; 
    </content:encoded>

    <pubDate>Wed, 24 Dec 2008 09:39:05 +0000</pubDate>
    <guid isPermaLink="false">http://www.digitalcarpenter.com.au/archives/24-guid.html</guid>
    
</item>
<item>
    <title>A fun doculicious example</title>
    <link>http://www.digitalcarpenter.com.au/archives/20-A-fun-doculicious-example.html</link>
            <category>Doculicious</category>
            <category>Startups</category>
    
    <comments>http://www.digitalcarpenter.com.au/archives/20-A-fun-doculicious-example.html#comments</comments>
    <wfw:comment>http://www.digitalcarpenter.com.au/wfwcomment.php?cid=20</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.digitalcarpenter.com.au/rss.php?version=2.0&amp;type=comments&amp;cid=20</wfw:commentRss>
    

    <author>nospam@example.com (Chris Carpenter)</author>
    <content:encoded>
    With the launch of &lt;a href=&quot;http://www.doculicious.com&quot;&gt;Doculicious.com&lt;/a&gt; I thought I&#039;d take the opportunity to post a couple of examples of how it looks and works on an external site.&lt;br /&gt;
&lt;br /&gt;
The &lt;a href=&quot;http://www.digitalcarpenter.com.au/archives/19-Launch-of-www.doculicious.com!.html&quot;&gt;original launch article&lt;/a&gt; has an example of a business/government form, but I also want to show a more graphical and fun one. The following is an Award Certificate that can be used for many types of occasions. The border, flower decoration and title images are all changeable, just click them to choose a different image.&lt;br /&gt;
&lt;br /&gt;
This is one of the free awards certificate templates on doculicious.com, so with even just a free account you can copy this and change bits around and put it on your own site or blog. You could create more border and text images to have it work for whatever type of award you like.&lt;br /&gt;
&lt;br /&gt;
&lt;noframes&gt;&lt;div style=&quot;margin-bottom: 20px;&quot;&gt;Your browser does not support frames, so you can&#039;t complete this form here. However, you can &lt;a href=&quot;http://www.doculicious.com/img/screenshots/2b9d83ae0a087d5e.pdf&quot;&gt;click here to download a PDF file of this form&lt;/a&gt;&lt;/div&gt; &lt;/noframes&gt;&lt;iframe height=&quot;585&quot; allowTransparency=&quot;true&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; style=&quot;width:704px;border:none&quot; src=&quot;http://www.doculicious.com/do/doc?dbt=2b9d83ae0a087d5e-b372b61e52bf72c3&amp;m=edit&amp;auth=0&quot;&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;small&gt;&lt;a href=&quot;http://www.doculicious.com/&quot;&gt;powered by doculicious&lt;/a&gt;&lt;/small&gt;&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Wed, 17 Dec 2008 09:46:26 +0000</pubDate>
    <guid isPermaLink="false">http://www.digitalcarpenter.com.au/archives/20-guid.html</guid>
    
</item>
<item>
    <title>Launch of www.doculicious.com!</title>
    <link>http://www.digitalcarpenter.com.au/archives/19-Launch-of-www.doculicious.com!.html</link>
            <category>Doculicious</category>
            <category>Startups</category>
    
    <comments>http://www.digitalcarpenter.com.au/archives/19-Launch-of-www.doculicious.com!.html#comments</comments>
    <wfw:comment>http://www.digitalcarpenter.com.au/wfwcomment.php?cid=19</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.digitalcarpenter.com.au/rss.php?version=2.0&amp;type=comments&amp;cid=19</wfw:commentRss>
    

    <author>nospam@example.com (Chris Carpenter)</author>
    <content:encoded>
    I&#039;m happy to finally announce the launch of our new web application, &lt;a href=&quot;http://www.doculicious.com&quot;&gt;www.doculicious.com.&lt;/a&gt; It&#039;s been under development for the past couple of months, and is a great enhancement on the underlying technology that we&#039;ve used to build our previous applications.&lt;br /&gt;
&lt;br /&gt;
Doculicious is similar to our previous sites in that it allows people to create documents in their browser, the difference is that we&#039;ve opened it up so that anyone can create templates and embed them on their own websites.&lt;br /&gt;
&lt;br /&gt;
Because of it&#039;s support of PDF, Doculicious is perfectly placed to offer solutions similar to what a PDF file solves, and together with it&#039;s web based delivery, it can act like a web form too. We&#039;ve chosen to focus on this idea of merging a web form and a PDF file, and allow the editing of a document directly in the browser using easy and simple fields, just like a web form. It&#039;s an alternative to offering a PDF download that offers many other benefits.&lt;br /&gt;
&lt;br /&gt;
A Doculicious template provides a downloadable PDF, but only after the user has filled in the fields - so the PDF is complete and ready to print, fax, mail or whatever else may be required. After the form is filled out we store the details that were entered and make it accessible to the form owner. This means it can be processed straight away, the data will have less mistakes, there&#039;s no retyping or handwriting to read and it&#039;s exportable as CSV or as the original PDF. The form owner can go in and edit or add details themselves. There&#039;s also integrated notifications, redirection after submissions, editable confirmation pages and you can make unique styles for each template, allowing you to make them match any design. Templates can also be made with a tracking code so when the PDF is printed and sent back, it&#039;s easy to match up with the data in the system. &lt;br /&gt;
&lt;br /&gt;
We&#039;re really happy with the current system, but we have many features we want to add, and plan on working with our existing and new clients to keep making Doculicious better.&lt;br /&gt;
&lt;br /&gt;
Doculicious has a free account that gives almost all the functionality listed above (styles and redirection are the only premium features), so if you have a need for a PDF application form, or a form where you&#039;d like the data in PDF format, or even just a standard web form, give it a try or at least check out the example page and see just a few ways it can be used  &lt;a href=&quot;http://www.doculicious.com/do/examples&quot;&gt;www.doculicious.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Make sure you keep reading to see the example template ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://www.digitalcarpenter.com.au/archives/19-Launch-of-www.doculicious.com!.html#extended&quot;&gt;Continue reading &quot;Launch of www.doculicious.com!&quot;&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 16 Dec 2008 16:04:42 +0000</pubDate>
    <guid isPermaLink="false">http://www.digitalcarpenter.com.au/archives/19-guid.html</guid>
    
</item>
<item>
    <title>Doculicious.com Launch Imminent</title>
    <link>http://www.digitalcarpenter.com.au/archives/17-Doculicious.com-Launch-Imminent.html</link>
            <category>Doculicious</category>
    
    <comments>http://www.digitalcarpenter.com.au/archives/17-Doculicious.com-Launch-Imminent.html#comments</comments>
    <wfw:comment>http://www.digitalcarpenter.com.au/wfwcomment.php?cid=17</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.digitalcarpenter.com.au/rss.php?version=2.0&amp;type=comments&amp;cid=17</wfw:commentRss>
    

    <author>nospam@example.com (Chris Carpenter)</author>
    <content:encoded>
    We plan on launching our new site, doculicious.com, in the next few days. With this launch we will be decommissioning the AustralianBusinessForms.com website, as all the ASIC forms will now be within Doculicious. This is really exciting, and adds a whole new range of features for users, as they can now use front-end web forms to have their clients complete some parts of their forms, while still being able to complete the rest of the form themselves.&lt;br /&gt;
&lt;br /&gt;
Currently we are clearing out the doculicious test database and forum so it&#039;s all shiny and new on launch. Also, after the last Open Coffee meet-up in Sydney I had someone mention a feature that I had planned on implementing, but had put off. On the train ride back I couldn&#039;t stop thinking about how I could do it. Luckily, the widgely website had a similar functionality developed, but was not moved into production. When I got back to the office and looked at the code I realised it would do everything required, and more. So my launch plans were put off a little as I put this new change in and had it tested. I was actually happy to do this, as for a while I&#039;d had concerns about launching without this feature .. so hearing that it was something people would want gave me the impetuous to get it in.&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Tue, 09 Dec 2008 07:51:00 +0000</pubDate>
    <guid isPermaLink="false">http://www.digitalcarpenter.com.au/archives/17-guid.html</guid>
    
</item>

</channel>
</rss>