Book Image

Learning JavaScriptMVC

By : Wojciech Bednarski
Book Image

Learning JavaScriptMVC

By: Wojciech Bednarski

Overview of this book

<p>JavaScriptMVC is a client-side, JavaScript framework that builds maintainable, error-free, lightweight applications as quickly as possible. As it does not depend on server components, it can be combined with any web service interface and server-side language.<br /><br />"Learning JavaScriptMVC" will guide you through all the framework aspects and show you how to build small- to mid-size well-structured and documented client-side applications you will love to work on.<br /><br />This book starts from JavaScriptMVC installation and all its components are explained with practical examples. It finishes with an example of building a web application. You will learn what the JavaScriptMVC framework is, how to install it, and how to use it efficiently.<br /><br />This book will guide you on how to build a sample application from scratch, test its codebase using unit testing, as well as test the whole application using functional testing, document it, and deploy the same. After reading Learning JavaScriptMVC you will learn how to install the framework and create a well-structured, documented and maintainable client-side application.</p>
Table of Contents (13 chapters)

Dependency management


Dependency management is a tool, which provides an organized way for managing software components to work together as a one system.

The following are a few StealJS key features:

  • Loading individual files only once

  • Loading files from different domains

  • Loading JavaScript and CoffeeScript

  • Loading CSS less

We have used StealJS many times in the previous chapters. Let's have a closer look at it now.

Using StealJS, we can load files as follows:

steal(
    'file_one',
    'file_two',
    function ($) {
    
    }
);

These files are loaded in parallel and in a random order. If file_two has dependences in file_one, we can wait for file_one before starting to fetch file_two, as follows:

steal(
    'file_one').then(
    
    'file_two',
    function ($) {
    
    }
);