@@ -85,7 +85,11 @@ public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
8585 if ( $ settings ->getSetting ( 'enableEntitySearchUI ' ) === true ) {
8686 $ skinName = $ skin ->getSkinName ();
8787 if ( $ skinName === 'vector-2022 ' ) {
88- $ out ->addModules ( 'wikibase.vector.searchClient ' );
88+ if ( $ settings ->getSetting ( 'tmpEnableScopedTypeaheadSearch ' ) ) {
89+ $ out ->addModules ( 'wikibase.vector.scopedTypeaheadSearch ' );
90+ } else {
91+ $ out ->addModules ( 'wikibase.vector.searchClient ' );
92+ }
8993 } elseif ( $ skinName !== 'minerva ' ) {
9094 // Minerva uses its own search widget.
9195 $ out ->addModules ( 'wikibase.ui.entitysearch ' );
@@ -983,6 +987,18 @@ public static function onResourceLoaderRegisterModules( ResourceLoader $resource
983987 $ modules ['wikibase.special.languageLabelDescriptionAliases ' ]['dependencies ' ][] = 'ext.uls.mediawiki ' ;
984988 }
985989
990+ // temporarily register this RL module only if the feature flag is enabled,
991+ // so that wikis without the feature flag don’t even pay the small cost of loading the module *definition*
992+ // (when the feature stabilizes, this should move into repo/resources/Resources.php: T385446)
993+ $ settings = WikibaseRepo::getSettings ();
994+ if ( $ settings ->getSetting ( 'tmpEnableScopedTypeaheadSearch ' ) ) {
995+ $ modules ['wikibase.vector.scopedTypeaheadSearch ' ] = $ moduleTemplate + [
996+ 'packageFiles ' => [
997+ 'resources/wikibase.vector.scopedTypeaheadSearch.js ' ,
998+ ],
999+ ];
1000+ }
1001+
9861002 $ resourceLoader ->register ( $ modules );
9871003 }
9881004
0 commit comments