Last modified: 2014-06-17 17:02:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T25985, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23985 - mediawiki.legacy.mwsuggest shouldn't be loaded if ext.vector.simpleSearch is loaded
mediawiki.legacy.mwsuggest shouldn't be loaded if ext.vector.simpleSearch is ...
Status: RESOLVED WORKSFORME
Product: MediaWiki skins
Classification: Unclassified
Vector (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 27411
  Show dependency treegraph
 
Reported: 2010-06-16 00:43 UTC by Derk-Jan Hartman
Modified: 2014-06-17 17:02 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Derk-Jan Hartman 2010-06-16 00:43:25 UTC
both mwsuggest.js and simplesearch code is now pushed to all users, the first regardless of wether or not someone uses it.

This is difficult to work around I suppose, but ideally, users should receive either one or the other, but never both and never neither....

This will reduce initial page download time and page parse time.
Comment 1 Mark A. Hershberger 2011-02-14 21:39:06 UTC
I'm guessing ResourceLoader has fixed this.
Comment 2 Roan Kattouw 2011-02-14 22:41:19 UTC
(In reply to comment #1)
> I'm guessing ResourceLoader has fixed this.
It hasn't, actually. It won't really be convenient to do this until Extension:Vector is moved into core.
Comment 3 Krinkle 2011-06-06 09:41:04 UTC
Removing as a ResourceLoader 1.0 blocker.

Possible solution:

- Introduce a new method in OutputPage, something like "unloadModules" (which is like "addModules", but the opposite (removes from this->mModules)).
- in the Vector extension, if SimpleSearch is enabled, unload 'mediawiki.legacy.mwsuggest'
Comment 4 Brion Vibber 2011-06-07 22:55:39 UTC
What we may want here is a system for aliases or virtual modules.

It's fairly common in Linux app packaging systems for instance to have a notion that multiple packages can provide some particular service. sendmail, postfix, exim etc will all claim to offer 'mail-transport-agent' for instance, so any other package that needs _some_ mail agent but doesn't care which can simply declare its dependency on that, and whichever is available (or chosen/prioritized) gets actually used.

If we consider SimpleSearch's module and mwsuggest to both provide, say, 'mediawiki.search-suggest', but SimpleSearch's takes priority, then poof! We only need to ask for one, and we get the awesomest one.

One simple way to implement this might be to just create a dependency-only module and override it:

$wgResourceModules['mediawiki.search-suggest'] = array(
  'dependencies' => array( 'mediawiki.legacy.mwsuggest' ),
);

... then when setting up the extension ...

$wgResourceModules['mediawiki.search-suggest'] = array(
  'dependencies' => array( 'ext.vector.simplesearch' ),
);
Comment 5 Bugmeister Bot 2011-08-19 19:12:52 UTC
Unassigning default assignments. http://article.gmane.org/gmane.science.linguistics.wikipedia.technical/54734
Comment 6 Krinkle 2011-08-31 18:38:58 UTC
The following are the steps to load ext.vector.simpleSearch:
* Install Vector extension
* Enable vector-simplesearch (either as default user option, or by setting 'global' to true in $wgVectorFeatures['simplesearch'])
* The requirements in VectorHooks::features for 'simplesearch' must match the current scenario:
  'requirements' => array( 'vector-simplesearch' => true, 'disablesuggest' => false ),

... mediawiki.page.mwsuggest:
* $wgEnableMWSuggest = true;
* use option 'disablesuggest' undefined or false
Comment 7 Krinkle 2011-08-31 18:39:29 UTC
Another possible solution, that doesn't involve creating a new infrastructure for aliases in resourcemodules:

Perhaps add a hook in OutputPage->addDefaultModules

# Current code
		// Add various resources if required
		if ( $wgUseAjax ) {
			...

			if ( $wgEnableMWSuggest && !$this->getUser()->getOption( 'disablesuggest', false ) ) {
				$this->addModules( 'mediawiki.legacy.mwsuggest' );
			}
		}

# Proposed code
		// Add various resources if required
		if ( $wgUseAjax ) {
			...

			if ( !$this->getUser()->getOption( 'disablesuggest', false ) ) {
				$searchSuggestModulesNames = array();
				if ( $wgEnableMWSuggest ) {
					$searchSuggestModulesNames[] = 'mediawiki.legacy.mwsuggest';
				}
				wfRunHooks( 'getSearchSuggestModuleNames', array( &searchSuggestModulesNames, &$this ) );
				$this->addModules( $searchSuggestModulesNames );
		}
Comment 8 Krinkle 2012-10-31 22:19:27 UTC
mediawiki.legacy.mwsuggest and ext.vector.simpleSearch exist no more. There is now a modern skin-agnostic implementation in MediaWiki core.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links