After the addition of requestIdleCallback and the separation between ext.popups and ext.popups.main, our code is delayed and is loaded after basically everything else (collapsible tabs, universal language selector on the sidebar, the video player piece, etc).
One could argue that Popups are likely to be interacted with in the content earlier than many of those other features and that they shouldn't block the execution of the feature.
Tested in en.wikipedia.org while logged in, the small piece in the timeline is when popups finally runs after seconds of other scripts doing things:
Tested in es.wikipedia.org logged out. Same thing, the small piece in the timeline at the end is when it runs:
It seems like rIC is hurting the feature if it is the only piece of JS that is delayed and scheduled to load like that.
- Should popups the same scheduling mechanism that other scripts/features use instead of rIC (setTimeout or requestAnimationFrame could schedule it earlier)? (if they use any)
- Should all other scripts on the page are also scheduled with requestIdleCallback to be loaded more fairly?
- Should we examine the different scripts loaded and:
- Either find a way to specify priorities and properly schedule script loading based on the priority
- Standardize non-critical features with rIC loading like we were recommended to do with popups