Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #826 from zhouyaoji/mojito_configuring_corrections
Browse files Browse the repository at this point in the history
[docs] Rewrote introductory paragraph, removed obsolete config params ( "deferAllOptionalAutoloads", "useRollups", "extraModules", "loader", "urlContains", "base" and "url").
  • Loading branch information
Joe Catera committed Dec 4, 2012
2 parents 043ee5d + ea4d14e commit e716cc5
Showing 1 changed file with 24 additions and 37 deletions.
61 changes: 24 additions & 37 deletions docs/dev_guide/intro/mojito_configuring.rst
Expand Up @@ -9,7 +9,7 @@ Basic Information

Mojito can be configured at the framework, application, and mojit levels.
Each level is configured differently, but uses same general file format
consisting of JSON.
consisting of JSON or YAML.

.. _config_basic-file:

Expand All @@ -23,15 +23,21 @@ JSON

By default, configuration files in Mojito have a general top-level
structure and are in JSON format. At the top level of each configuration
file is an array. Each item of the array is an object that configures
one component of Mojito, such as logging, assets, mojits, static resources, etc.

Each configuration object is required to have a ``settings`` property that
specifies contexts for applying the configuration settings. These conditions
could be used to determine the configurations in different environments.

Below is the skeleton of a configuration file. See `Application Configuration`_
and `Mojit Configuration`_ for details about specific configuration files.
file is an array. Each item of the array is an object containing configuration that
targets a specific context and runtime. This allows you to have discrete configurations
for different regions, devices, and development environments.

The context for a configuration object is specified by the ``settings`` property. For
each configuration object in a file, the ``settings`` property must specify a unique
context, otherwise Mojito fails. For example, the ``application.json`` file
cannot have two configuration objects specifying the context ``environment:development``.
See `Using Context Configurations <../topics/mojito_using_contexts.html>`_
for more information about contexts.

Below is the skeleton of a configuration file with two configuration
objects, each identified by contexts defined by the ``settings`` property.
See `Application Configuration`_ and `Mojit Configuration`_ for details about specific
configuration files.

.. code-block:: javascript
Expand All @@ -43,6 +49,12 @@ and `Mojit Configuration`_ for details about specific configuration files.
...
}
},
{
"settings": [ "environment:development" ],
"specs": {
...
}
},
...
]
Expand Down Expand Up @@ -105,12 +117,6 @@ configuration Object
| | | | to cache the view. Note that not all view engines |
| | | | support caching. |
+--------------------------------------------------------+----------------------+-------------------+--------------------------------------------------------+
| ``deferAllOptionalAutoloads`` | boolean | false | Specifies whether optional YUI modules found in the |
| | | | ``/autoload/`` and ``/yui_modules/`` directories are |
| | | | not shipped to the client. This is an optimization |
| | | | setting and should generally only be set if you are |
| | | | building an offline application. |
+--------------------------------------------------------+----------------------+-------------------+--------------------------------------------------------+
| ``middleware`` | array of strings | [] | A list of paths to the Node.js module that exports |
| | | | a Connect middleware function. |
+--------------------------------------------------------+----------------------+-------------------+--------------------------------------------------------+
Expand Down Expand Up @@ -380,12 +386,6 @@ staticHandling Object
| | | | ``/static/``. An empty string can be given if no |
| | | | prefix is desired. |
+-----------------------+---------------+-----------------------------+--------------------------------------------------------+
| ``useRollups`` | boolean | false | When true, the client will use the rollup file (if |
| | | | it exists) to load the YUI modules in the mojit. |
| | | | The command `mojito compile rollups <../reference/ |
| | | | mojito_cmdline.html#compiling-rollups>`_ can be used |
| | | | to generate the rollups. |
+-----------------------+---------------+-----------------------------+--------------------------------------------------------+

.. _yui_obj:

Expand All @@ -397,28 +397,15 @@ See `Example Application Configurations`_ for an example of the ``yui`` object.
+--------------------------------+----------------------+------------------------------------------------------------------------+
| Property | Data Type | Description |
+================================+======================+========================================================================+
| ``base`` | string | Specifies the prefix from which to load all YUI 3 libraries. |
+--------------------------------+----------------------+------------------------------------------------------------------------+
| :ref:`config <yui_config>` | object | Used to populate the `YUI_config <http://yuilibrary.com/yui/docs/yui/ |
| | | #yui_config>`_ global variable that allows you to configure every YUI |
| | | instance on the page even before YUI is loaded. For example, you can |
| | | configure logging or YUI not to load its default CSS with the |
| | | following: ``"yui": { "config": { "fetchCSS": false } }`` |
+--------------------------------+----------------------+------------------------------------------------------------------------+
| ``extraModules`` | array of strings | Specifies additional YUI library modules that should be added to |
| | | the page when Mojito is sent to the client. |
+--------------------------------+----------------------+------------------------------------------------------------------------+
| ``loader`` | string | Specifies the path (appended to ``base`` above) for the loader to |
| | | use. |
+--------------------------------+----------------------+------------------------------------------------------------------------+
| ``showConsoleInClient`` | boolean | Determines if the YUI debugging console will be shown on the |
| | | client. |
+--------------------------------+----------------------+------------------------------------------------------------------------+
| ``url`` | string | Specifies the location of the `YUI 3 seed file <http://yuilibrary.com/ |
| | | yui/docs/yui/#base-seed>`_. |
+--------------------------------+----------------------+------------------------------------------------------------------------+
| ``urlContains`` | array of strings | Specifies the YUI modules that are delivered by ``url``. |
+--------------------------------+----------------------+------------------------------------------------------------------------+


.. _yui_config:
Expand Down Expand Up @@ -724,8 +711,8 @@ The table below describes the ``configuration`` object in ``definition.json``.
+==================+======================+===================+========================================================+
| ``appLevel`` | boolean | false | When set to ``true``, the actions, addons, assets, |
| | | | binders, models, and view of the mojit are |
| | | | available to other mojits. Mojits wanting to use |
| | | | the resources of application-level mojit must |
| | | | *shared* with other mojits. Mojits wanting to use |
| | | | the resources of the shared mojit must |
| | | | include the YUI module of the application-level |
| | | | mojit in the ``requires`` array. |
+------------------+----------------------+-------------------+--------------------------------------------------------+
Expand Down

0 comments on commit e716cc5

Please sign in to comment.