Krinkle created this task. Krinkle added projects: Wikibase-DataModel-_javascript_, Wikidata, MediaWiki-extensions-WikibaseClient, Performance-Team. Herald added a subscriber: Aklapper. |
TASK DESCRIPTION
Looking at flame graphs and overall code complexity, there's quite a bit of complexity in how Wikibase registers its _javascript_ modules.
F15215318: Screen Shot 2018-03-12 at 15.25.57.png
entrypoint=extensions/Wikibase/client/WikibaseClient.php
- lib/WikibaseLib.php
- $wgResourceModules = array_merge ...
- lib/resources/Resources.php
- return array( .. ); preg_match(,,$remoteExtPath)
- view/WikibaseView.php
- view/init.mw.php
- view/resources.php
- $wgResourceModules = array_merge ...
- view/lib/Resources.php
- return array( .. )
- view/lib/resources/wikibase-data-model.php
- view/lib/resources/wikibase-data-model/resources.php
- return array( .. ); preg_match(,,$remoteExtPath)
- view/lib/resources/wikibase-data-model/resources.php
- view/lib/resources/...
- ...
- view/lib/resources/wikibase-data-model.php
- return array( .. )
- view/resources/Resources.php
- return array( .. )
- view/resources/jquery/resources.php
- return array( .. ); preg_match(,,$remoteExtPath)
- view/resources/...
- ...
- view/resources/jquery/resources.php
- return array( .. )
- view/lib/Resources.php
- $wgResourceModules = array_merge ...
- wgHooks / ResourceLoaderRegisterModules
- preg_match(,,$remoteExtPath)
- $rl->register( array )
- view/resources.php
- view/resources/Resources.php
- view/init.mw.php
- $wgResourceModules = array_merge ...
- client/resources/Resources.php
- return array( .. ); preg_match(,,$remoteExtPath)
- client/resources/Resources.php
It seems the the main reason for all this complexity and indirection is that these used to be separate MediaWiki extensions where the extensions/ path specified for remoteExtPath had to vary between "Name-of-micro-extension", "Wikibase" and "Wikidata".
However, as far as I can tell it will only ever be "Wikibase", given T173818 has been resolved.
Questions:
- Can all this be simplified to simple php files that return a static array with no preg_match complexity?
- Can we merge them upwards so that we only have a handful of these files rather than a separate one for each file that used to be its own Git repo? At the very least it'd be nice to reduce from 62 files to less than 10, or even just 2? (One for Client, one for Repo). Note that this should not hinder future potential to publish these as separate npm packages, given that those packages will not need MediaWiki-PHP handling, and those publications can happen even a monorepo sub directory.
Related:
- T174922: Decide what to do with Wikibase JS-only libraries regarding the build/deployment of Wikidata code
- T177087: Make Wikibase-related JS libraries npm packages and include them as git submodules in Wikibase.git instead of installing as PHP libs using Composer
- T75020: [Task] Move JS and PHP view code to separate repo
TASK DETAIL
EMAIL PREFERENCES
To: Krinkle
Cc: Aklapper, Krinkle, Imarlier, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, Vali.matei, Wikidata-bugs, aude, Mbch331
Cc: Aklapper, Krinkle, Imarlier, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, Vali.matei, Wikidata-bugs, aude, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs