<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Joe Song &#187; dojo</title> <atom:link href="http://joesong.com/tag/dojo/feed/" rel="self" type="application/rss+xml" /><link>http://joesong.com</link> <description>Development, music.</description> <lastBuildDate>Tue, 22 Jun 2010 04:37:09 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Avoiding redundancies in the Dojo build process</title><link>http://joesong.com/2009/01/dojo-custom-build-with-a-global-layer/</link> <comments>http://joesong.com/2009/01/dojo-custom-build-with-a-global-layer/#comments</comments> <pubDate>Mon, 05 Jan 2009 19:23:49 +0000</pubDate> <dc:creator>josephsong</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[build process]]></category> <category><![CDATA[dojo]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[optimization]]></category><guid
isPermaLink="false">http://joesong.com/?p=241</guid> <description><![CDATA[Handling redundancies in global .js files and page-specific .js files when using the Dojo build process.]]></description> <content:encoded><![CDATA[<p>So, for our major (full site) project we are using the Dojo Toolkit. We have a build script that is condensing and compressing the JavaScript files using the Dojo build architecture. Each site page uses a global set of scripts for general utilities and ui, and then usually has another set of script for specific widgets and such.</p><p>It took me a while to find how to write the build script to omit duplicate dependencies included in the global but required by the page-specific scripts. For instance, we have a custom form handler called MyProject.form and is extended by page-specific classes. So, with the original build this class was included in the Global layer and the page-specific layer resulting in the MyProject.form class being in both .js files in the built page.</p><p>The answer is: layerDependencies in the build script.</p><pre>dependencies = {
    resourceName: "MyProject",
    layers: [
    {
        name: "../../MyProject/Global.js",
        dependencies: ["MyProject", "MyProject.Global"]
    },
    {
        name: "../../MyProject/CategoryPage.js",
        dependencies: ["MyProject.CategoryPage"],
        layerDependencies: ["../../MyProject/Global.js"]
    }
    ]
};</pre><p>So,  if a class in dojo.required (and therefore included) in Global.js it will be not be copied into CategoryPage.js if it is required there, also.</p> ]]></content:encoded> <wfw:commentRss>http://joesong.com/2009/01/dojo-custom-build-with-a-global-layer/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: joesong.com @ 2010-09-09 17:35:26 -->