This change reduces the size of the JavaScript resources.
Change-Id: I850249f910f6275c1b963dc5421ba706ed6e9a56
+ /**
+ * Get the localStorage key for the entire module store. The key references
+ * $wgDBname to prevent clashes between wikis under the same web domain.
+ *
+ * @return string localStorage item key for JavaScript
+ */
+ private function getStoreKey() {
+ return 'MediaWikiModuleStore:' . $this->getConfig()->get( 'DBname' );
+ }
+
/**
* Get the key on which the JavaScript module cache (mw.loader.store) will vary.
*
/**
* Get the key on which the JavaScript module cache (mw.loader.store) will vary.
*
'$VARS.maxQueryLength' => ResourceLoader::encodeJsonForScript(
$conf->get( 'ResourceLoaderMaxQueryLength' )
),
'$VARS.maxQueryLength' => ResourceLoader::encodeJsonForScript(
$conf->get( 'ResourceLoaderMaxQueryLength' )
),
+ '$VARS.storeKey' => ResourceLoader::encodeJsonForScript( $this->getStoreKey() ),
'$VARS.storeVary' => ResourceLoader::encodeJsonForScript( $this->getStoreVary( $context ) ),
];
$profilerStubs = [
'$VARS.storeVary' => ResourceLoader::encodeJsonForScript( $this->getStoreVary( $context ) ),
];
$profilerStubs = [
* @return {string} localStorage item key
*/
getStoreKey: function () {
* @return {string} localStorage item key
*/
getStoreKey: function () {
- return 'MediaWikiModuleStore:' + mw.config.get( 'wgDBname' );