API Docs for: 0.2.0
Show:

loader-patch Class

Provides hooks to patch the YUI loader on both the server and/or client. It will facilitate try new things and patches without requiring to wait for YUI to be released. Here is an example:

app.yui.patch(require('express-yui/lib/patches/optional-requires'));

In the example above, one of the default patches shipped with with express-yui, is executed on the server and client to patch the YUI Loader to support a new type of metadata called optionalRequires, which provides an easy way to define requirements for a module that are not avialable in all runtimes.

Item Index

Methods

patch

(
  • patch
)
public

Adds patches that will be applied to the YUI instance before the initial use statement on the server side and client. Here is an example of how to use this:

app.yui.patch(require('express-yui/lib/patches/optional-requires'));

Parameters:

  • patch Function

    Each argument represent a patch to be applied

patchClient

(
  • patch
)
public

Adds patches that will be applied to the YUI instance before the initial use statement on the client side.

app.yui.patchClient(require('express-yui/lib/patches/templates-requires'));

Parameters:

  • patch Function

    Each argument represent a patch to be applied to the client runtime

patchServer

(
  • patch
)
public

Adds patches that will be applied to the YUI instance before the initial use statement on the server side.

app.yui.patchServer(require('express-yui/lib/patches/server-intl-get'));

Parameters:

  • patch Function

    Each argument represent a patch to be applied to the server runtime