<?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 for getiblog</title>
	<atom:link href="http://blog.getify.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.getify.com</link>
	<description>javascript, performance, and ui musings</description>
	<lastBuildDate>Mon, 07 May 2012 16:42:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>Comment on LABjs: why not just concat? by Dan</title>
		<link>http://blog.getify.com/labjs-why-not-just-concat/comment-page-1/#comment-2327</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 07 May 2012 16:42:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.getify.com/?p=97#comment-2327</guid>
		<description>Surely the other benchmark you need to run here for the full picture is when caching is used. I notice that you&#039;ve deliberately disabled caching in your requests to show the actual download time between a concatenated file and your load on demand. Interestingly, my results are sometimes longer for the labJS solution.

A more realistic scenario IMHO would be to compare any  typical homepage which may have around 10 different JS files (eg. jquery, jquery UI, Knockout, modernizr, etc.etc) and illustrate that as one file vs many files when caching is optimised. I think you&#039;ll see that for all but the first request, a single concat file will be quicker the more individual files are included. There are only so many that will load in parallel.

Where I think this way of loading really wins is only loading what you actually need. Personally, I&#039;m less worried about how long a script takes to download (given I can optimise that) than I am about whether I actually need the script at all. There&#039;s obviously no point spending time processing a script I&#039;m not using. I quite like the fact that you can can customize many libraries, for instance jQuery UI lets you build a JS file containing only those parts of the UI you&#039;re actually using on your site.</description>
		<content:encoded><![CDATA[<p>Surely the other benchmark you need to run here for the full picture is when caching is used. I notice that you&#8217;ve deliberately disabled caching in your requests to show the actual download time between a concatenated file and your load on demand. Interestingly, my results are sometimes longer for the labJS solution.</p>
<p>A more realistic scenario IMHO would be to compare any  typical homepage which may have around 10 different JS files (eg. jquery, jquery UI, Knockout, modernizr, etc.etc) and illustrate that as one file vs many files when caching is optimised. I think you&#8217;ll see that for all but the first request, a single concat file will be quicker the more individual files are included. There are only so many that will load in parallel.</p>
<p>Where I think this way of loading really wins is only loading what you actually need. Personally, I&#8217;m less worried about how long a script takes to download (given I can optimise that) than I am about whether I actually need the script at all. There&#8217;s obviously no point spending time processing a script I&#8217;m not using. I quite like the fact that you can can customize many libraries, for instance jQuery UI lets you build a JS file containing only those parts of the UI you&#8217;re actually using on your site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Why I don&#8217;t like HAML by Zequez</title>
		<link>http://blog.getify.com/why-i-dont-like-haml/comment-page-1/#comment-2322</link>
		<dc:creator>Zequez</dc:creator>
		<pubDate>Sun, 01 Apr 2012 23:07:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.getify.com/?p=168#comment-2322</guid>
		<description>I also disagree entirely, and about the hash &quot;sandwich&quot;, since Ruby 1.9 you can just do the following:

%sandwich{bread: &#039;whole wheat&#039;, filling: &#039;peanut butter and jelly&#039;,
delicious: true}

And most text editors / IDEs highlight the indentation you are in, so there is no need to have a closing tag.

And HAML precompiles to ERB.</description>
		<content:encoded><![CDATA[<p>I also disagree entirely, and about the hash &#8220;sandwich&#8221;, since Ruby 1.9 you can just do the following:</p>
<p>%sandwich{bread: &#8216;whole wheat&#8217;, filling: &#8216;peanut butter and jelly&#8217;,<br />
delicious: true}</p>
<p>And most text editors / IDEs highlight the indentation you are in, so there is no need to have a closing tag.</p>
<p>And HAML precompiles to ERB.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on LABjs: new hotness for script loading by cam</title>
		<link>http://blog.getify.com/labjs-new-hotness-for-script-loading/comment-page-1/#comment-2319</link>
		<dc:creator>cam</dc:creator>
		<pubDate>Fri, 17 Feb 2012 21:01:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.getify.com/?p=69#comment-2319</guid>
		<description>Thanks for your detailed response. Your post mentioned flash of un-behavioured content and your &lt;code&gt;noscript&lt;/code&gt; solution. I&#039;ve experienced this problem (without using a script loader but just by putting script tags just before the closing body tag) and my solution was to place an inline script immediately after the affected element to hide it. noscript sounds much better.

If I understand your answer correctly, browers must delay DOM-ready when script tags are used because of the risk that scripts contain &lt;code&gt;document.write()&lt;/code&gt;, but using a script loader we can safely load scripts because we know they won&#039;t contain document.write()  (I notice Mozilla says: Never call document.write() from an async script.)

Why is DOM-ready a critical moment in perceived performance? I ask because tags in the HTML before the script tags are rendered before those scripts are run, so if your script tags are just before the closing body tag shouldn&#039;t perceived performance be good? (Sorry if that&#039;s rather a noob question -obviously there&#039;s a good answer to that otherwise we wouldn&#039;t need async and defer and script loaders!)</description>
		<content:encoded><![CDATA[<p>Thanks for your detailed response. Your post mentioned flash of un-behavioured content and your <code>noscript</code> solution. I&#8217;ve experienced this problem (without using a script loader but just by putting script tags just before the closing body tag) and my solution was to place an inline script immediately after the affected element to hide it. noscript sounds much better.</p>
<p>If I understand your answer correctly, browers must delay DOM-ready when script tags are used because of the risk that scripts contain <code>document.write()</code>, but using a script loader we can safely load scripts because we know they won&#8217;t contain document.write()  (I notice Mozilla says: Never call document.write() from an async script.)</p>
<p>Why is DOM-ready a critical moment in perceived performance? I ask because tags in the HTML before the script tags are rendered before those scripts are run, so if your script tags are just before the closing body tag shouldn&#8217;t perceived performance be good? (Sorry if that&#8217;s rather a noob question -obviously there&#8217;s a good answer to that otherwise we wouldn&#8217;t need async and defer and script loaders!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on LABjs: new hotness for script loading by getify</title>
		<link>http://blog.getify.com/labjs-new-hotness-for-script-loading/comment-page-1/#comment-2318</link>
		<dc:creator>getify</dc:creator>
		<pubDate>Wed, 15 Feb 2012 15:22:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.getify.com/?p=69#comment-2318</guid>
		<description>Great question. Yes, script loaders are still relevant even in the latest generation of browsers. And until we ever get rid of &lt;code&gt;document.write()&lt;/code&gt;, they always will be. Browsers have to assume that a script they are loading *might* contain a &lt;code&gt;document.write()&lt;/code&gt;, because if it does, then it could &quot;change everything&quot;&#8482; It could, for instance, write out a &lt;code&gt;&lt;base&gt;&lt;/code&gt; tag which completely reinterprets all relative resource paths, meaning the browser may have to throw away any look-ahead work it did in downloading those resources, and re-load them.

As such, browsers are forced to, no matter what, hold up the DOM-ready event (that magical moment when a user can interact meaningfully with the page) until it is certain that it in fact DOES know enough about the structure of the page to declare that the &quot;DOM is ready&quot;. This has the effect of blocking DOM-ready until all normally loaded (that is, with &lt;code&gt;&lt;script&gt;&lt;/code&gt; tags) scripts are finished loading and running.

DOM-ready is perhaps the most critical moment in the page&#039;s life time when it comes to both performance and perceived-performance (that is, how fast users FEEL your page is). It&#039;s critical to get DOM-ready to happen as soon as possible. No matter where you load your scripts (top or bottom), if you do so with normal &lt;code&gt;&lt;script&gt;&lt;/code&gt; tags, you will ALWAYS block DOM-ready.

The common wisdom therefore is to use techniques for loading which unblock the DOM-ready from the script load. How can you do so? &lt;code&gt;&lt;script async&gt;&lt;/code&gt; is one such way. The problem is this only works for one script, or for a set of scripts which are entirely independent, because two or more &quot;async&quot; loaded scripts will not execute in any defined order (they execute ASAP).

&lt;code&gt;&lt;script defer&gt;&lt;/code&gt; is the next most common suggestion. However, &quot;defer&quot; is *horribly* buggy. Not only does its behavior differ between browsers if it does or does not block DOM-ready, but there are AWFUL bugs (in IE) where if you load two or more scripts with &quot;defer&quot;, and one of them happens to do something like modify the DOM, it can actually cause that first script to *pause* IN THE MIDDLE OF THE CODE EXECUTION, run another script, then come back to the previous code, causing untold numbers of impossible to track down bugs. Try loading jquery.js and jquery-ui.js, both using &quot;defer&quot;, in IE8 and below, and you&#039;ll see what I mean.

Anyway, bottom line, in most practical cases, &quot;async&quot; and &quot;defer&quot; are simply not good enough.

Ergo, you need a script loader, which gives you the desired behavior (INCLUDING not blocking DOM-ready) without all the bugs. LABjs is, if nothing else, a polyfill for &quot;defer&quot; (and &quot;async&quot; to an extent), to work the way they &quot;ought to&quot;&#8482; work, but never will (because of legacy).</description>
		<content:encoded><![CDATA[<p>Great question. Yes, script loaders are still relevant even in the latest generation of browsers. And until we ever get rid of <code>document.write()</code>, they always will be. Browsers have to assume that a script they are loading *might* contain a <code>document.write()</code>, because if it does, then it could &#8220;change everything&#8221;&trade; It could, for instance, write out a <code>&lt;base></code> tag which completely reinterprets all relative resource paths, meaning the browser may have to throw away any look-ahead work it did in downloading those resources, and re-load them.</p>
<p>As such, browsers are forced to, no matter what, hold up the DOM-ready event (that magical moment when a user can interact meaningfully with the page) until it is certain that it in fact DOES know enough about the structure of the page to declare that the &#8220;DOM is ready&#8221;. This has the effect of blocking DOM-ready until all normally loaded (that is, with <code>&lt;script></code> tags) scripts are finished loading and running.</p>
<p>DOM-ready is perhaps the most critical moment in the page&#8217;s life time when it comes to both performance and perceived-performance (that is, how fast users FEEL your page is). It&#8217;s critical to get DOM-ready to happen as soon as possible. No matter where you load your scripts (top or bottom), if you do so with normal <code>&lt;script></code> tags, you will ALWAYS block DOM-ready.</p>
<p>The common wisdom therefore is to use techniques for loading which unblock the DOM-ready from the script load. How can you do so? <code>&lt;script async></code> is one such way. The problem is this only works for one script, or for a set of scripts which are entirely independent, because two or more &#8220;async&#8221; loaded scripts will not execute in any defined order (they execute ASAP).</p>
<p><code>&lt;script defer></code> is the next most common suggestion. However, &#8220;defer&#8221; is *horribly* buggy. Not only does its behavior differ between browsers if it does or does not block DOM-ready, but there are AWFUL bugs (in IE) where if you load two or more scripts with &#8220;defer&#8221;, and one of them happens to do something like modify the DOM, it can actually cause that first script to *pause* IN THE MIDDLE OF THE CODE EXECUTION, run another script, then come back to the previous code, causing untold numbers of impossible to track down bugs. Try loading jquery.js and jquery-ui.js, both using &#8220;defer&#8221;, in IE8 and below, and you&#8217;ll see what I mean.</p>
<p>Anyway, bottom line, in most practical cases, &#8220;async&#8221; and &#8220;defer&#8221; are simply not good enough.</p>
<p>Ergo, you need a script loader, which gives you the desired behavior (INCLUDING not blocking DOM-ready) without all the bugs. LABjs is, if nothing else, a polyfill for &#8220;defer&#8221; (and &#8220;async&#8221; to an extent), to work the way they &#8220;ought to&#8221;&trade; work, but never will (because of legacy).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on LABjs: new hotness for script loading by cam</title>
		<link>http://blog.getify.com/labjs-new-hotness-for-script-loading/comment-page-1/#comment-2317</link>
		<dc:creator>cam</dc:creator>
		<pubDate>Wed, 15 Feb 2012 14:39:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.getify.com/?p=69#comment-2317</guid>
		<description>I&#039;ve opened the developer tools network tab in both Chrome 16 and Firefox 7 on &lt;a href=&quot;http://stevesouders.com/cuzillion/?c0=bj1hfff2_0_f&amp;c1=bj1hfff2_0_f&amp;c2=bj1hfff2_0_f&amp;c3=bj1hfff2_0_f&amp;c4=bi1hfff2_0_f&amp;c5=bi1hfff2_0_f&amp;t=1329243656621&quot; rel=&quot;nofollow&quot;&gt;a Cuzillion test page&lt;/a&gt; and both appear to show scripts and images being downloaded -all in parallel.

I&#039;ve read (and you mention FF3.5 here) that newer browsers can download scripts that are referenced in script tags in parallel with each other. But what this seems to show is even newer browsers actually downloading scripts in parallel with other resources like images.

Is LABjs still needed? (or is it still worth using for when a user has an older browser?) 

I might just be confused: with http://labjs.com/test_suite/test-script-tags.php Chrome 16 developers tools shows images being downloaded only after the scripts are downloaded. That said, in this case the script tags are in the document&#039;s head whereas with the Cuzillion example they are in the body.

Putting older browsers aside for a moment, is LABjs only relevant if you need to put your scripts in the document&#039;s head? 

Thanks for any thoughts</description>
		<content:encoded><![CDATA[<p>I&#8217;ve opened the developer tools network tab in both Chrome 16 and Firefox 7 on <a href="http://stevesouders.com/cuzillion/?c0=bj1hfff2_0_f&amp;c1=bj1hfff2_0_f&amp;c2=bj1hfff2_0_f&amp;c3=bj1hfff2_0_f&amp;c4=bi1hfff2_0_f&amp;c5=bi1hfff2_0_f&amp;t=1329243656621" rel="nofollow">a Cuzillion test page</a> and both appear to show scripts and images being downloaded -all in parallel.</p>
<p>I&#8217;ve read (and you mention FF3.5 here) that newer browsers can download scripts that are referenced in script tags in parallel with each other. But what this seems to show is even newer browsers actually downloading scripts in parallel with other resources like images.</p>
<p>Is LABjs still needed? (or is it still worth using for when a user has an older browser?) </p>
<p>I might just be confused: with <a href="http://labjs.com/test_suite/test-script-tags.php" rel="nofollow">http://labjs.com/test_suite/test-script-tags.php</a> Chrome 16 developers tools shows images being downloaded only after the scripts are downloaded. That said, in this case the script tags are in the document&#8217;s head whereas with the Cuzillion example they are in the body.</p>
<p>Putting older browsers aside for a moment, is LABjs only relevant if you need to put your scripts in the document&#8217;s head? </p>
<p>Thanks for any thoughts</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Content Delivery Network via getiblog.2static.it

Served from: blog.getify.com @ 2012-05-18 08:17:43 -->
