And the counter-part in ParserOutput as well.
This follows-up on
80e5b160e0985, which removed the last use of this
method. It also deprecated ResourceLoaderClientHtml::setModuleScripts()
but that isn't usually used directly. The public interfaces are
mainly in OutputPage/ParserOutput, which are now deprecated as well.
Bug: T188689
Change-Id: I90baafdfc089ac03c4c3abc12065c0b60d43994e
* Skin::setupSkinUserCss() is deprecated. Adding of modules to load
has been centralised to Skin::getDefaultModules(), which is now capable
of queueing style modules as well.
* Skin::setupSkinUserCss() is deprecated. Adding of modules to load
has been centralised to Skin::getDefaultModules(), which is now capable
of queueing style modules as well.
+* OutputPage::addModuleScripts() and ParserOutput::addModuleScripts are deprecated.
+ Use addModules() instead.
=== Other changes in 1.32 ===
* …
=== Other changes in 1.32 ===
* …
- * Add one or more modules recognized by ResourceLoader. Modules added
- * through this function will be loaded by ResourceLoader when the
- * page loads.
+ * Load one or more ResourceLoader modules on this page.
*
* @param string|array $modules Module name (string) or array of module names
*/
*
* @param string|array $modules Module name (string) or array of module names
*/
- * Get the list of module JS to include on this page
+ * Get the list of script-only modules to load on this page.
*
* @param bool $filter
* @param string|null $position Unused
*
* @param bool $filter
* @param string|null $position Unused
- * Add only JS of one or more modules recognized by ResourceLoader. Module
- * scripts added through this function will be loaded by ResourceLoader when
- * the page loads.
+ * Load the scripts of one or more ResourceLoader modules, on this page.
+ * This method exists purely to provide the legacy behaviour of loading
+ * a module's scripts in the global scope, and without dependency resolution.
+ * See <https://phabricator.wikimedia.org/T188689>.
+ *
+ * @deprecated since 1.31 Use addModules() instead.
* @param string|array $modules Module name (string) or array of module names
*/
public function addModuleScripts( $modules ) {
* @param string|array $modules Module name (string) or array of module names
*/
public function addModuleScripts( $modules ) {
- * Get the list of module CSS to include on this page
+ * Get the list of style-only modules to load on this page.
*
* @param bool $filter
* @param string|null $position Unused
*
* @param bool $filter
* @param string|null $position Unused
- * Add only CSS of one or more modules recognized by ResourceLoader.
+ * Load the styles of one or more ResourceLoader modules on this page.
- * Module styles added through this function will be added using standard link CSS
- * tags, rather than as a combined Javascript and CSS package. Thus, they will
- * load when JavaScript is disabled (unless CSS also happens to be disabled).
+ * Module styles added through this function will be loaded as a stylesheet,
+ * using a standard `<link rel=stylesheet>` HTML tag, rather than as a combined
+ * Javascript and CSS package. Thus, they will even load when JavaScript is disabled.
*
* @param string|array $modules Module name (string) or array of module names
*/
*
* @param string|array $modules Module name (string) or array of module names
*/
+ /**
+ * @see OutputPage::addModules
+ */
public function addModules( $modules ) {
$this->mModules = array_merge( $this->mModules, (array)$modules );
}
public function addModules( $modules ) {
$this->mModules = array_merge( $this->mModules, (array)$modules );
}
+ /**
+ * @deprecated since 1.31 Use addModules() instead.
+ * @see OutputPage::addModuleScripts
+ */
public function addModuleScripts( $modules ) {
$this->mModuleScripts = array_merge( $this->mModuleScripts, (array)$modules );
}
public function addModuleScripts( $modules ) {
$this->mModuleScripts = array_merge( $this->mModuleScripts, (array)$modules );
}
+ /**
+ * @see OutputPage::addModuleStyles
+ */
public function addModuleStyles( $modules ) {
$this->mModuleStyles = array_merge( $this->mModuleStyles, (array)$modules );
}
public function addModuleStyles( $modules ) {
$this->mModuleStyles = array_merge( $this->mModuleStyles, (array)$modules );
}