mw.loader: Document mw.loader.require() as private
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 20 Feb 2018 04:47:39 +0000 (20:47 -0800)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 20 Feb 2018 04:47:39 +0000 (20:47 -0800)
Only public for debugging purposes.

Change-Id: Icc44e11ec6874d7f74ed527e87a80dd06b4edb3a

resources/src/mediawiki/mediawiki.js

index e9efc16..a2e071e 100644 (file)
                                 *         OO.compare( [ 1 ], [ 1 ] );
                                 *     } );
                                 *
+                                * Example of inline dependency obtained via `require()`:
+                                *
+                                *     mw.loader.using( [ 'mediawiki.util' ], function ( require ) {
+                                *         var util = require( 'mediawiki.util' );
+                                *     } );
+                                *
                                 * Since MediaWiki 1.23 this also returns a promise.
                                 *
                                 * Since MediaWiki 1.28 the promise is resolved with a `require` function.
                                /**
                                 * Get the exported value of a module.
                                 *
-                                * Modules may provide this via their local `module.exports`.
+                                * This static method is publicly exposed for debugging purposes
+                                * only and must not be used in production code. In production code,
+                                * please use the dynamically provided `require()` function instead.
                                 *
-                                * @protected
+                                * In case of lazy-loaded modules via mw.loader#using(), the returned
+                                * Promise provides the function, see #using() for examples.
+                                *
+                                * @private
                                 * @since 1.27
                                 * @param {string} moduleName Module name
                                 * @return {Mixed} Exported value