continue;
}
+ $context = $this->getContext( $module->getGroup(), ResourceLoaderModule::TYPE_COMBINED );
+ if ( $module->isKnownEmpty( $context ) ) {
+ // Avoid needless request or embed for empty module
+ $data['states'][$name] = 'ready';
+ continue;
+ }
+
if ( $module->shouldEmbedModule( $this->context ) ) {
// Embed via mw.loader.implement per T36907.
$data['embed']['general'][] = $name;
'test.top' => [ 'position' => 'top' ],
'test.private.top' => [ 'group' => 'private', 'position' => 'top' ],
'test.private.bottom' => [ 'group' => 'private', 'position' => 'bottom' ],
+ 'test.shouldembed.empty' => [ 'shouldEmbed' => true, 'isKnownEmpty' => true ],
'test.shouldembed' => [ 'shouldEmbed' => true ],
'test.styles.pure' => [ 'type' => ResourceLoaderModule::LOAD_STYLES ],
'test.private.bottom',
'test.private.top',
'test.top',
+ 'test.shouldembed.empty',
'test.shouldembed',
'test.unregistered',
] );
'states' => [
'test.private.top' => 'loading',
'test.private.bottom' => 'loading',
+ 'test.shouldembed.empty' => 'ready',
'test.shouldembed' => 'loading',
'test.styles.pure' => 'ready',
'test.styles.user.empty' => 'ready',