From cff05adfaa2b8693aa1d8bb6feade5becba3be6a Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 5 Jan 2015 09:42:24 -0800 Subject: [PATCH] [Framework] Update documentation Update documentation to include the library-exposing feature introduced by WTD-568 --- platform/framework/README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/platform/framework/README.md b/platform/framework/README.md index 3a1109d254..0089ede522 100644 --- a/platform/framework/README.md +++ b/platform/framework/README.md @@ -1,5 +1,5 @@ -Framework-level components for Open MCT Web. This is Angular and Require, -with an extra layer to mediate between them and act as an extension +Framework-level components for Open MCT Web. This is Angular and Require, +with an extra layer to mediate between them and act as an extension mechanism to allow plug-ins to be introduced declaratively. # Usage @@ -68,6 +68,21 @@ definition. The implementation name should not include the bundle path, or the name of the source folder; these will be pre-pended by the framework during this stage. The implementation name should include a `.js` extension. +Bundles may utilize third-party libraries, and may wish to expose these such +that other bundles may use them. Require JS may need special configuration +to recognize and utilize third-party libraries, and when exposing a +third-party library it may be desirable to do so under a short name +(to avoid long relative paths.) Such configuration is performed during the +resolution stage, immediately before implementations are loaded. Any +`configuration` properties from a bundle's definition (`bundle.json`) will +be used to perform this configuration; these `configuration` should take +the same form as needed to populate a +[`require.config`](http://requirejs.org/docs/api.html#config) call. +At present, only `shim` and `paths` options are supported; any `paths` will +be prepended with the bundle's library path (the bundle's `lib` folder, by +default; this directory name can be overridden by specifying a `libraries` +property in `bundles.json`.) + An extension is resolved by loading its implementing script, if one has been declared. If none is declared, the extension's raw definition is used instead. To ensure that extensions look similar regardless of whether or