User:JDrewniak (WMF)/notes/Search widgets at Wikimedia

There are currently (As of October 2019) 4 different search typeahead implementations at the Wikimedia Foundation.


 * 1) searchSuggest
 * 2) OOUI TitleWidget & TitleOptionWidget
 * 3) MobileFrontend SearchOverlay
 * 4) www.wikipedia.org search widget

How do they differ?
All widgets contain the same basic functionality: Producing a list of search suggestions when typing a query into a search input. SearchSuggest is the most bare-bones, as it doesn’t include thumbnails in the suggestions. The major differences are within the underlying frameworks they use. All widgets except the portal use jQuery and mw.Api. The mobile widget depends on the Mustache templating library, and the OOUI widget depends on... OOUI.

The major factor when producing a widget is performance
These search widgets, on both mobile and desktop, are loaded on every page. In the past, replacing the old SearchSuggest widget has been discussed, but a major blocker was the ability to load OOUI on every page. Similarly, the mobile widget requires loading the Mustache templating library on every page. On mobile, Mustache is used for other widgets as well, such as the main menu, so it’s presence is justified.