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
"linkitem module in WikibaseClient, depends on these modules in WikibaseView:
- 'jquery.ui.ooMenu' (DatavaluesValueview)
- 'jquery.ui.suggester' (DatavaluesValueview)
- 'jquery.event.special.eachchange' (DatavaluesValueview)
- 'util.inherit', (DatavaluesLib)
- util.highlightSubstring (DatavaluesValueview)
' jquery.wikibase.siteselector' in lib depends on these modules in View:
- jquery.event.special.eachchange
- jquery.ui.ooMenu
- jquery.ui.suggester
- util.highlightSubstring
Possible solutions:
- Rewrite linkitem so it doesn't use any of those modules in view, move jquery.wikibase.siteselector to view or
- Take out lib subdirectoy of DatavaluesValueview and move that from view to lib. Move 'util.inheirt' from WikibaseDataValueLib to DatavaluesValueViewLib (the moved part)
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:
- client/resources:
- ..
- lib/resources:
- ..
- view/resources, and view/lib/resources:
- Removed 20 modules. – [1.33-wmf.17] https://gerrit.wikimedia.org/r/486796, https://gerrit.wikimedia.org/r/488203, https://gerrit.wikimedia.org/r/488505, https://gerrit.wikimedia.org/r/489364
- Removed 3 modules. – [1.33-wmf.18] https://gerrit.wikimedia.org/r/489774
- Removed 2 modules. – [1.33-wmf.19] https://gerrit.wikimedia.org/r/491253
- Removed 3 modules. – [1.33-wmf.20] https://gerrit.wikimedia.org/r/492520
- Removed 16 modules. – [1.33-wmf.21] https://gerrit.wikimedia.org/r/493238, https://gerrit.wikimedia.org/r/494793, https://gerrit.wikimedia.org/r/495414
- Removed 6 modules. - [1.33-wmf.23] https://gerrit.wikimedia.org/r/498959
- Removed 3 module. [1.34-wmf.1] https://gerrit.wikimedia.org/r/501981, https://gerrit.wikimedia.org/r/501980
- Removed 1 module. [1.34-wmf.4] https://gerrit.wikimedia.org/r/508411
- Removed 2 modules. [1.34-wmf.5] https://gerrit.wikimedia.org/r/509166
- Removed 2 modules. [1.34-wmf.7] https://gerrit.wikimedia.org/r/512407
- Removed 2 modules. [1.34-wmf.10] https://gerrit.wikimedia.org/r/516240
- Removed 1 module . [1.34-wmf.13] https://gerrit.wikimedia.org/r/518753
- Removed 137 modules [1.34-wmf.16] https://gerrit.wikimedia.org/r/525107