* @param {string[]} batch
*/
function batchRequest( batch ) {
- var reqBase, splits, maxQueryLength, b, bSource, bGroup,
+ var reqBase, splits, b, bSource, bGroup,
source, group, i, modules, sourceLoadScript,
currReqBase, currReqBaseLength, moduleMap, currReqModules, l,
lastDotIndex, prefix, suffix, bytesAdded;
lang: mw.config.get( 'wgUserLanguage' ),
debug: mw.config.get( 'debug' )
};
- maxQueryLength = mw.config.get( 'wgResourceLoaderMaxQueryLength', 2000 );
// Split module list by source and by group.
splits = Object.create( null );
modules[ i ].length + 3; // '%7C'.length == 3
// If the url would become too long, create a new one, but don't create empty requests
- if ( maxQueryLength > 0 && currReqModules.length && l + bytesAdded > maxQueryLength ) {
+ if ( currReqModules.length && l + bytesAdded > mw.loader.maxQueryLength ) {
// Dispatch what we've got...
doRequest();
// .. and start again.
moduleMap = Object.create( null );
currReqModules = [];
- mw.track( 'resourceloader.splitRequest', { maxQueryLength: maxQueryLength } );
+ mw.track( 'resourceloader.splitRequest', { maxQueryLength: mw.loader.maxQueryLength } );
}
if ( !moduleMap[ prefix ] ) {
moduleMap[ prefix ] = [];
*/
moduleRegistry: registry,
+ /**
+ * Exposed for testing and debugging only.
+ *
+ * @see #batchRequest
+ * @property
+ * @private
+ */
+ maxQueryLength: $VARS.maxQueryLength,
+
/**
* @inheritdoc #newStyleTag
* @method