Motivation
The loading time of the advanced search form got better:
- T189028 reduced the perceived loading time by removing late content reflows.
- T200083 (https://gerrit.wikimedia.org/r/433991) reduced the actual loading time by delaying the creation of the "advanced parameters" panel.
But there is still room for improvement. On the live site the original search field shows up very fast, but it takes 2 or more seconds before the rest of the advanced search form shows up, even with our fast office network.
This ticket is about actually lazy-loading the code that is exclusively needed by the "advanced parameters" panel.
Acceptance Criteria
- Split the MediaWiki-ResourceLoader modules in a way that lazy loading the code is possible. Draft patch: https://gerrit.wikimedia.org/r/434028.
- Lazy-load as much code as possible via mw.requestIdleCallback( function () { mw.loader.using( …. Draft patch: https://gerrit.wikimedia.org/r/434002.
- Only if the required modules are loaded, initialize the panel.
Notes:
- Define a browser and connection speed for measurements
- Measure the size and amount of time for the resources to be loaded
- Consider giving visual feedback regarding loading status
