Flow adds some modules with both addModuleStyles() and addModules(), e.g.
addModuleStyles( array( 'ext.flow.header' ) ); addModules( array( 'ext.flow.header' ) );
The first adds the CSS in a <link rel="stylesheet">, the second adds the same CSS in a JavaScript mw.loader.load() call that appends to a <style> tag in the document. It's a performance hit to add CSS twice and the duplicated Flow CSS rules in browsers' CSS inspector make debugging harder.
addModuleStyles() should only be used to load a separate 'flow.<somefeature>.styles' module that only has the LESS and CSS files for the no-JavaScript version. The LESS files for this could be named <something>-nojs.less. addModules( 'flow.<somefeature>' ) should only include LESS and CSS if it's only referenced by the module's JavaScript-generated HTML, such as a JavaScript dialog with unique CSS classes.
^ BTW performance: you don't need to pass an array if it's just one module.
Version: master
Severity: normal