**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:
* 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>
** ..