<commit_before>import './lib.js';

import Api from './Api.js';
import Global from './Global.js';
import ViewManager from './ViewManager.js';
import Router from './Router.js';

import * as views from './views/index.js';
import * as layouts from './layouts/index.js';
import * as stores from './stores/index.js';
import * as methods from './methods/index.js';
import * as routes from './routes/index.js';

$(document).ready(function(){
  window.app = {
    // api methods are general factory-functions that return models and collections
    api: new Api(methods),
    // global holds stores which are singletons of models or collections
    global: new Global(stores),
    // the viewManager handles rendering and disposal of views and layouts
    viewManager: new ViewManager({
      views: views,
      layouts: layouts,
      el: 'body'
    }),
    // the router translates url changes into instructions for the viewManager
    router: new Router(routes)
  };
  Backbone.history.start();
});<commit_msg>add more informative comments<commit_after>import './lib.js';

import Api from './Api.js';
import Global from './Global.js';
import ViewManager from './ViewManager.js';
import Router from './Router.js';

import * as views from './views/index.js';
import * as layouts from './layouts/index.js';
import * as stores from './stores/index.js';
import * as methods from './methods/index.js';
import * as routes from './routes/index.js';

$(document).ready(function(){

  window.app = {

    /*
      The api is just a container of functions, mainly factory functions that
      return model and collection instances.
    */
    api: new Api(methods),
    
    /*
      The global object contains 'stores' which are singletons of collections and
      models used to track application state. It is extended with Backbone.Events
      so it can channel even information between those stores.
    */
    global: new Global(stores),

    /*
      The viewManager handles rendering of combinations of layouts and their
      nested views, and keeps track of which are rendered to automate disposal
      upon every call to render a new layout/view set.
    */
    viewManager: new ViewManager({
      views: views,
      layouts: layouts,
      el: 'body'
    }),

    /*
      The router simply responds to url changes by telling the viewManager to
      render a new layout/view set accordingly.
    */
    router: new Router(routes)
  };

  Backbone.history.start();
});
{'fraction_non_alphanumeric': 0.11070559610705596, 'fraction_numerical': 0.0, 'mean_word_length': 3.017915309446254, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4071535', 'n_tokens_mistral': 669, 'n_tokens_neox': 658, 'n_words': 268}