From 438fd9b2a54c6ed0e566041c8344ed44ee67f27b Mon Sep 17 00:00:00 2001 From: Joe Catera Date: Mon, 3 Dec 2012 17:29:35 -0800 Subject: [PATCH 1/2] Changed 'autoload' to 'yui_modules' in documentation. --- docs/dev_guide/code_exs/yui_modules.rst | 22 ++++++++-------- docs/dev_guide/intro/mojito_apps.rst | 26 +++++++++---------- docs/dev_guide/intro/mojito_configuring.rst | 10 +++---- docs/dev_guide/reference/glossary.rst | 7 ----- .../reference/mojito_troubleshooting.rst | 8 +++--- docs/dev_guide/topics/mojito_assets.rst | 8 +++--- docs/dev_guide/topics/mojito_extensions.rst | 6 ++--- .../topics/mojito_resource_store.rst | 2 +- docs/dev_guide/topics/mojito_testing.rst | 4 +-- 9 files changed, 43 insertions(+), 50 deletions(-) diff --git a/docs/dev_guide/code_exs/yui_modules.rst b/docs/dev_guide/code_exs/yui_modules.rst index 7f461cb0d..683c9b91c 100644 --- a/docs/dev_guide/code_exs/yui_modules.rst +++ b/docs/dev_guide/code_exs/yui_modules.rst @@ -19,7 +19,7 @@ page views and browser sessions. The following topics will be covered: -- adding YUI modules to the ``autoload`` directory +- adding YUI modules to the ``yui_modules`` directory - accessing YUI modules from a mojit .. _code_exs-incl_yui_mods-notes: @@ -38,9 +38,9 @@ Location ######## To add YUI modules that all your mojits can access, place the modules in the -``autoload`` directory under the application directory. For example, YUI +``yui_modules`` directory under the application directory. For example, YUI modules in the ``hello_world`` application would be placed in -``hello_world/autoload``. +``hello_world/yui_modules``. .. _yui_mod_impl_add-naming: @@ -70,7 +70,7 @@ the module identified by the string ``'gallery-storage-lite'``. YUI.add('gallery-storage-lite', function (Y) { ... - }, '1.0.0', { requires: ['event-base', 'event-custom', 'event-custom-complex', 'json']}); + }, '1.0.0', { requires: [ 'event-base', 'event-custom', 'event-custom-complex', 'json']}); .. _yui_mod_impl-using: @@ -78,7 +78,7 @@ the module identified by the string ``'gallery-storage-lite'``. Using a YUI Module from Mojits ------------------------------ -After registered YUI modules have been added to the ``autoload`` directory, you +After registered YUI modules have been added to the ``yui_modules`` directory, you can load them into your mojit code by listing them as dependencies in the ``requires`` array. In the binder ``index.js`` below, you can see that the Storage Lite module that we created and registered in :ref:`registering_module` @@ -95,7 +95,7 @@ is listed as a dependency in the ``requires`` array. ... } }; - // See autoload/storage-lite.client.js + // See yui_modules/storage-lite.client.js }, '0.0.1', {requires: [ 'gallery-storage-lite' ]}); In the ``bind`` method, ``Y.StorageLite.getItem`` and ``Y.StorageLite.setItem`` @@ -177,12 +177,12 @@ To set up and run ``yui_module``: } ] -#. Create the autoload directory for storing the Storage Lite module. +#. Create the ``yui_modules`` directory for storing the Storage Lite module. - ``$ mkdir autoload`` -#. Get the Storage Lite module and place it in the ``autoload`` directory. + ``$ mkdir yui_modules`` +#. Get the Storage Lite module and place it in the ``yui_modules`` directory. - ``$ wget -O autoload/storage-lite.client.js https://raw.github.com/rgrove/storage-lite/master/src/storage-lite.js --no-check-certificate`` + ``$ wget -O yui_modules/storage-lite.client.js https://raw.github.com/rgrove/storage-lite/master/src/storage-lite.js --no-check-certificate`` #. Change to ``mojits/Notepad``. #. Replace the code in ``controller.server.js`` with the following: @@ -227,7 +227,7 @@ To set up and run ``yui_module``: }; }, '0.0.1', { requires: [ - 'gallery-storage-lite' //see autoload/storage-lite.client.js + 'gallery-storage-lite' //see yui_modules/storage-lite.client.js ] }); diff --git a/docs/dev_guide/intro/mojito_apps.rst b/docs/dev_guide/intro/mojito_apps.rst index 194b58449..e2e47907f 100644 --- a/docs/dev_guide/intro/mojito_apps.rst +++ b/docs/dev_guide/intro/mojito_apps.rst @@ -56,9 +56,9 @@ globally available to all mojits. Those marked with an asterisk are not created - ``assets`` - general directory containing CSS files for all mojits. - ``application.json`` - application configuration file that lets you specify the port and the mojits used by the application. -- ``autoload`` - directory of JavaScript files that contain YUI modules added - with ``YUI.add``. These files aren't actually *auto-loaded*, but are merely - automatically included if required by a YUI module. +- ``yui_modules`` - directory of JavaScript files that contain YUI modules added + with ``YUI.add``. These files are automatically included if required by a + YUI module. - ``default.json`` - file that sets default values for all specifications. - ``mojits`` - directory storing the mojits. See `Mojit Files and Directories`_ for a description of the directory contents. @@ -94,10 +94,10 @@ is available. - ``actions`` - directory of JavaScript files containing methods to add to the controller. Actions are useful for maintaining large controllers. - ``assets`` - directory for storing CSS or JavaScript files. -- ``autoload`` - directory containing JavaScript files that contain YUI - modules added with ``YUI.add``. These files aren't actually *autoloaded*, - but are merely automatically included if required by a YUI module. Both - the application directory and mojit directory can have ``autoload`` directories. +- ``yui_modules`` - directory containing JavaScript files that contain YUI + modules added with ``YUI.add``. These files are automatically included if required by a + YUI module. Both the application directory and mojit directory can have ``yui_modules`` + directories. - ``binders`` - directory containing event binding files for the mojit. - ``controller.server.js`` - the mojit controller that runs on the server. You can also create the file ``controller.client.js`` to have a mojit controller @@ -117,11 +117,11 @@ is available. - ``{model_name}.{affinity}-tests.js`` - the unit tests for the mojit models. - ``{module_name}.{affinity}-tests.js`` - the unit tests for YUI modules, - which are located in ``mojits/{mojit_name}/autoload`` directory. + which are located in ``mojits/{mojit_name}/yui_modules`` directory. - Example of module and corresponding test: - - ``{app_name}/mojits/{mojit_name}/autoload/{module_name}.{affinity}.js`` + - ``{app_name}/mojits/{mojit_name}/yui_modules/{module_name}.{affinity}.js`` -- ``{app_name}/mojits/{mojit_name}/tests/autoload/{module_name}.{affinity}-tests.js`` +- ``{app_name}/mojits/{mojit_name}/tests/yui_modules/{module_name}.{affinity}-tests.js`` - ``views`` - directory containing the templates. @@ -147,13 +147,13 @@ rendering engine. |-- application.json |-- assets/ | `-- favicon.icon - |-- autoload/ + |-- yui_modules/ | `-- *.{affinity}.js |-- index.js |-- mojits/ | `-- [mojit_name] | |-- assets/ - | |-- autoload/ + | |-- yui_modules/ | | `-- *.{affinity}.js | |-- binders/ | | `-- {view_name}.js @@ -165,7 +165,7 @@ rendering engine. | |-- models/ | | `-- {model_name}.{affinity}.js | |-- tests/ - | | |-- autoload/ + | | |-- yui_modules/ | | | `-- {module_name}.{affinity}-tests.js | | |-- controller.{affinity}-tests.js | | `-- models/ diff --git a/docs/dev_guide/intro/mojito_configuring.rst b/docs/dev_guide/intro/mojito_configuring.rst index dd7e93b16..029c89233 100644 --- a/docs/dev_guide/intro/mojito_configuring.rst +++ b/docs/dev_guide/intro/mojito_configuring.rst @@ -105,11 +105,11 @@ 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/`` 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. | +| ``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. | diff --git a/docs/dev_guide/reference/glossary.rst b/docs/dev_guide/reference/glossary.rst index bd1ab4167..17ef4f631 100644 --- a/docs/dev_guide/reference/glossary.rst +++ b/docs/dev_guide/reference/glossary.rst @@ -51,13 +51,6 @@ assets application. See `Mojito Developer Topics: Assets <../topics/mojito_assets.html>`_ to learn how to use assets in Mojito applications. -autoload --------- - - A directory of a Mojito application containing JavaScript files that use YUI modules - added with ``YUI.add``. These files aren't actually *auto-loaded*, but are merely - automatically included if required by a YUI module. - binder ------ diff --git a/docs/dev_guide/reference/mojito_troubleshooting.rst b/docs/dev_guide/reference/mojito_troubleshooting.rst index fbcb0e5eb..7e1eca591 100644 --- a/docs/dev_guide/reference/mojito_troubleshooting.rst +++ b/docs/dev_guide/reference/mojito_troubleshooting.rst @@ -18,8 +18,8 @@ Issues called? ` * :ref:`I am getting Handlebars rendering errors. Is this a client-side or server-side issue with Handlebars and can it be fixed? ` -* :ref:`Why can't my controller access the YUI modules in the "autoload" directory? - ` +* :ref:`Why can't my controller access the YUI modules in the "yui_modules" directory? + ` * :ref:`Why am I getting the error message "EADDRINUSE, Address already in use" when I try to start Mojito? ` * :ref:`When I execute child mojits with "composite.execute", the views are being rendered, @@ -148,9 +148,9 @@ prototype so that your templates can be rendered. Try doing the following: ------------ -.. _controller_access_autoload: +.. _controller_access_yui_modules: -**Q:** *Why can't my controller access the YUI modules in the "autoload" directory?* +**Q:** *Why can't my controller access the YUI modules in the "yui_modules" directory?* **A:** A common problem is that the YUI module is missing the diff --git a/docs/dev_guide/topics/mojito_assets.rst b/docs/dev_guide/topics/mojito_assets.rst index 9c3523286..43875d94b 100644 --- a/docs/dev_guide/topics/mojito_assets.rst +++ b/docs/dev_guide/topics/mojito_assets.rst @@ -248,14 +248,14 @@ the ```` tag and the ``addCss`` method adds the device-specific CSS. YUI Assets ========== -YUI modules should be placed in the ``autoload`` directory and **not** +YUI modules should be placed in the ``yui_modules`` directory and **not** the ``assets`` directory. When your mojit code wants to use one of the YUI -modules in the ``autoload`` directory, you add the module name in the +modules in the ``yui_modules`` directory, you add the module name in the ``requires`` array, and Mojito will automatically load the module. For example, to use a YUI module called ``substitute`` in your mojit controller, you would place the ``substitute.js`` file in the -``autoload`` directory and then add the module name in the ``requires`` +``yui_modules`` directory and then add the module name in the ``requires`` array as seen in the example mojit controller below. .. code-block:: javascript @@ -296,7 +296,7 @@ be a child of the `HTMLFrameMojit <../topics/mojito_frame_mojits.html#htmlframem When you run ``mojito compile inlinecss``, the CSS files in ``/mojits/{mojit_name}/assets/`` are compiled into the YUI module -``/mojits/{mojit_name}/autoload/compiled/inlinecss.common.js``. +``/mojits/{mojit_name}/yui_modules/compiled/inlinecss.common.js``. Mojito will use the compiled CSS and insert inline CSS into the ```` element of the rendered view. See also `Compiling Inline CSS <../reference/mojito_cmdline.html#compiling-inline-css>`_. diff --git a/docs/dev_guide/topics/mojito_extensions.rst b/docs/dev_guide/topics/mojito_extensions.rst index 8c32b6b7b..ad3b44bee 100644 --- a/docs/dev_guide/topics/mojito_extensions.rst +++ b/docs/dev_guide/topics/mojito_extensions.rst @@ -318,11 +318,11 @@ Location of YUI Modules Application-level YUI modules should be placed in the following directory: -``{app_dir}/autoload/`` +``{app_dir}/yui_modules/`` Mojit-level YUI modules should be placed in the following directory: -``{mojit_dir}/autoload/`` +``{mojit_dir}/yui_modules/`` .. _libraries_yui-using: @@ -343,7 +343,7 @@ for the ``UID`` namespace. This will let you create an instance, and the ``prototype`` object then allows you to access the method ``log`` from that instance. -``{mojit_dir}/autoload/hello-uid.server.js`` +``{mojit_dir}/yui_modules/hello-uid.server.js`` .. code-block:: javascript diff --git a/docs/dev_guide/topics/mojito_resource_store.rst b/docs/dev_guide/topics/mojito_resource_store.rst index 43cd424e5..e73f25ac6 100644 --- a/docs/dev_guide/topics/mojito_resource_store.rst +++ b/docs/dev_guide/topics/mojito_resource_store.rst @@ -1048,7 +1048,7 @@ The |RS| comes with the following four built-in addons: - calculates the asset URL base for each mojit - ``yui`` - registers new resource type ``yui-module`` found in the directories - ``autoload`` or ``yui_modules`` + ``yui_modules`` or ``autoload`` - registers new resource type ``yui-lang`` found in the ``lang`` directory - calculates the ``yui`` metadata for resource versions that are YUI modules - pre-calculates corresponding YUI module dependencies when resources are diff --git a/docs/dev_guide/topics/mojito_testing.rst b/docs/dev_guide/topics/mojito_testing.rst index d884e416f..af28e1800 100644 --- a/docs/dev_guide/topics/mojito_testing.rst +++ b/docs/dev_guide/topics/mojito_testing.rst @@ -18,9 +18,9 @@ Conventions - ``{app_name}/tests`` - application tests - ``{app_name}/mojits/{mojit_name}/tests`` - mojit tests - - ``{app_name}/autoload/{yui_module}/tests`` - tests for + - ``{app_name}/yui_modules/{yui_module}/tests`` - tests for application-level YUI modules - - ``{app_name}/mojits/{mojit_name}/autoload/{yui_module}/tests`` - tests for + - ``{app_name}/mojits/{mojit_name}/yui_modules/{yui_module}/tests`` - tests for mojit-level YUI modules - Syntax for the name of the test file: ``{yui_module}.{affinity}-tests.js`` From e87716dc0d9dc9c1483ef607a008bdff089088d9 Mon Sep 17 00:00:00 2001 From: Joe Catera Date: Mon, 3 Dec 2012 17:33:14 -0800 Subject: [PATCH 2/2] Changed directory name from 'autoload' to 'yui_modules' for the YUI modules example. --- examples/developer-guide/yui_module/README.txt | 6 +++--- .../yui_module/mojits/Notepad/binders/index.js | 2 +- examples/developer-guide/yui_module/package.json | 2 +- .../{autoload => yui_modules}/storage-lite.client.js | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename examples/developer-guide/yui_module/{autoload => yui_modules}/storage-lite.client.js (100%) diff --git a/examples/developer-guide/yui_module/README.txt b/examples/developer-guide/yui_module/README.txt index 97c4d3628..4674d0db6 100644 --- a/examples/developer-guide/yui_module/README.txt +++ b/examples/developer-guide/yui_module/README.txt @@ -6,10 +6,10 @@ Create project and mojit mojito create app simple yui_module mojito create mojit simple Notepad -Put a YUI Gallery Module in ./yui_module/autoload AND rename it to include an affinity: +Put a YUI Gallery Module in ./yui_modules/ AND rename it to include an affinity: - mkdir ./yui_module/autoload - wget -O ./yui_module/autoload/storage-lite.client.js \ + mkdir ./yui_modules/ + wget -O ./yui_modules/storage-lite.client.js \ https://raw.github.com/rgrove/storage-lite/master/src/storage-lite.js Edit application.json "specs": diff --git a/examples/developer-guide/yui_module/mojits/Notepad/binders/index.js b/examples/developer-guide/yui_module/mojits/Notepad/binders/index.js index 3da14ed45..da7d72ad5 100644 --- a/examples/developer-guide/yui_module/mojits/Notepad/binders/index.js +++ b/examples/developer-guide/yui_module/mojits/Notepad/binders/index.js @@ -38,5 +38,5 @@ YUI.add('NotepadBinderIndex', function (Y, NAME) { }; }, '0.0.1', {requires: [ - 'gallery-storage-lite' //see autoload/storage-lite.client.js + 'gallery-storage-lite' //see yui_modules/storage-lite.client.js ]}); diff --git a/examples/developer-guide/yui_module/package.json b/examples/developer-guide/yui_module/package.json index 7954b6598..23fa3416a 100644 --- a/examples/developer-guide/yui_module/package.json +++ b/examples/developer-guide/yui_module/package.json @@ -1,6 +1,6 @@ { "name": "yui_module", - "description": "example mojit showing how to load YUI modules that are in the autoload directory.", + "description": "example mojit showing how to load YUI modules that are in the yui_modules directory.", "version": "0.0.1", "author": { "name": "Isao Yagi", diff --git a/examples/developer-guide/yui_module/autoload/storage-lite.client.js b/examples/developer-guide/yui_module/yui_modules/storage-lite.client.js similarity index 100% rename from examples/developer-guide/yui_module/autoload/storage-lite.client.js rename to examples/developer-guide/yui_module/yui_modules/storage-lite.client.js