Skip to content

Commit

Permalink
Merge pull request #20 from manojkumarm/gh-pages
Browse files Browse the repository at this point in the history
Fixed typos.
  • Loading branch information
thomasdavis committed Nov 15, 2011
2 parents eb07cda + 5d1174d commit 44f168c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions _site/organizing-backbone-using-modules/index.html
Expand Up @@ -91,7 +91,7 @@ <h1>Backbone Tutorials</h1>
<hr>
<div id="post">
<h2>Organizing your application using Modules (require.js)</h2>
<p>Unfortunatly Backbone.js does not tell you how to organize your code leaving many developers in the dark of how to load scripts and lay out their development enviroments.</p>
<p>Unfortunately Backbone.js does not tell you how to organize your code leaving many developers in the dark of how to load scripts and lay out their development environments.</p>
<p>This was quite a different decision to other Javascript <span class="caps">MVC</span> frameworks who were more in favor of setting a development philosophy.</p>
<p>Hopefully this tutorial will allow you to build a much more robust project with great separation of concerns between design and code.</p>
<p>This tutorial will get you started on combining Backbone.js with <a href="http://www.com"><span class="caps">AMD</span></a> (Asynchronous Module Definitions).</p>
Expand All @@ -107,17 +107,17 @@ <h3>What is <span class="caps">AMD</span>?</h3>
<li>Market Adoption( <a href="http://dojotoolkit.org/reference-guide/releasenotes/1.6.html">Dojo 1.6 converted fully to <span class="caps">AMD</span></a> )</li>
</ul>
<h3>Why Require.js?</h3>
<p>Require.js has a boastful community and is growing rapidly. <a href="http://tagneto.blogspot.com/">James Burke</a> the author updates Require.js almost daily and responds to user feedback always. A leading expert in script loading, he is also a contributer to the <span class="caps">AMD</span> specification.</p>
<p>Require.js has a boastful community and is growing rapidly. <a href="http://tagneto.blogspot.com/">James Burke</a> the author updates Require.js almost daily and responds to user feedback always. A leading expert in script loading, he is also a contributor to the <span class="caps">AMD</span> specification.</p>
<p><a href="https://twitter.com/jrburke" class="twitter-follow-button">Follow @jrburke</a><br />
<script src="//platform.twitter.com/widgets.js" type="text/javascript"></script></p>
<h3>Getting started</h3>
<p>To easily understand this tutorial you should jump straight into the example code base.</p>
<h3><a href="http://backbonetutorials.com/examples/modular-backbone">Example Codebase</a></h3>
<p>The tutorial is only loosely coupled with the example and you will find the example to be more comprehensive.</p>
<p>If you would like to see how a particuliar use case would be implemented please visit the Github page and create an issue.(Example Request: How to do nested views)</p>
<p>If you would like to see how a particular use case would be implemented please visit the Github page and create an issue.(Example Request: How to do nested views)</p>
<p>The example isn&#8217;t super fleshed out but should give you a vague idea.</p>
<h3>Example File Structure</h3>
<p>There are many different ways to lay out your files and I believe it is actually dependent on the size of the project. In the example below views and template s are mirroed in file structure. Collections and Models aren&#8217;t categorized into folders.</p>
<p>There are many different ways to lay out your files and I believe it is actually dependent on the size of the project. In the example below views and template s are mirrored in file structure. Collections and Models aren&#8217;t categorized into folders.</p>
<div class="highlight"><pre><code class="javascript"><span class="cm">/* File Structure</span>
<span class="cm">├── imgs</span>
<span class="cm">├── css</span>
Expand Down Expand Up @@ -191,9 +191,9 @@ <h4>What does the bootstrap look like?</h4>
<p>Our bootstrap file will be responsible for configuring Require.js and loading initially important dependencies.</p>
<p>In the below example we configure Require.js to create shortcut alias to commonly used scripts such as jQuery, Underscore and Backbone.</p>
<p>Due to the nature of these libraries implementations we actually have to load them in order because they each depend on each other existing in the global namespace(which is bad but is all we have to work with).</p>
<p>Hopefully if the <span class="caps">AMD</span> specification takes off these libraries will add code to allow themselves to be loaded asynchronously. Due to this inconvience the bootstrap is not as intuitive as it could be, I hope to solve this problem in the near future.</p>
<p>We also request a module called &#8220;app&#8221;, this will contain the entireity of our application logic.</p>
<p><b>Note:</b> Modules are loaded relativly to the boot strap and always append with &#8220;.js&#8221;. So the module &#8220;app&#8221; will load &#8220;app.js&#8221; which is in the same directory as the bootstrap.</p>
<p>Hopefully if the <span class="caps">AMD</span> specification takes off these libraries will add code to allow themselves to be loaded asynchronously. Due to this inconvenience the bootstrap is not as intuitive as it could be, I hope to solve this problem in the near future.</p>
<p>We also request a module called &#8220;app&#8221;, this will contain the entirety of our application logic.</p>
<p><b>Note:</b> Modules are loaded relatively to the boot strap and always append with &#8220;.js&#8221;. So the module &#8220;app&#8221; will load &#8220;app.js&#8221; which is in the same directory as the bootstrap.</p>
<div class="highlight"><pre><code class="javascript"><span class="c1">// Filename: main.js</span>

<span class="c1">// Require.js allows us to configure shortcut alias</span>
Expand Down Expand Up @@ -226,7 +226,7 @@ <h4>What does the bootstrap look like?</h4>
</div>
<h3>How should we lay out external scripts?</h3>
<p>Any modules we develop for our application using <span class="caps">AMD</span>/Require.js will be asynchronously loaded.</p>
<p>We have a heavy dependency on jQuery, Underscore and Backbone, unfortunatly this libraries are loaded synchronously and also depend on each other existing in the global namespace.</p>
<p>We have a heavy dependency on jQuery, Underscore and Backbone, unfortunately these libraries are loaded synchronously and also depend on each other existing in the global namespace.</p>
<p>Below I propose a solution(until these libraries allow themselves to be loaded asynchronously) to allow these libraries to be loaded properly(synchronously) and also removing themselves from global scope.</p>
<div class="highlight"><pre><code class="javascript"><span class="c1">// Filename: libs/jquery/jquery.js</span>

Expand Down

0 comments on commit 44f168c

Please sign in to comment.