<?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: Loading YUI: Seeds, Core, and Combo-handling</title>
	<atom:link href="http://www.yuiblog.com/blog/index.php/2008/10/17/loading-yui/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yuiblog.com/blog/2008/10/17/loading-yui/</link>
	<description>The official blog of the YUI Project.</description>
	<lastBuildDate>Thu, 09 Feb 2012 01:46:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: 在服务端合并和压缩JavaScript和CSS文件 &#124; Wang Jun&#39;s Blog</title>
		<link>http://www.yuiblog.com/blog/2008/10/17/loading-yui/comment-page-1/#comment-595883</link>
		<dc:creator>在服务端合并和压缩JavaScript和CSS文件 &#124; Wang Jun&#39;s Blog</dc:creator>
		<pubDate>Wed, 24 Nov 2010 08:34:32 +0000</pubDate>
		<guid isPermaLink="false">http://yuiblog.com/blog/2008/10/17/loading-yui/#comment-595883</guid>
		<description>[...] 除了代码的可读性稍稍有一点点降低外，使用Combo Handler服务大大的降低了HTTP请求数，同时也减少了URL代码量，这对于Web性能优化来讲至关重要。所以，随后YUI从2.6.0开始，其核心组件YUI Loader内置了Combo Handling功能，即使用YUI Loader时，通过配置combine属性就可以把要加载的多个JavaScript或CSS文件按照使用Combo Handler服务的形式合并起来，这时只要静态文件的服务器支持Combo Handler就行了。在YUI中当combine配置为true时，CDN默认是使用Yahoo! CDN（http://yui.yahooapis.com），所以没有任何问题。这正是YUI最迷人的地方之一。 [...]</description>
		<content:encoded><![CDATA[<p>[...] 除了代码的可读性稍稍有一点点降低外，使用Combo Handler服务大大的降低了HTTP请求数，同时也减少了URL代码量，这对于Web性能优化来讲至关重要。所以，随后YUI从2.6.0开始，其核心组件YUI Loader内置了Combo Handling功能，即使用YUI Loader时，通过配置combine属性就可以把要加载的多个JavaScript或CSS文件按照使用Combo Handler服务的形式合并起来，这时只要静态文件的服务器支持Combo Handler就行了。在YUI中当combine配置为true时，CDN默认是使用Yahoo! CDN（http://yui.yahooapis.com），所以没有任何问题。这正是YUI最迷人的地方之一。 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 在服务端合并和压缩JavaScript和CSS文件 &#171; Koubei UED</title>
		<link>http://www.yuiblog.com/blog/2008/10/17/loading-yui/comment-page-1/#comment-592706</link>
		<dc:creator>在服务端合并和压缩JavaScript和CSS文件 &#171; Koubei UED</dc:creator>
		<pubDate>Thu, 08 Jul 2010 13:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://yuiblog.com/blog/2008/10/17/loading-yui/#comment-592706</guid>
		<description>[...] 除了代码的可读性稍稍有一点点降低外，使用Combo Handler服务大大的降低了HTTP请求数，同时也减少了URL代码量，这对于Web性能优化来讲至关重要。所以，随后YUI从2.6.0开始，其核心组件YUI Loader内置了Combo Handling功能，即使用YUI Loader时，通过配置combine属性就可以把要加载的多个JavaScript或CSS文件按照使用Combo Handler服务的形式合并起来，这时只要静态文件的服务器支持Combo Handler就行了。在YUI中当combine配置为true时，CDN默认是使用Yahoo! CDN（http://yui.yahooapis.com），所以没有任何问题。这正是YUI最迷人的地方之一。 [...]</description>
		<content:encoded><![CDATA[<p>[...] 除了代码的可读性稍稍有一点点降低外，使用Combo Handler服务大大的降低了HTTP请求数，同时也减少了URL代码量，这对于Web性能优化来讲至关重要。所以，随后YUI从2.6.0开始，其核心组件YUI Loader内置了Combo Handling功能，即使用YUI Loader时，通过配置combine属性就可以把要加载的多个JavaScript或CSS文件按照使用Combo Handler服务的形式合并起来，这时只要静态文件的服务器支持Combo Handler就行了。在YUI中当combine配置为true时，CDN默认是使用Yahoo! CDN（http://yui.yahooapis.com），所以没有任何问题。这正是YUI最迷人的地方之一。 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Impressive Pixel &#187; YUI-based Helper Script for the Term Extractor API</title>
		<link>http://www.yuiblog.com/blog/2008/10/17/loading-yui/comment-page-1/#comment-523244</link>
		<dc:creator>Impressive Pixel &#187; YUI-based Helper Script for the Term Extractor API</dc:creator>
		<pubDate>Tue, 25 Nov 2008 15:19:51 +0000</pubDate>
		<guid isPermaLink="false">http://yuiblog.com/blog/2008/10/17/loading-yui/#comment-523244</guid>
		<description>[...] quick way to add Term Extractor to your application this may be of interest. The YUI dependencies (comprising the YUI Core + YUI Loader) are 17.4KB; the TermExtractor script is 1KB.    Leave a comment &#124; Trackback    &#171; Imagination [...]</description>
		<content:encoded><![CDATA[<p>[...] quick way to add Term Extractor to your application this may be of interest. The YUI dependencies (comprising the YUI Core + YUI Loader) are 17.4KB; the TermExtractor script is 1KB.    Leave a comment | Trackback    &laquo; Imagination [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Miraglia</title>
		<link>http://www.yuiblog.com/blog/2008/10/17/loading-yui/comment-page-1/#comment-522768</link>
		<dc:creator>Eric Miraglia</dc:creator>
		<pubDate>Mon, 24 Nov 2008 19:25:54 +0000</pubDate>
		<guid isPermaLink="false">http://yuiblog.com/blog/2008/10/17/loading-yui/#comment-522768</guid>
		<description>@Carlton,

I think the best approach, if I understand your problem correctly, would be to define each of your instantiation/configuration blocks as a separate &quot;module&quot; in YUI Loader.

http://developer.yahoo.com/yui/examples/yuiloader/yl-addmodule.html

Call the insert() method on the modules in the order you want them to fire (ie, in the order you want your components to instantiate).  Let YUI Loader do the heavy lifting for you -- it will calculate dependency trees for you and load whatever is missing (and do it with combo-handled requests) as needed, and only when needed.

This may mean a few additional requests, but the modularity it gives you is worth it in many cases.

If I&#039;ve missed the boat on your question here, let&#039;s take the conversation over to YDN-JavaScript.

Regards,
Eric</description>
		<content:encoded><![CDATA[<p>@Carlton,</p>
<p>I think the best approach, if I understand your problem correctly, would be to define each of your instantiation/configuration blocks as a separate &#8220;module&#8221; in YUI Loader.</p>
<p><a href="http://developer.yahoo.com/yui/examples/yuiloader/yl-addmodule.html" rel="nofollow">http://developer.yahoo.com/yui/examples/yuiloader/yl-addmodule.html</a></p>
<p>Call the insert() method on the modules in the order you want them to fire (ie, in the order you want your components to instantiate).  Let YUI Loader do the heavy lifting for you &#8212; it will calculate dependency trees for you and load whatever is missing (and do it with combo-handled requests) as needed, and only when needed.</p>
<p>This may mean a few additional requests, but the modularity it gives you is worth it in many cases.</p>
<p>If I&#8217;ve missed the boat on your question here, let&#8217;s take the conversation over to YDN-JavaScript.</p>
<p>Regards,<br />
Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlton Gibson</title>
		<link>http://www.yuiblog.com/blog/2008/10/17/loading-yui/comment-page-1/#comment-522556</link>
		<dc:creator>Carlton Gibson</dc:creator>
		<pubDate>Mon, 24 Nov 2008 12:06:10 +0000</pubDate>
		<guid isPermaLink="false">http://yuiblog.com/blog/2008/10/17/loading-yui/#comment-522556</guid>
		<description>Hi Eric, 

Great overview, thanks; I just have a question about best practices (and scoping) when loading multiple components. 

Let&#039;s say I have something like &lt;code&gt;require: [X, Y,Z]&lt;/code&gt;, where X, Y and Z are arbitrary YUI components.

Let&#039;s also say that I have non-trivial instantiation logic for each of these components. 

My question is how best would/could I structure my onSuccess() method to keep the all the instantiation logic from clashing? 

I&#039;d like to generate the loader config script on the server, perhaps with &lt;code&gt;$module=&gt;$setUp&lt;/code&gt; pairs, and my thought is that I need to use function literals themselves wrapped in parentheses to get what I&#039;m after. (My trouble is that it&#039;s precisely here that, for me at least, JavaScript gets confusing... ;-))

Thanks again,
Carlton</description>
		<content:encoded><![CDATA[<p>Hi Eric, </p>
<p>Great overview, thanks; I just have a question about best practices (and scoping) when loading multiple components. </p>
<p>Let&#8217;s say I have something like <code>require: [X, Y,Z]</code>, where X, Y and Z are arbitrary YUI components.</p>
<p>Let&#8217;s also say that I have non-trivial instantiation logic for each of these components. </p>
<p>My question is how best would/could I structure my onSuccess() method to keep the all the instantiation logic from clashing? </p>
<p>I&#8217;d like to generate the loader config script on the server, perhaps with <code>$module=&gt;$setUp</code> pairs, and my thought is that I need to use function literals themselves wrapped in parentheses to get what I&#8217;m after. (My trouble is that it&#8217;s precisely here that, for me at least, JavaScript gets confusing&#8230; ;-))</p>
<p>Thanks again,<br />
Carlton</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Miraglia</title>
		<link>http://www.yuiblog.com/blog/2008/10/17/loading-yui/comment-page-1/#comment-512547</link>
		<dc:creator>Eric Miraglia</dc:creator>
		<pubDate>Thu, 13 Nov 2008 17:45:36 +0000</pubDate>
		<guid isPermaLink="false">http://yuiblog.com/blog/2008/10/17/loading-yui/#comment-512547</guid>
		<description>@Kenny -- Wow -- I really failed you with this one.  Sorry about that.

Here are a couple of followups: 1. You&#039;re absolutely right -- Loader brings in all the required files that it perceives are needed for a given implementation.  So when we ask for TabView, it looks at what&#039;s on the page and gives us anything else we need to use TabView.  2.  Why would you use method 1 instead of method 2?  Well, if you really wanted the lightest seed file, 1 is the best option. In the case where you&#039;re not going to be using any scripts in the initial paint of the page and everything is going to be layered on unobtrusively, this is the lightest starting point.  But (3.), it&#039;s often the case that you *do* need to do thing like attach event listeners in the course of building a page, so and method 2 is good for that, and it&#039;s a good, performant compromise.  4.  As for the final method, you&#039;re right -- I didn&#039;t convey that very well.  The goal is to have a page that works well without JavaScript, and putting the whole JavaScript payload at the top of the page generally needs to be done only when the page *requires* JavaScript to function correctly.  If you take this single-file approach, though, putting the file at the bottom of the page *is* a good idea -- that means that the page painted and functioned without the script, and the JavaScript was just there to add enhanced functionality.

Sorry for the confusion -- please let me know if you have further questions.

-Eric</description>
		<content:encoded><![CDATA[<p>@Kenny &#8212; Wow &#8212; I really failed you with this one.  Sorry about that.</p>
<p>Here are a couple of followups: 1. You&#8217;re absolutely right &#8212; Loader brings in all the required files that it perceives are needed for a given implementation.  So when we ask for TabView, it looks at what&#8217;s on the page and gives us anything else we need to use TabView.  2.  Why would you use method 1 instead of method 2?  Well, if you really wanted the lightest seed file, 1 is the best option. In the case where you&#8217;re not going to be using any scripts in the initial paint of the page and everything is going to be layered on unobtrusively, this is the lightest starting point.  But (3.), it&#8217;s often the case that you *do* need to do thing like attach event listeners in the course of building a page, so and method 2 is good for that, and it&#8217;s a good, performant compromise.  4.  As for the final method, you&#8217;re right &#8212; I didn&#8217;t convey that very well.  The goal is to have a page that works well without JavaScript, and putting the whole JavaScript payload at the top of the page generally needs to be done only when the page *requires* JavaScript to function correctly.  If you take this single-file approach, though, putting the file at the bottom of the page *is* a good idea &#8212; that means that the page painted and functioned without the script, and the JavaScript was just there to add enhanced functionality.</p>
<p>Sorry for the confusion &#8212; please let me know if you have further questions.</p>
<p>-Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kenny Tilton</title>
		<link>http://www.yuiblog.com/blog/2008/10/17/loading-yui/comment-page-1/#comment-512471</link>
		<dc:creator>Kenny Tilton</dc:creator>
		<pubDate>Thu, 13 Nov 2008 14:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://yuiblog.com/blog/2008/10/17/loading-yui/#comment-512471</guid>
		<description>I was confused by a couple of things. In example one the comment on the page itself says &quot;This example loads the YUI Loader, then brings in Dom, Event, Element and TabView&quot; but all I see is Tabview being loaded. Below the code (but I could not figure out from the snippet where it went so I jumped to the exampled and viewed source) we learn (paraphrasing) &quot;This example loads Tabview and the loader takes care of loading Dom, Event, and Element.&quot; That may sound like a small difference, but to this noob was confused.

Next, when we get to method two I think we learn that one would never want to use method one. Perhaps method one should be described as &quot;just so you see the big picture&quot;. As it is, I find myself wondering when or why I would use #1, ie, what advantages it offers (since it is hard to imagine using YUI without DOM and Event).

The description of method 3 completely lost me. The motivation is &quot;when on-demand won&#039;t work&quot; so my first thought is that I do not know what on-demand means, because on-demand means &quot;use it and it will be there&quot;. Then the example given for when it won&#039;t work is just vague &quot;script-driven&quot; &quot;core interactions&quot; we want to render &quot;as quickly as possible&quot;...I find myself as a noob wondering what all that means, and an actual example of a page that won&#039;t work and why would eliminate a lot of confusion. 

Finally the method three commentary says &quot;this file should appear as late as possible&quot; and ends up explaining that that is why we should use method one or two. Hunh? Method three is why we should use method one or two? Then why am I being told about method three? Guessing: use method three if one&#039;s page does not require the core during construction of the page, which won&#039;t be often if one is having any fun at all with YUI.

Overall I sense there is a lot of good stuff in this article, but I find myself working hard to figure out what that good stuff is.</description>
		<content:encoded><![CDATA[<p>I was confused by a couple of things. In example one the comment on the page itself says &#8220;This example loads the YUI Loader, then brings in Dom, Event, Element and TabView&#8221; but all I see is Tabview being loaded. Below the code (but I could not figure out from the snippet where it went so I jumped to the exampled and viewed source) we learn (paraphrasing) &#8220;This example loads Tabview and the loader takes care of loading Dom, Event, and Element.&#8221; That may sound like a small difference, but to this noob was confused.</p>
<p>Next, when we get to method two I think we learn that one would never want to use method one. Perhaps method one should be described as &#8220;just so you see the big picture&#8221;. As it is, I find myself wondering when or why I would use #1, ie, what advantages it offers (since it is hard to imagine using YUI without DOM and Event).</p>
<p>The description of method 3 completely lost me. The motivation is &#8220;when on-demand won&#8217;t work&#8221; so my first thought is that I do not know what on-demand means, because on-demand means &#8220;use it and it will be there&#8221;. Then the example given for when it won&#8217;t work is just vague &#8220;script-driven&#8221; &#8220;core interactions&#8221; we want to render &#8220;as quickly as possible&#8221;&#8230;I find myself as a noob wondering what all that means, and an actual example of a page that won&#8217;t work and why would eliminate a lot of confusion. </p>
<p>Finally the method three commentary says &#8220;this file should appear as late as possible&#8221; and ends up explaining that that is why we should use method one or two. Hunh? Method three is why we should use method one or two? Then why am I being told about method three? Guessing: use method three if one&#8217;s page does not require the core during construction of the page, which won&#8217;t be often if one is having any fun at all with YUI.</p>
<p>Overall I sense there is a lot of good stuff in this article, but I find myself working hard to figure out what that good stuff is.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

