aboutsummaryrefslogtreecommitdiffstats
path: root/includes/ResourceLoader/Module.php
Commit message (Collapse)AuthorAgeFilesLines
* Adjust default targets in RL/ModuleKosta Harlan2023-02-011-1/+1
| | | | | | | | | | | | | | | | | | | In Ia062ff2d8b8732b0d3498c1a614bbf6a3e3a7ddb, we changed the default targets to desktop/mobile. This broke CI for PageTriage, which has a RL module that extends ResourceLoader\Module, and which sets the default targets for "desktop" only. I am not sure if leaving ResourceLoader\Module as "desktop" only was a deliberate choice or an oversight, but it seems to be more consistent to have it defined as desktop/mobile. This will fix the issue for PageTriage and other extensions that extend ResourceLoader\Module and don't have any targets explicitly defined for their RL modules. Follows-Up: Ia062ff2d8b8732b0d3498c1a614bbf6a3e3a7ddb Bug: T127268 Bug: T328497 Change-Id: I48ed19912610a74af66d620510c192c7ba87039a
* Don’t track build statistics for unnamed modulesLucas Werkmeister2022-11-021-2/+5
| | | | | | | | | | | | Module::getName() is allowed to return null (and there are some existing modules where it returns null, such as Wikibase’s SitesModule). Passing the null name directly into strtr() produces a warning in PHP 8.1, but more importantly, it will also result in tracking the metric `resourceloader_build.` without any stat name (under any PHP version). Fix this by not tracking the individual module in this case. Bug: T319219 Change-Id: I2b2905d7452bd2694c5c1af3272e0fb0e95ff144
* ResourceLoader: readability cleanup and simplification in Module classDannyS7122022-06-281-45/+40
| | | | | | | Use early returns to reduce nesting, unhoist variables, should be a no-op in terms of functionality. Change-Id: Ic6a63dccb982615b8b3e70aabd059dec70244374
* ResourceLoader: Remove unchecked exception annotationsAdam Wight2022-06-221-9/+6
| | | | | | | | Also repair two `@see` annotations referring to methods that didn't exist. Bug: T240672 Change-Id: I2edb39554bcf46fdc83bd138ef7bb9065c2c0696
* ResourceLoader namespace (attempt 2)Tim Starling2022-05-241-0/+1128
| | | | | | | | | | | | | | | | | | Move ResourceLoader classes to their own namespace. Strip the "ResourceLoader" prefix from all except ResourceLoader itself. Move the tests by analogy. I used a namespace alias "RL" in some callers since RL\Module is less ambiguous at the call site than just "Module". I did not address DependencyStore which continues to have a non-standard location and namespace. Revert of a241d83e0a6dabedf. Bug: T308718 Change-Id: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
* Revert "ResourceLoader namespace"Lucas Werkmeister (WMDE)2022-05-161-1128/+0
| | | | | | | | | | | | This reverts commit e08ea8ccb9932f9924a613056afcb2d01c8c7b39. Reason for revert: Breaks Phan in extensions, and as far as I’m aware, this change isn’t urgently needed for anything, so the simplest fix is to revert it again for now. After PHP 7.4 it should be safer to try this again (we hopefully won’t need the two “hack” classes by then). Bug: T308443 Change-Id: Iff3318cbf97a67f821f78e60da62a583f63e389e
* ResourceLoader namespaceTim Starling2022-05-161-0/+1128
Move ResourceLoader classes to their own namespace. Strip the "ResourceLoader" prefix from all except ResourceLoader and ResourceLoaderContext. Move the tests by analogy. I used a namespace alias "RL" in some callers since RL\Module is less ambiguous at the call site than just "Module". I did not address DependencyStore which continues to have a non-standard location and namespace. Change-Id: I92998ae6a82e0b935c13e02a183e7c324fa410a3