<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Include: Pack your JavaScript with ease</title>
	<atom:link href="http://ajaxian.com/archives/include-pack-your-javascript-with-ease/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/include-pack-your-javascript-with-ease</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Fri, 19 Mar 2010 10:02:02 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tico</title>
		<link>http://ajaxian.com/archives/include-pack-your-javascript-with-ease/comment-page-1#comment-277520</link>
		<dc:creator>Tico</dc:creator>
		<pubDate>Sat, 26 Dec 2009 19:26:51 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/include-pack-your-javascript-with-ease#comment-277520</guid>
		<description>What comparisons would you like to see? Include vs gZip wouldn’t make sense because you can still do that.</description>
		<content:encoded><![CDATA[<p>What comparisons would you like to see? Include vs gZip wouldn’t make sense because you can still do that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JustinMeyer</title>
		<link>http://ajaxian.com/archives/include-pack-your-javascript-with-ease/comment-page-1#comment-272166</link>
		<dc:creator>JustinMeyer</dc:creator>
		<pubDate>Wed, 18 Mar 2009 23:03:58 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/include-pack-your-javascript-with-ease#comment-272166</guid>
		<description>compressing isn&#039;t as much as joining</description>
		<content:encoded><![CDATA[<p>compressing isn&#8217;t as much as joining</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aimos</title>
		<link>http://ajaxian.com/archives/include-pack-your-javascript-with-ease/comment-page-1#comment-265847</link>
		<dc:creator>Aimos</dc:creator>
		<pubDate>Tue, 15 Jul 2008 10:47:09 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/include-pack-your-javascript-with-ease#comment-265847</guid>
		<description>I have no idea, why compressing js in the browser is usefull.</description>
		<content:encoded><![CDATA[<p>I have no idea, why compressing js in the browser is usefull.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sarkisozleri</title>
		<link>http://ajaxian.com/archives/include-pack-your-javascript-with-ease/comment-page-1#comment-263584</link>
		<dc:creator>sarkisozleri</dc:creator>
		<pubDate>Thu, 08 May 2008 21:08:23 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/include-pack-your-javascript-with-ease#comment-263584</guid>
		<description>Thanks. Good article.</description>
		<content:encoded><![CDATA[<p>Thanks. Good article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JustinMeyer</title>
		<link>http://ajaxian.com/archives/include-pack-your-javascript-with-ease/comment-page-1#comment-261678</link>
		<dc:creator>JustinMeyer</dc:creator>
		<pubDate>Thu, 28 Feb 2008 05:45:53 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/include-pack-your-javascript-with-ease#comment-261678</guid>
		<description>On F-&gt;IT (http://fit.jupiterit.com), using include, we take 431 kb of JavaScript files to 180 kb using include.  Gzip takes it from 180kb to 60 kb (this is production.js seen in firebug).</description>
		<content:encoded><![CDATA[<p>On F-&gt;IT (<a href="http://fit.jupiterit.com)" rel="nofollow">http://fit.jupiterit.com)</a>, using include, we take 431 kb of JavaScript files to 180 kb using include.  Gzip takes it from 180kb to 60 kb (this is production.js seen in firebug).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JustinMeyer</title>
		<link>http://ajaxian.com/archives/include-pack-your-javascript-with-ease/comment-page-1#comment-261675</link>
		<dc:creator>JustinMeyer</dc:creator>
		<pubDate>Thu, 28 Feb 2008 00:10:28 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/include-pack-your-javascript-with-ease#comment-261675</guid>
		<description>sorry, that last include didn&#039;t turn out right

&lt;code&gt; include({env: &#039;&lt;%= @environment&gt;&#039;})&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>sorry, that last include didn&#8217;t turn out right</p>
<p><code> include({env: '&lt;%= @environment&gt;'})</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JustinMeyer</title>
		<link>http://ajaxian.com/archives/include-pack-your-javascript-with-ease/comment-page-1#comment-261674</link>
		<dc:creator>JustinMeyer</dc:creator>
		<pubDate>Wed, 27 Feb 2008 23:55:12 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/include-pack-your-javascript-with-ease#comment-261674</guid>
		<description>Let&#039;s break this down a little:

On FILO ... I wrote include to mimic how most libraries that load plugins, load them.  They all use document.write( script tag ).  Include loads the same way document.write would loads scripts.  Its FILO between files, and FIFO within a file.  

Also, you have to do FILO if you want to support loading dependencies.  I can explain why if needed.

Now, there are more libraries than just TinyMCE that can automatically load plugins for you.  This is a nice feature.  Users don&#039;t have to be bothered adding a script tag for everything feature they want.  It allows for cooperation between plugins to load only what they need.  For example in the framework Include was built for, JavaScriptMVC, if someone loads Prototype, it will not load its own Event, Ajax, and CssQuery functionality.  I call this library INTERdependence.  Frameworks like MooTools kinda provide this, but you have to go to their site to get your custom version.  How would you provide this ability and still let your framework be easily compressed?

Include makes this very simple since it provides a way to easily load files in JavaScript, and a way to compress them without recreating all that logic server side.

On being slower ... The default behavior is not to pack the JavaScript but to simply shrink temporary variable names.  So there is no cost of unpacking, since it doesn&#039;t happen.  For our applications, we typically compress and gzip.

Yes, you could paste the file directly into your html.  However, there are times (JavaScriptMVC&#039;s documentation pages being an example), where you want the same JavaScript to run across all pages.  This wouldn&#039;t be suggested in this case.

&lt;blockquote&gt;What&#039;s wrong with the build/make methods used?&lt;/blockquote&gt;

The build/make methods cannot easily compress things like TinyMCE.  And for every library like TinyMCE, or JavaScriptMVC, those that allow you to dynamically include JavaScript files, you would have to create a special compressor for each framework.  TinyMCE has one for Rails, Asp, JSP, Coldfusion, etc.  But, with include, there only EVER has to be one server-side compressor per framework.  And the hobbyist can still compress their app without even having to setup server-side compression scripts.

&lt;blockquote&gt;Instead, just the plugin logic is client-side, and still requires the same type of code, and possibly more work.&lt;/blockquote&gt;

I&#039;m confused by this.  Yes, the plugin logic is client side.  It requires you to include your javascript files.  But you do that with or without include.  If your page has loads of script tags, you are basically writing the same thing as include(&#039;file1&#039;,&#039;file2&#039;,&#039;file3&#039;).  However, you don&#039;t have to write something that compresses them.  Include takes care of that for you.  I don&#039;t see how this is more work.

What comparisons would you like to see?  Include vs gZip wouldn&#039;t make sense because you can still do that.

After actually using include, I find it very useful.  It adds no cost to having lots of JavaScript files.  I know that no matter how complex the dependencies get, it will still compress.  I don&#039;t have to worry about modifying my compression script.

For things like JavaScriptMVC&#039;s documentation, I just used the client side compression.  However, when I&#039;ve worked on more serious applications like F-&gt;IT (http://fit.jupiterit.com), I use the server-side compression.  

Using include with F-&gt;IT was great because it relies on EditArea which can load its own plugins.  Once I was no longer adding files to EditArea, and getting ready to try it out in production, I used the client to provide a list of files.  I put that in the appropriate place for the server-side script, added that to Capistrano, and changed
include({env: &#039;development&#039;})
to
include({env: &#039;&#039;})

And now everytime I migrate to production, it generates a new production script from that list of files, and loads that in production.

Easy as pie.  Much easier that it would have been to write my own custom ruby compression script for EditArea.</description>
		<content:encoded><![CDATA[<p>Let&#8217;s break this down a little:</p>
<p>On FILO &#8230; I wrote include to mimic how most libraries that load plugins, load them.  They all use document.write( script tag ).  Include loads the same way document.write would loads scripts.  Its FILO between files, and FIFO within a file.  </p>
<p>Also, you have to do FILO if you want to support loading dependencies.  I can explain why if needed.</p>
<p>Now, there are more libraries than just TinyMCE that can automatically load plugins for you.  This is a nice feature.  Users don&#8217;t have to be bothered adding a script tag for everything feature they want.  It allows for cooperation between plugins to load only what they need.  For example in the framework Include was built for, JavaScriptMVC, if someone loads Prototype, it will not load its own Event, Ajax, and CssQuery functionality.  I call this library INTERdependence.  Frameworks like MooTools kinda provide this, but you have to go to their site to get your custom version.  How would you provide this ability and still let your framework be easily compressed?</p>
<p>Include makes this very simple since it provides a way to easily load files in JavaScript, and a way to compress them without recreating all that logic server side.</p>
<p>On being slower &#8230; The default behavior is not to pack the JavaScript but to simply shrink temporary variable names.  So there is no cost of unpacking, since it doesn&#8217;t happen.  For our applications, we typically compress and gzip.</p>
<p>Yes, you could paste the file directly into your html.  However, there are times (JavaScriptMVC&#8217;s documentation pages being an example), where you want the same JavaScript to run across all pages.  This wouldn&#8217;t be suggested in this case.</p>
<blockquote><p>What&#8217;s wrong with the build/make methods used?</p></blockquote>
<p>The build/make methods cannot easily compress things like TinyMCE.  And for every library like TinyMCE, or JavaScriptMVC, those that allow you to dynamically include JavaScript files, you would have to create a special compressor for each framework.  TinyMCE has one for Rails, Asp, JSP, Coldfusion, etc.  But, with include, there only EVER has to be one server-side compressor per framework.  And the hobbyist can still compress their app without even having to setup server-side compression scripts.</p>
<blockquote><p>Instead, just the plugin logic is client-side, and still requires the same type of code, and possibly more work.</p></blockquote>
<p>I&#8217;m confused by this.  Yes, the plugin logic is client side.  It requires you to include your javascript files.  But you do that with or without include.  If your page has loads of script tags, you are basically writing the same thing as include(&#8217;file1&#8242;,&#8217;file2&#8242;,&#8217;file3&#8242;).  However, you don&#8217;t have to write something that compresses them.  Include takes care of that for you.  I don&#8217;t see how this is more work.</p>
<p>What comparisons would you like to see?  Include vs gZip wouldn&#8217;t make sense because you can still do that.</p>
<p>After actually using include, I find it very useful.  It adds no cost to having lots of JavaScript files.  I know that no matter how complex the dependencies get, it will still compress.  I don&#8217;t have to worry about modifying my compression script.</p>
<p>For things like JavaScriptMVC&#8217;s documentation, I just used the client side compression.  However, when I&#8217;ve worked on more serious applications like F-&gt;IT (<a href="http://fit.jupiterit.com)" rel="nofollow">http://fit.jupiterit.com)</a>, I use the server-side compression.  </p>
<p>Using include with F-&gt;IT was great because it relies on EditArea which can load its own plugins.  Once I was no longer adding files to EditArea, and getting ready to try it out in production, I used the client to provide a list of files.  I put that in the appropriate place for the server-side script, added that to Capistrano, and changed<br />
include({env: &#8216;development&#8217;})<br />
to<br />
include({env: &#8221;})</p>
<p>And now everytime I migrate to production, it generates a new production script from that list of files, and loads that in production.</p>
<p>Easy as pie.  Much easier that it would have been to write my own custom ruby compression script for EditArea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles</title>
		<link>http://ajaxian.com/archives/include-pack-your-javascript-with-ease/comment-page-1#comment-261672</link>
		<dc:creator>Charles</dc:creator>
		<pubDate>Wed, 27 Feb 2008 19:21:50 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/include-pack-your-javascript-with-ease#comment-261672</guid>
		<description>&lt;blockquote&gt;Scripts load in the same order across all browsers (last-in first-out), which is nice...&lt;/blockquote&gt;Huh?  Nice?  Every server-side compression script I use works like HTML: First In First Out.  Makes sense to me, load jQuery first, then its dependent plugins.  Plus, isn&#039;t the overhead of packing well-known to be slower than gzip in most applications, as &lt;b&gt;Spocke&lt;/b&gt; suggested?
.
Ok, I see that they&#039;re suggesting that every time I change my script, I re-run their packer method through my browser, and then save and upload a new file? Also, after &#039;setup&#039; I have to change the HTML file to &#039;production&#039; mode?  Why not just paste the damn packed JS into my HTML, since Include is handing it to me, and save an HTTP request?  Wouldn&#039;t that save a lot more time?
.
+1 @JustinMeyer -- I can appreciate it giving me a list of the file and its dependencies, and compressing server-side with automatic caching and almost no extra work.  That&#039;s why I use &lt;a href=&quot;http://code.google.com/p/minify/&quot; rel=&quot;nofollow&quot;&gt;Minify&lt;/a&gt; (PHP).  Also, what is wrong with the build/make method, used by the major frameworks?
&lt;blockquote&gt;No need to repeat any plugin loading logic in a server-side script.&lt;/blockquote&gt;Instead, just the plugin logic is client-side, and still requires the same type of code, and possibly more work.
.
What advantage am I missing?  I would like to see some hard numbers  on load times, comparisons with other methods are conspicuously absent.  Perhaps I should put up a flashing neon sign for those who missed the boat, &lt;b&gt;gZip &amp; server-side concat &amp; caching FTW.&lt;/b&gt;</description>
		<content:encoded><![CDATA[<blockquote><p>Scripts load in the same order across all browsers (last-in first-out), which is nice&#8230;</p></blockquote>
<p>Huh?  Nice?  Every server-side compression script I use works like HTML: First In First Out.  Makes sense to me, load jQuery first, then its dependent plugins.  Plus, isn&#8217;t the overhead of packing well-known to be slower than gzip in most applications, as <b>Spocke</b> suggested?<br />
.<br />
Ok, I see that they&#8217;re suggesting that every time I change my script, I re-run their packer method through my browser, and then save and upload a new file? Also, after &#8217;setup&#8217; I have to change the HTML file to &#8216;production&#8217; mode?  Why not just paste the damn packed JS into my HTML, since Include is handing it to me, and save an HTTP request?  Wouldn&#8217;t that save a lot more time?<br />
.<br />
+1 @JustinMeyer &#8212; I can appreciate it giving me a list of the file and its dependencies, and compressing server-side with automatic caching and almost no extra work.  That&#8217;s why I use <a href="http://code.google.com/p/minify/" rel="nofollow">Minify</a> (PHP).  Also, what is wrong with the build/make method, used by the major frameworks?</p>
<blockquote><p>No need to repeat any plugin loading logic in a server-side script.</p></blockquote>
<p>Instead, just the plugin logic is client-side, and still requires the same type of code, and possibly more work.<br />
.<br />
What advantage am I missing?  I would like to see some hard numbers  on load times, comparisons with other methods are conspicuously absent.  Perhaps I should put up a flashing neon sign for those who missed the boat, <b>gZip &amp; server-side concat &amp; caching FTW.</b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JustinMeyer</title>
		<link>http://ajaxian.com/archives/include-pack-your-javascript-with-ease/comment-page-1#comment-261657</link>
		<dc:creator>JustinMeyer</dc:creator>
		<pubDate>Wed, 27 Feb 2008 14:39:27 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/include-pack-your-javascript-with-ease#comment-261657</guid>
		<description>Include produces a list of included files which can be used in a &#039;standard&#039; compression script.  We&#039;ve written one of these compression scripts for Rails.  The great thing about these &#039;standard&#039; scripts is that only one needs to be written per language - ever.  You can still get your server-side compression, concatenation, and gzip, but you won&#039;t have to write the script yourself.  You simply provide the script a list of files to be compressed.</description>
		<content:encoded><![CDATA[<p>Include produces a list of included files which can be used in a &#8217;standard&#8217; compression script.  We&#8217;ve written one of these compression scripts for Rails.  The great thing about these &#8217;standard&#8217; scripts is that only one needs to be written per language &#8211; ever.  You can still get your server-side compression, concatenation, and gzip, but you won&#8217;t have to write the script yourself.  You simply provide the script a list of files to be compressed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spocke</title>
		<link>http://ajaxian.com/archives/include-pack-your-javascript-with-ease/comment-page-1#comment-261654</link>
		<dc:creator>Spocke</dc:creator>
		<pubDate>Wed, 27 Feb 2008 14:19:23 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/include-pack-your-javascript-with-ease#comment-261654</guid>
		<description>Interesting idea but server side concatenation and gzip compression is still the best way of reducing script size. But I&#039;ve been having an idea to use Flash to load compressed contents this way it can be done 100% client side and still be gzipped one could make a detection script to use Flash if flash is enabled in the browser it otherwise fall back to an old school loading method. I think this would be possible but I haven&#039;t tired it.</description>
		<content:encoded><![CDATA[<p>Interesting idea but server side concatenation and gzip compression is still the best way of reducing script size. But I&#8217;ve been having an idea to use Flash to load compressed contents this way it can be done 100% client side and still be gzipped one could make a detection script to use Flash if flash is enabled in the browser it otherwise fall back to an old school loading method. I think this would be possible but I haven&#8217;t tired it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
