API Docs for: 0.8.3
Show:

RSAddonYUI Class

Methods

_captureYUIModuleDetails

(
  • res
  • runSandbox
)
Nothing private

If the resource is a YUI module, augments its metadata with metadata about the YUI module.

Parameters:

  • res Object

    resource metadata

  • runSandbox Object

    if passed, the function in the module will be called using this parameter as the YUI sandbox

Returns:

Nothing:

_makeYUIModuleConfig

(
  • env
  • res
)
Object private

Generates the YUI configuration for the resource.

Parameters:

  • env String

    runtime environment (either client, or server)

  • res Object

    the resource metadata

Returns:

Object: the YUI configuration for the module

_precalcLoaderMeta

(
  • langs
)
Nothing private

Precomputes YUI loader metadata, so that we don't have to at runtime.

Parameters:

  • langs Array

    array of languages for which to compute YUI loader metadata

Returns:

Nothing:

_precalcYUIResources

() Nothing private

Precomputes YUI modules resources, so that we don't have to at runtime.

Returns:

Nothing:

_precomputeYUIDependencies

(
  • lang
  • env
  • mojit
  • modules
  • required
  • forceYLoader
)
Object private

Precomputes a set of dependencies.

Parameters:

  • lang String

    YUI language code

  • env String

    runtime environment (either client, or server)

  • mojit String

    name of the mojit

  • modules Object

    YUI module metadata

  • required Object

    lookup hash of YUI module names that are required

  • forceYLoader Boolean

    whether to force the use of Y.Loader

Returns:

Object: precomputed (and sorted) module dependencies

_processMeta

(
  • resolvedMods
  • modules
  • expanded_modules
  • conditions
  • appModules
)
Nothing private

Parameters:

  • resolvedMods Object

    resolved module metadata, from Y.Loader.resolve()

  • modules Object

    regular YUI module metadata (ala loader-yui3)

  • expanded_modules Object

    YUI module metadata that include details such as fullpaths. This parameter is populated by this method.

  • conditions Object

    store of conditional functions. This parameter is populated by this method.

  • appModules Object

    a hash table with the modules that are part of the app, use to correct paths when needed.

Returns:

Nothing:

_produceMeta

(
  • name
  • lang
  • appMetaData
  • yuiMetaData
)
String private

Generates the final YUI metadata.

Parameters:

  • name String

    type of YUI metadata to return

  • lang String

    which language the metadata should be customized for

  • appMetaData Object

    gathered YUI metadata for the application

  • yuiMetaData Object

    gathered YUI metadata for YUI itself

Returns:

String: the requested YUI metadata

addResourceVersion

(
  • res
)
Nothing

Using AOP, this is called before the ResourceStore's version. We register some fake resource versions that represent the YUI configurations.

Parameters:

  • res Object

    resource version metadata

Returns:

Nothing:

addResourceVersion

(
  • res
)
Nothing

Using AOP, this is called before the ResourceStore's version. If the resource is a YUI module, augments the metadata with details about the YUI module.

Parameters:

  • res Object

    resource version metadata

Returns:

Nothing:

findResourceVersionByConvention

(
  • source
  • mojitType
)
Object | | Null

Using AOP, this is called after the ResourceStore's version.

Parameters:

  • source Object

    metadata about where the resource is located

  • mojitType String

    name of mojit to which the resource likely belongs

Returns:

Object | | Null: for yui modules or lang bundles, returns metadata signifying that

getAppGroupConfig

(
  • ctx
)
Object

Hook to allow other RS addons to control the combo handler configuration for group "app". By default, the yui.config.groups.app will allow customization of the combo handler when needed from application.json

Parameters:

  • ctx Object

    the context

Returns:

Object: yui configuration for group "app"

getAppSeedFiles

(
  • ctx
  • yuiConfig
)
Array

Produce the YUI seed files. This can be controlled through application.json->yui->config->seed in a form of a array with the list of full paths for all seed files.

Parameters:

  • ctx Object

    the context

  • yuiConfig Object

    the config that is sent to client

Returns:

Array: list of seed files

getConfigShared

(
  • env
)
Object

Returns a datastructure which tells a YUI instance where to find the YUI modules that are shared among all mojits.

Parameters:

  • env String

    runtime environment (either client, or server)

Returns:

Object: datastructure for configuring YUI

getModulesConfig

(
  • env
  • justApp
)
Object

Returns a datastructure which tells a YUI instance where to find the YUI modules in the app.

Parameters:

  • env String

    runtime environment (either client, or server)

  • justApp Boolean

    Indicates whether to include the YUI modules just found in the application (true), or also include those found in mojito (false).

Returns:

Object: datastructure for configuring YUI

getResourceContent

(
  • details
  • callback
)
Undefined

Return the content for resources we make in makeResourceVersions().

Parameters:

  • details Object

    static handling details

  • callback Function

    callback used to return the resource content (or error)

    • err Error | Undefined

      Error that occurred, if any. If an error is given that the other two arguments will be undefined.

    • content Buffer

      the contents of the resource

    • stat Stat | | Null

      Stat object with details about the file on the filesystem Can be null if the resource doesn't have a direct representation on the filesystem.

Returns:

Undefined: nothing is returned, the results are returned via the callback

getYUIConfig

(
  • ctx
)
Object

Hook to allow other RS addons to control the yui configuration. By default, the yui.config will allow customization of the combo handler when needed from application.json.

Parameters:

  • ctx Object

    the context

Returns:

Object: yui configuration

getYUIURLDetails

() Object private

Aggregate all yui core files using the path of as the hash.

Returns:

Object: yui core resources by url

initializer

(
  • config
)
Nothing

This methods is part of Y.Plugin.Base. See documentation for that for details.

Parameters:

  • config Object

    Configuration object as per Y.Plugin.Base

Returns:

Nothing:

parseResourceVersion

(
  • source
  • type
  • subtype
  • mojitType
)
Object | | Null

Using AOP, this is called before the ResourceStore's version.

Parameters:

  • source Object

    metadata about where the resource is located

  • type String

    type of the resource

  • subtype String

    subtype of the resource

  • mojitType String

    name of mojit to which the resource likely belongs

Returns:

Object | | Null: for yui modules or lang bundles, returns the resource metadata

resolveResourceVersions

() Nothing

Using AOP, this is called after the ResourceStore's version. We precompute the YUI configurations.

Returns:

Nothing: