Merge some resource loader modules

Each RL module comes with the cost of its name + hash being sent over every
request and in the startup module increasing the time to load the page.

Bug: T229791
Change-Id: I3ae230a84112a70ab369ffbff70e173b8f07ec1a
This commit is contained in:
Amir Sarabadani 2019-08-14 22:35:39 +02:00
parent fbedfdba57
commit 111d108150
7 changed files with 20 additions and 77 deletions

View file

@ -46,6 +46,9 @@
},
"ext.RevisionSlider.init": {
"scripts": [
"modules/ext.RevisionSlider.Revision.js",
"modules/ext.RevisionSlider.Api.js",
"modules/ext.RevisionSlider.util.js",
"modules/ext.RevisionSlider.init.js"
],
"styles": [
@ -60,21 +63,20 @@
]
},
"dependencies": [
"moment",
"oojs-ui",
"oojs-ui.styles.icons-moderation",
"oojs-ui.styles.icons-movement",
"mediawiki.jqueryMsg",
"ext.RevisionSlider.util",
"ext.RevisionSlider.Settings",
"ext.RevisionSlider.Slider",
"ext.RevisionSlider.Revision",
"ext.RevisionSlider.RevisionList",
"ext.RevisionSlider.HelpDialog",
"ext.RevisionSlider.Api",
"mediawiki.api",
"mediawiki.util"
],
"messages": [
"revisionslider-label-username",
"revisionslider-show-help-tooltip",
"revisionslider-loading-failed",
"revisionslider-toggle-title-expand",
@ -86,19 +88,6 @@
"ext.RevisionSlider.noscript": {
"styles": "modules/ext.RevisionSlider.noscript.css"
},
"ext.RevisionSlider.util": {
"scripts": [
"modules/ext.RevisionSlider.util.js"
]
},
"ext.RevisionSlider.Api": {
"scripts": [
"modules/ext.RevisionSlider.Api.js"
],
"messages": [
"revisionslider-label-username"
]
},
"ext.RevisionSlider.Settings": {
"scripts": [
"modules/ext.RevisionSlider.Settings.js"
@ -109,53 +98,27 @@
"mediawiki.cookie"
]
},
"ext.RevisionSlider.Revision": {
"scripts": [
"modules/ext.RevisionSlider.Revision.js"
],
"dependencies": [
"moment"
]
},
"ext.RevisionSlider.Pointer": {
"scripts": [
"modules/ext.RevisionSlider.PointerLine.js",
"modules/ext.RevisionSlider.PointerView.js",
"modules/ext.RevisionSlider.Pointer.js"
],
"dependencies": [
"ext.RevisionSlider.PointerView",
"ext.RevisionSlider.PointerLine"
]
},
"ext.RevisionSlider.PointerView": {
"scripts": [
"modules/ext.RevisionSlider.PointerView.js"
]
},
"ext.RevisionSlider.PointerLine": {
"scripts": [
"modules/ext.RevisionSlider.PointerLine.js"
]
},
"ext.RevisionSlider.Slider": {
"scripts": [
"modules/ext.RevisionSlider.DiffPage.js",
"modules/ext.RevisionSlider.util.js",
"modules/ext.RevisionSlider.SliderView.js",
"modules/ext.RevisionSlider.SliderArrowView.js",
"modules/ext.RevisionSlider.Slider.js"
],
"dependencies": [
"ext.RevisionSlider.SliderView"
]
},
"ext.RevisionSlider.SliderView": {
"scripts": [
"modules/ext.RevisionSlider.SliderView.js",
"modules/ext.RevisionSlider.SliderArrowView.js"
],
"dependencies": [
"jquery.ui.draggable",
"mediawiki.Uri",
"mediawiki.util",
"oojs-ui",
"oojs-ui.styles.icons-movement",
"ext.RevisionSlider.util",
"ext.RevisionSlider.DiffPage",
"ext.RevisionSlider.HelpDialog",
"ext.RevisionSlider.Pointer"
],
@ -164,28 +127,12 @@
"revisionslider-arrow-tooltip-older"
]
},
"ext.RevisionSlider.DiffPage": {
"scripts": [
"modules/ext.RevisionSlider.DiffPage.js"
],
"dependencies": [
"mediawiki.Uri",
"mediawiki.util"
]
},
"ext.RevisionSlider.RevisionList": {
"scripts": [
"modules/ext.RevisionSlider.Revision.js",
"modules/ext.RevisionSlider.RevisionListView.js",
"modules/ext.RevisionSlider.RevisionList.js"
],
"dependencies": [
"ext.RevisionSlider.Revision",
"ext.RevisionSlider.RevisionListView"
]
},
"ext.RevisionSlider.RevisionListView": {
"scripts": [
"modules/ext.RevisionSlider.RevisionListView.js"
],
"messages": [
"colon-separator",
"revisionslider-page-size",
@ -198,6 +145,7 @@
"revisionslider-minoredit"
],
"dependencies": [
"moment",
"mediawiki.language",
"mediawiki.util",
"oojs-ui"

View file

@ -153,14 +153,9 @@ class RevisionSliderHooks {
'tests/qunit/RevisionSlider.HelpDialog.test.js',
],
'dependencies' => [
'ext.RevisionSlider.Revision',
'ext.RevisionSlider.Pointer',
'ext.RevisionSlider.PointerView',
'ext.RevisionSlider.Slider',
'ext.RevisionSlider.SliderView',
'ext.RevisionSlider.RevisionList',
'ext.RevisionSlider.RevisionListView',
'ext.RevisionSlider.DiffPage',
'ext.RevisionSlider.HelpDialog',
'jquery.ui.draggable',
'jquery.ui.tooltip',

View file

@ -5,7 +5,7 @@
RevisionList = mw.libs.revisionSlider.RevisionList,
Revision = mw.libs.revisionSlider.Revision;
QUnit.module( 'ext.RevisionSlider.DiffPage' );
QUnit.module( 'ext.RevisionSlider.Slider' );
QUnit.test( 'Initialize DiffPage', function ( assert ) {
assert.ok( ( new DiffPage() ) );

View file

@ -1,7 +1,7 @@
( function () {
var PointerView = mw.libs.revisionSlider.PointerView;
QUnit.module( 'ext.RevisionSlider.PointerView' );
QUnit.module( 'ext.RevisionSlider.Pointer' );
QUnit.test( 'Initialize PointerView', function ( assert ) {
assert.ok( ( new PointerView( null, 'mw-revslider-pointer' ) ).render().hasClass( 'mw-revslider-pointer' ) );

View file

@ -1,7 +1,7 @@
( function () {
var Revision = mw.libs.revisionSlider.Revision;
QUnit.module( 'ext.RevisionSlider.Revision' );
QUnit.module( 'ext.RevisionSlider.RevisionList' );
QUnit.test( 'create Revision', function ( assert ) {
var data = {

View file

@ -3,7 +3,7 @@
RevisionList = mw.libs.revisionSlider.RevisionList,
Revision = mw.libs.revisionSlider.Revision;
QUnit.module( 'ext.RevisionSlider.RevisionListView' );
QUnit.module( 'ext.RevisionSlider.RevisionList' );
QUnit.test( 'render adds revisions', function ( assert ) {
var revisionListView = new RevisionListView( new RevisionList( [

View file

@ -5,7 +5,7 @@
Revision = mw.libs.revisionSlider.Revision,
startHistoryState, startHref;
QUnit.module( 'ext.RevisionSlider.SliderView' );
QUnit.module( 'ext.RevisionSlider.Slider' );
QUnit.testStart( function () {
startHistoryState = history.state;