Page MenuHomePhabricator

Drastically reduce the number of ResourceLoader modules that WikibaseClient registers
Open, NormalPublic

Description

Motivation
As of 7 May 2018 in production, Wikibase's 248 RL modules result in 14,453 bytes (5,210 bytes after gzip) being shipped on every page view of every Wikipedia for every reader. That's 6.4TiB a day of extra load on readers.

Problem
The linkitem module in wikibase client actually uses lots of parts of WikibaseView which is designed for Repo so it makes us to load WikibaseView and all of its ~240 modules in all client wikis.

Suggested Solution / Technical Details
All of linkitem dependencies and some of wikibaseLib dependencies need to be cleaned by rewriting linkitem in ooui (see the subtask), then move the remaining ones (like wb.api.RepApi) from view to lib.


Original bug report:

As of 7 May 2018 in production, Wikibase's 248 RL modules result in 14,453 bytes (5,210 bytes after gzip) being shipped on every page view of every Wikipedia for every reader. That's 6.4TiB a day of extra load on readers. There's even more if you count the jQuery UI stuff uses, but I'll leave that for now.

It looks like Wikibase is trying to use ResourceLoader as a class loader(!) which may be difficult to quickly re-architect, but any reduction would be worthwhile.

Progress

WikibaseClient:

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 486796 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate various view/resources modules

https://gerrit.wikimedia.org/r/486796

Change 488203 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules

https://gerrit.wikimedia.org/r/488203

Krinkle renamed this task from Drastically reduce the number of ResourceLoader modules that Wikibase creates to Drastically reduce the number of ResourceLoader modules that WikibaseClient registers.Feb 6 2019, 2:43 AM
Krinkle removed a project: Performance.
Krinkle updated the task description. (Show Details)
Krinkle updated the task description. (Show Details)

Change 488203 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules

https://gerrit.wikimedia.org/r/488203

Change 488505 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate view/resources modules (3)

https://gerrit.wikimedia.org/r/488505

Krinkle updated the task description. (Show Details)Feb 6 2019, 6:22 PM

Change 488505 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (3)

https://gerrit.wikimedia.org/r/488505

Change 489364 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (4)

https://gerrit.wikimedia.org/r/489364

Krinkle updated the task description. (Show Details)Feb 9 2019, 2:19 AM

Change 489364 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (4)

https://gerrit.wikimedia.org/r/489364

Krinkle updated the task description. (Show Details)Feb 11 2019, 6:51 PM

Change 489774 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (5)

https://gerrit.wikimedia.org/r/489774

Change 489774 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (5)

https://gerrit.wikimedia.org/r/489774

Krinkle updated the task description. (Show Details)Feb 15 2019, 9:49 PM

Change 491253 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (6)

https://gerrit.wikimedia.org/r/491253

Krinkle updated the task description. (Show Details)Feb 18 2019, 1:54 PM

Change 491253 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (6)

https://gerrit.wikimedia.org/r/491253

Change 492520 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (7)

https://gerrit.wikimedia.org/r/492520

Change 492520 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (7)

https://gerrit.wikimedia.org/r/492520

Krinkle updated the task description. (Show Details)Feb 27 2019, 2:10 PM

Change 493238 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (8)

https://gerrit.wikimedia.org/r/493238

Change 493238 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (8)

https://gerrit.wikimedia.org/r/493238

Change 494793 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (9)

https://gerrit.wikimedia.org/r/494793

Krinkle updated the task description. (Show Details)Mar 6 2019, 5:44 PM

Change 494793 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (9)

https://gerrit.wikimedia.org/r/494793

Change 495414 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (10)

https://gerrit.wikimedia.org/r/495414

Krinkle triaged this task as Normal priority.Mar 9 2019, 12:17 AM

Change 495414 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (10)

https://gerrit.wikimedia.org/r/495414

Krinkle updated the task description. (Show Details)Mar 12 2019, 4:12 AM

Change 498959 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (11)

https://gerrit.wikimedia.org/r/498959

Krinkle updated the task description. (Show Details)Mar 25 2019, 6:13 PM

Change 498959 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (11)

https://gerrit.wikimedia.org/r/498959

Change 501980 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (12)

https://gerrit.wikimedia.org/r/501980

Change 501981 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Merge wikibase.termbox.messages into wikibase.termbox (13)

https://gerrit.wikimedia.org/r/501981

Change 501981 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Merge wikibase.termbox.messages into wikibase.termbox (13)

https://gerrit.wikimedia.org/r/501981

Change 502635 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@wmf/1.33.0-wmf.25] Merge wikibase.termbox.messages into wikibase.termbox (13)

https://gerrit.wikimedia.org/r/502635

Change 502635 abandoned by Krinkle:
Merge wikibase.termbox.messages into wikibase.termbox (13)

https://gerrit.wikimedia.org/r/502635

Krinkle updated the task description. (Show Details)Apr 15 2019, 6:06 PM
Krinkle updated the task description. (Show Details)
Krinkle updated the task description. (Show Details)
Krinkle updated the task description. (Show Details)

Change 501980 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (12)

https://gerrit.wikimedia.org/r/501980

Krinkle updated the task description. (Show Details)Apr 17 2019, 6:28 PM

Change 508411 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (13)

https://gerrit.wikimedia.org/r/508411

Change 508411 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/resources modules (13)

https://gerrit.wikimedia.org/r/508411

Change 509166 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/ modules resources (14)

https://gerrit.wikimedia.org/r/509166

Krinkle updated the task description. (Show Details)May 9 2019, 11:23 PM

Change 509166 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/ modules resources (14)

https://gerrit.wikimedia.org/r/509166

Change 512407 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/ modules resources (15)

https://gerrit.wikimedia.org/r/512407

Change 512407 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/ modules resources (15)

https://gerrit.wikimedia.org/r/512407

Krinkle updated the task description. (Show Details)May 29 2019, 7:12 PM

Change 516240 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/ modules resources (16)

https://gerrit.wikimedia.org/r/516240

Change 516240 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/ modules resources (16)

https://gerrit.wikimedia.org/r/516240

Krinkle updated the task description. (Show Details)Jun 17 2019, 6:11 PM

Change 518753 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/ modules resources (17)

https://gerrit.wikimedia.org/r/518753

Change 518753 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/ modules resources (17)

https://gerrit.wikimedia.org/r/518753

Krinkle updated the task description. (Show Details)Thu, Jul 4, 8:22 PM

Change 520926 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Consolidate more view/ modules resources (18)

https://gerrit.wikimedia.org/r/520926

Change 520926 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Consolidate more view/ modules resources (18)

https://gerrit.wikimedia.org/r/520926

Change 522607 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Reduce number of client RL modules

https://gerrit.wikimedia.org/r/522607

Change 522612 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Reduce number of client RL modules

https://gerrit.wikimedia.org/r/522612

Change 522613 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Use Package files to inject config

https://gerrit.wikimedia.org/r/522613

Change 522607 abandoned by Ladsgroup:
Reduce number of client RL modules

Reason:
Split it to Iec0fe4be7a2781d9b91c72dc3f51528fee2817ce and If711f9251a054efe4c0ffb3718b41419a7c0e3f0. One of them can be complex (deprecating the config variable.)

https://gerrit.wikimedia.org/r/522607

Change 522612 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Reduce number of client RL modules

https://gerrit.wikimedia.org/r/522612

Change 523002 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[mediawiki/extensions/Wikibase@master] Stop loading WikibaseView in client

https://gerrit.wikimedia.org/r/523002

Actually the underlying problem here is that we load WikibaseView, the frontend designed to show entities on Wikidata on clients, this should not happen. Client and lib depend only on eight modules of view, I move them to lib and we will be done with this.

Change 523011 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/Wikibase@master] Move view/lib/wikibase-api to lib/resouces/wikibase-api

https://gerrit.wikimedia.org/r/523011

  • wikibase.api.RepoApiError' (wikibase-api)
  • 'jquery.ui.ooMenu' (DatavaluesValueview)
  • 'jquery.ui.suggester' (DatavaluesValueview)
  • 'jquery.event.special.eachchange' (DatavaluesValueview)
  • 'wikibase.api.RepoApi', (wikibase-api)
  • 'wikibase.api.getLocationAgnosticMwApi' (wikibase-api)
  • 'util.inherit', (DatavaluesLib)
  • util.highlightSubstring (DatavaluesValueview)

Except the wikibase-api, the rest actually are not needed and can be replaced by some other functionality or by T226976: Convert linkitem module to use OOUI, instead of jQuery UI

Ladsgroup updated the task description. (Show Details)Tue, Jul 16, 10:54 AM
Ladsgroup moved this task from Incoming to Ready to estimate on the Wikidata-Campsite board.

Change 523011 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Move view/lib/wikibase-api to lib/resouces/wikibase-api

https://gerrit.wikimedia.org/r/523011