Skip to content

Commit

Permalink
Declare modules that are loaded on article views
Browse files Browse the repository at this point in the history
Tracking bundlesizes on modules that are loaded on page load, allows
us to track overall site performance for article views.

These budgets are set to null for now, as tracking and enforcing
their size is optional per
https://www.mediawiki.org/wiki/Performance_budgeting

Bug: T360590
Change-Id: I1f47161b3e2c5116a7a1622bed41fba0c44c5f07
  • Loading branch information
jdlrobson authored and lucaswerkmeister committed Jan 10, 2025
1 parent ed2acc5 commit a0ed2c6
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bundlesize.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"resourceModule": "wikibase.client.data-bridge.externalModifiers",
"maxSize": null
},
{
"resourceModule": "wikibase.client.data-bridge.init",
"maxSize": null
},
{
"resourceModule": "wikibase.client.init",
"maxSize": null
},
{
"resourceModule": "wikibase.vector.searchClient",
"maxSize": null
}
]
30 changes: 30 additions & 0 deletions lib/tests/phpunit/WikibaseBundleSizeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare( strict_types = 1 );

namespace Wikibase\Lib\Tests;

use MediaWiki\Tests\Structure\BundleSizeTestBase;

/**
* Track the size of ResourceLoader modules that repo or client load on page load.
*
* @group Wikibase
* @license GPL-2.0-or-later
* @coversNothing
*/
class WikibaseBundleSizeTest extends BundleSizeTestBase {

protected function setUp(): void {
parent::setUp();

$this->markTestSkippedIfExtensionNotLoaded( 'WikibaseRepository' );
$this->markTestSkippedIfExtensionNotLoaded( 'WikibaseClient' );
}

/** @inheritDoc */
public function getBundleSizeConfig(): string {
return dirname( __DIR__, 3 ) . '/bundlesize.config.json';
}

}

0 comments on commit a0ed2c6

Please sign in to comment.