<?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>Kris Range &#187; javascript</title>
	<atom:link href="http://blog.krisrange.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.krisrange.com</link>
	<description>Web development</description>
	<lastBuildDate>Fri, 16 Sep 2011 15:23:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>MVC experiment in JS</title>
		<link>http://blog.krisrange.com/2011/09/mvc-experiment-in-js/</link>
		<comments>http://blog.krisrange.com/2011/09/mvc-experiment-in-js/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 17:38:12 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[experiment]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[puremvc]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=139</guid>
		<description><![CDATA[The past 3 years I&#8217;ve been using PureMVC pretty consistently in both my ActionScript and Objective-C projects. I&#8217;ve really enjoyed it&#8217;s workflow but when looking into the JavaScript port, was not interested in the dependencies required by the different JS ports (mootools, extjs or prototype). So, this weekend I spent some time in a local [...]]]></description>
			<content:encoded><![CDATA[<p>The past 3 years I&#8217;ve been using PureMVC pretty consistently in both my ActionScript and Objective-C projects. I&#8217;ve really enjoyed it&#8217;s workflow but when looking into the JavaScript port, was not interested in the dependencies required by the different JS ports (mootools, extjs or prototype). So, this weekend I spent some time in a local cafe here in Stockholm experimenting with creating a small MVC framework of my own in JavaScript.</p>
<p>I set out a few goals for myself:</p>
<ol>
<li>A similar workflow to my usual process. In AS3, for example, I use a quality plug-in called <a title="Fabrication" href="http://code.google.com/p/fabrication/" target="_blank">Fabrication</a>, which simplifies a few of the more medial tasks which occur in PureMVC.</li>
<li>As few or no dependencies required</li>
<li>Minimal size impact</li>
</ol>
<p>What came out of this with was <a title="&quot;JS-MVC&quot;" href="https://github.com/krange/JS-MVC" target="_blank">JS-MVC</a>. Since it is only an experiment, the naming is quite generic <img src='http://blog.krisrange.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  but I think the outcome was quite successful. I put up some quick documentation on github if you are interested in reading more.</p>
<p>The successes from the experiment were the following:</p>
<ul>
<li>It&#8217;s format is very similar to PureMVC. There exists a Facade, Commands, Models and Mediators. I renamed Notifications to Messages. Much easier to type.</li>
<li>I also included some of the features provided by Fabrication. Two examples were the mediator message interest function shortcuts &#8220;respondTo + {MSG_NAME}&#8221; and sugar methods for registering, removing, and retrieving other framework actors.</li>
<li>Total file size compressed and minimized was 5.7kb, which is a good chunk less than PureMVC + mootools minimized.</li>
<li>I ended up with only 1 dependency, which was John Resig&#8217;s <a href="http://ejohn.org/blog/simple-javascript-inheritance" target="_blank">Simple JavaScript Inheritence</a> class. It looked like the best choice for the experiment.</li>
</ul>
<p>The things I really ended up not happy with were:</p>
<ul>
<li>Not being able to fit in multi-core and module functionality into the experiement, but eventually continuing this further could lead to those additions.</li>
<li>No unit-testing. Not really in the scope of the experiment but would have been a real nice addition.</li>
<li>Not doing these sort of experiments before!</li>
</ul>
<div>Link to the github repository: <a href="https://github.com/krange/JS-MVC" target="_blank">https://github.com/krange/JS-MVC</a></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2011/09/mvc-experiment-in-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ANT with JavaScript</title>
		<link>http://blog.krisrange.com/2010/05/ant-with-javascript/</link>
		<comments>http://blog.krisrange.com/2010/05/ant-with-javascript/#comments</comments>
		<pubDate>Thu, 20 May 2010 16:55:49 +0000</pubDate>
		<dc:creator>krange</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.krisrange.com/?p=26</guid>
		<description><![CDATA[Recently at work we had the need to build an application that could both be run over the network and on the local filesystem. Well, this doesn&#8217;t work with the Flash security setup as SWF files can only be run on one or the other. Like many other developers, we use ANT to build our [...]]]></description>
			<content:encoded><![CDATA[<p>Recently at work we had the need to build an application that could both be run over the network and on the local filesystem. Well, this doesn&#8217;t work with the Flash security setup as SWF files can only be run on one or the other. Like many other developers, we use ANT to build our projects and would like setting this property to be built into our build files. The SDK compiler has a nice property called &#8220;use-network&#8221; which can easily be set to true or false depending on your need which solves this situation nicely. The problem we ran into was with ANT and dealing with IF/ELSE target statements.</p>
<p>What we wanted to do was to use the same build SWF targets but for both situations without having to modify our process. Our solution was a nifty trick that used JavaScript inside ANT. I had never seen this technique before but some searching for a solution led us in this direction.</p>
<p>As you can see below, we have two initial targets, one which builds for local file system and one which builds for network use. We can then run either target first, which sets a property in our ANT file and then run our normal SWF build targets as normal, with this property set to the &#8220;use-network&#8221; property. Really looking forward to exploring some more complexities with JavaScript integration (as well as other languages from what I&#8217;ve read).</p>
<pre>
&lt;target name=&quot;compile_local&quot;&gt;
	&lt;script language=&quot;javascript&quot;&gt;
	&lt;![CDATA[
		presenter.setProperty( &quot;use-network&quot;, &quot;false&quot; );
	]]&gt;
	&lt;/script&gt;
&lt;/target&gt;
&lt;target name=&quot;compile_network&quot;&gt;
	&lt;script language=&quot;javascript&quot;&gt;
	&lt;![CDATA[
		presenter.setProperty( &quot;use-network&quot;, &quot;true&quot; );
	]]&gt;
	&lt;/script&gt;
&lt;/target&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.krisrange.com/2010/05/ant-with-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

