<?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: Split the Initial Payload; Why are we sending all JavaScript down in one go</title>
	<atom:link href="http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:55:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<item>
		<title>By: Smokinn</title>
		<link>http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go/comment-page-1#comment-263908</link>
		<dc:creator>Smokinn</dc:creator>
		<pubDate>Sat, 17 May 2008 02:09:18 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3658#comment-263908</guid>
		<description>I find you have to be careful about not getting too over-zealous in your post-page-render download of javascript because it makes the page seem unresponsive. Especially in IE6.

IE6 sometimes gets stuck in &quot;loading&quot; mode forever (often if you have a 404 image or something of the sort by accident), so if you go for loading the javascript after the page has rendered you might never get it. I think if this is the route you want to take you should set a small timeout to download it instead of waiting for the page to be fully rendered.

If you only download functionality when the user wants to perform the action that&#039;s even worse for perceived responsiveness. If you&#039;re on a really fat pipe you might not notice but anyone with dialup (yeah, there are still a lot of them) will cringe at how sluggish your app is. People are used to a page taking a while to load when their connection is slow and don&#039;t mind waiting (well, not as much at least) but waiting each time they want to do something once the page is &quot;already loaded&quot;, they don&#039;t forgive.</description>
		<content:encoded><![CDATA[<p>I find you have to be careful about not getting too over-zealous in your post-page-render download of javascript because it makes the page seem unresponsive. Especially in IE6.</p>
<p>IE6 sometimes gets stuck in &#8220;loading&#8221; mode forever (often if you have a 404 image or something of the sort by accident), so if you go for loading the javascript after the page has rendered you might never get it. I think if this is the route you want to take you should set a small timeout to download it instead of waiting for the page to be fully rendered.</p>
<p>If you only download functionality when the user wants to perform the action that&#8217;s even worse for perceived responsiveness. If you&#8217;re on a really fat pipe you might not notice but anyone with dialup (yeah, there are still a lot of them) will cringe at how sluggish your app is. People are used to a page taking a while to load when their connection is slow and don&#8217;t mind waiting (well, not as much at least) but waiting each time they want to do something once the page is &#8220;already loaded&#8221;, they don&#8217;t forgive.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tj111</title>
		<link>http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go/comment-page-1#comment-263899</link>
		<dc:creator>tj111</dc:creator>
		<pubDate>Fri, 16 May 2008 18:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3658#comment-263899</guid>
		<description>For a while I&#039;ve been thinking about building an &#039;import&#039; method similar to python using mootools &lt;a href=&quot;http://docs12b.mootools.net/Plugins/Assets#Assets:javascript&quot; rel=&quot;nofollow&quot;&gt;Assets.javascript&lt;/a&gt; class, but just haven&#039;t gotten around to it yet.  That way you can load things you need after page loads, instead of messing with page download and rendering times</description>
		<content:encoded><![CDATA[<p>For a while I&#8217;ve been thinking about building an &#8216;import&#8217; method similar to python using mootools <a href="http://docs12b.mootools.net/Plugins/Assets#Assets:javascript" rel="nofollow">Assets.javascript</a> class, but just haven&#8217;t gotten around to it yet.  That way you can load things you need after page loads, instead of messing with page download and rendering times</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vitrus</title>
		<link>http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go/comment-page-1#comment-263882</link>
		<dc:creator>vitrus</dc:creator>
		<pubDate>Fri, 16 May 2008 10:29:29 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3658#comment-263882</guid>
		<description>Many frameworks have their ways of solving this problem. I used to work with backbase which simply checks which &#039;tags&#039; are located in the document and then loads the correct files (which even contain the CSS for those widgets).

In a not too complicated environment every programmer can choose for himself what to load at what time. And: modern browsers do not need the script tag in the head so we could also add our script tags just below the end of the body right? That should solve the progressive rendering problem steve describes.</description>
		<content:encoded><![CDATA[<p>Many frameworks have their ways of solving this problem. I used to work with backbase which simply checks which &#8216;tags&#8217; are located in the document and then loads the correct files (which even contain the CSS for those widgets).</p>
<p>In a not too complicated environment every programmer can choose for himself what to load at what time. And: modern browsers do not need the script tag in the head so we could also add our script tags just below the end of the body right? That should solve the progressive rendering problem steve describes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikael Bergkvist</title>
		<link>http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go/comment-page-1#comment-263881</link>
		<dc:creator>Mikael Bergkvist</dc:creator>
		<pubDate>Fri, 16 May 2008 08:47:16 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3658#comment-263881</guid>
		<description>Widgetplus solves the problem automatically, it downloads further javascripts whenever new apps are required.
It&#039;s probably one of the few frameworks that thought of this from the very conception-</description>
		<content:encoded><![CDATA[<p>Widgetplus solves the problem automatically, it downloads further javascripts whenever new apps are required.<br />
It&#8217;s probably one of the few frameworks that thought of this from the very conception-</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: polterguy</title>
		<link>http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go/comment-page-1#comment-263879</link>
		<dc:creator>polterguy</dc:creator>
		<pubDate>Thu, 15 May 2008 23:29:43 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3658#comment-263879</guid>
		<description>Interesting but old news ;)
We&#039;ve had JS on demand in Ajax Callback for more than 9 months now, and also all of our JS for all of our widgets (more than 40 widgets) are in fact LESS than the size (before gzip) of the &quot;average top website&quot;... ;)
Oh yeah @Gordon
We&#039;re 100% validating after Glory ;)
(meaning in roughly 20 days from now)</description>
		<content:encoded><![CDATA[<p>Interesting but old news ;)<br />
We&#8217;ve had JS on demand in Ajax Callback for more than 9 months now, and also all of our JS for all of our widgets (more than 40 widgets) are in fact LESS than the size (before gzip) of the &#8220;average top website&#8221;&#8230; ;)<br />
Oh yeah @Gordon<br />
We&#8217;re 100% validating after Glory ;)<br />
(meaning in roughly 20 days from now)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gordon</title>
		<link>http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go/comment-page-1#comment-263877</link>
		<dc:creator>Gordon</dc:creator>
		<pubDate>Thu, 15 May 2008 21:12:06 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3658#comment-263877</guid>
		<description>OT: With the exception of Wikipedia and - surprise - MSN none of these sites validate. No wonder our clients still think Webstandards don&#039;t matter, when names likes these on the list still don&#039;t seem to care.</description>
		<content:encoded><![CDATA[<p>OT: With the exception of Wikipedia and &#8211; surprise &#8211; MSN none of these sites validate. No wonder our clients still think Webstandards don&#8217;t matter, when names likes these on the list still don&#8217;t seem to care.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go/comment-page-1#comment-263874</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Thu, 15 May 2008 18:07:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3658#comment-263874</guid>
		<description>Zazzle&#039;s Web site makes extensive use of deferred loading of components of UI. The shirt design tool, for example, will load the supporting JavaScript widget class code and component markup for various features, only when those features are invoked.

The UIZE Framework, that is used throughout the zazzle.com Web site, provides a mechanism to facilitate deferred loading / load-on-demand / lazy loading / whatever-you-want-to-call-it. The JS client interaction of all pages is managed by a single instance of the &quot;page widget&quot; (this is a concept that UIZE introduces). Because UIZE, at its core, offers a feature called a widget hierarchy, child widgets on the page can access features provided by their host context, in this case the page widget. It is the page widget that offers support for loading components on demand (the concept of receiving functionality from a parent on the widget tree is a concept I call the &quot;abundant context&quot;).

Finding the balance between caching benefits of static JS libraries and load-only-as-much-as-needed is kind of an art form. I think it&#039;s still best left to developers, although you could argue that with enough machine intelligence and data upon which to base decisions, a server could provide the &quot;split&quot; points. It seems like an incredibly complex problem to solve, and its solution could be quite intrusive into coding practices and framework architecture, and I fear that it&#039;s a problem that&#039;s more &quot;cool&quot; to solve than incredibly compelling - kind of in the diminishing returns territory.</description>
		<content:encoded><![CDATA[<p>Zazzle&#8217;s Web site makes extensive use of deferred loading of components of UI. The shirt design tool, for example, will load the supporting JavaScript widget class code and component markup for various features, only when those features are invoked.</p>
<p>The UIZE Framework, that is used throughout the zazzle.com Web site, provides a mechanism to facilitate deferred loading / load-on-demand / lazy loading / whatever-you-want-to-call-it. The JS client interaction of all pages is managed by a single instance of the &#8220;page widget&#8221; (this is a concept that UIZE introduces). Because UIZE, at its core, offers a feature called a widget hierarchy, child widgets on the page can access features provided by their host context, in this case the page widget. It is the page widget that offers support for loading components on demand (the concept of receiving functionality from a parent on the widget tree is a concept I call the &#8220;abundant context&#8221;).</p>
<p>Finding the balance between caching benefits of static JS libraries and load-only-as-much-as-needed is kind of an art form. I think it&#8217;s still best left to developers, although you could argue that with enough machine intelligence and data upon which to base decisions, a server could provide the &#8220;split&#8221; points. It seems like an incredibly complex problem to solve, and its solution could be quite intrusive into coding practices and framework architecture, and I fear that it&#8217;s a problem that&#8217;s more &#8220;cool&#8221; to solve than incredibly compelling &#8211; kind of in the diminishing returns territory.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cromwellian</title>
		<link>http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go/comment-page-1#comment-263872</link>
		<dc:creator>cromwellian</dc:creator>
		<pubDate>Thu, 15 May 2008 17:05:42 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3658#comment-263872</guid>
		<description>GWT actually solves two problems. First, it can detect classes, functions, fields, and parameters in your script which are never used and remove them. It aggressively obfuscates (much more so than typical JS minifiers/packers in a gzip-friendly way) everything further reducing the size.

Secondly, there the proposal for the GWT.createAsync() method, which I believe they have already proven via a prototype. This differs from Microsoft&#039;s approach in that the developer chooses the splitting points, and then calls GWT.createAsync() to instantiate a lazily loaded class. The compiler will then compute the transitive closure of every reachable method from that lazily loaded class (that is not reachable from the entry point of the program), and ensure that those classes/methods are placed in a separate JS file.

This has pros and cons and differs from Doloto:
Con: you have to manually pick the split points.
Pro: You avoid the issues with trying to make the stub functions synchronous (since the JS has to be loaded asynchronously).

I think the Doloto approach, like the Volta approach for tier-splitting suffers from a leaky abstraction. They try to hide too much from the developer, whereas I think achieving an optimal split between progressive loading, or client/server that maximizes user experience takes a little bit of developer forethought and probably can&#039;t be totally automated.</description>
		<content:encoded><![CDATA[<p>GWT actually solves two problems. First, it can detect classes, functions, fields, and parameters in your script which are never used and remove them. It aggressively obfuscates (much more so than typical JS minifiers/packers in a gzip-friendly way) everything further reducing the size.</p>
<p>Secondly, there the proposal for the GWT.createAsync() method, which I believe they have already proven via a prototype. This differs from Microsoft&#8217;s approach in that the developer chooses the splitting points, and then calls GWT.createAsync() to instantiate a lazily loaded class. The compiler will then compute the transitive closure of every reachable method from that lazily loaded class (that is not reachable from the entry point of the program), and ensure that those classes/methods are placed in a separate JS file.</p>
<p>This has pros and cons and differs from Doloto:<br />
Con: you have to manually pick the split points.<br />
Pro: You avoid the issues with trying to make the stub functions synchronous (since the JS has to be loaded asynchronously).</p>
<p>I think the Doloto approach, like the Volta approach for tier-splitting suffers from a leaky abstraction. They try to hide too much from the developer, whereas I think achieving an optimal split between progressive loading, or client/server that maximizes user experience takes a little bit of developer forethought and probably can&#8217;t be totally automated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Holooli</title>
		<link>http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go/comment-page-1#comment-263866</link>
		<dc:creator>Holooli</dc:creator>
		<pubDate>Thu, 15 May 2008 14:59:37 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3658#comment-263866</guid>
		<description>It&#039;s nice to mention this point ... I really didn&#039;t pay attention to this case.

Anyhow do you any open source projects or tools like Doloto</description>
		<content:encoded><![CDATA[<p>It&#8217;s nice to mention this point &#8230; I really didn&#8217;t pay attention to this case.</p>
<p>Anyhow do you any open source projects or tools like Doloto</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sjivan</title>
		<link>http://ajaxian.com/archives/split-the-initial-payload-why-are-we-sending-all-javascript-down-in-one-go/comment-page-1#comment-263865</link>
		<dc:creator>sjivan</dc:creator>
		<pubDate>Thu, 15 May 2008 14:56:54 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=3658#comment-263865</guid>
		<description>This is a problem with GWT too and I had posted on the GWT contrib forums a while ago :

http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/2ebaed0b9ce252bc/6219c92867f81b6a?lnk=gst

Bruce said that they were discussing this but I&#039;m not sure how much concrete work has been done.</description>
		<content:encoded><![CDATA[<p>This is a problem with GWT too and I had posted on the GWT contrib forums a while ago :</p>
<p><a href="http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/2ebaed0b9ce252bc/6219c92867f81b6a?lnk=gst" rel="nofollow">http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/2ebaed0b9ce252bc/6219c92867f81b6a?lnk=gst</a></p>
<p>Bruce said that they were discussing this but I&#8217;m not sure how much concrete work has been done.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

