Page MenuHomePhabricator

Modularize CX2 Resource Loader definition
Closed, ResolvedPublic


The single RL model is growing and it has everything related to the integration. It should be split into small logical groups with correct dependencies.

This split up may also help us defer some RL modules from page load.

Event Timeline

santhosh moved this task from Backlog to Priority backlog on the Language-2018-Apr-June board.

Can you explain why this is a high priority issue?

  35   133   923 ve-cx/dm/
  61   190  2053 ve-cx/dm/
  73   183  1982 ve-cx/dm/
  54   200  1577 ve-cx/dm/mixins/
 121   404  3613 ve-cx/dm/
 105   378  3227 ve-cx/dm/
  34    90   917 ve-cx/dm/
  56   159  1612 ve-cx/dm/
  53   162  1419 ve-cx/ce/ve.ce.CXLinkAnnotation.js
  43   111  1179 ve-cx/ce/ve.ce.CXSentenceSegmentAnnotation.js
  52   129  1286 ve-cx/ce/ve.ce.CXSectionNode.js
  44   108  1021 ve-cx/ce/ve.ce.CXBlockImageNode.js
  27    64   647 ve-cx/ce/ve.ce.CXImageCaptionNode.js
  68   171  1720 ve-cx/ce/ve.ce.CXPlaceholderNode.js
 106   293  3488 ve-cx/ui/ve.ui.CXDestinationTool.js
  35   138  1174 ve-cx/ui/ve.ui.CXTranslationUnitContextItem.js
 118   352  3616 ve-cx/ui/ve.ui.CXLinkContextItem.js
 222   635  6052 ve-cx/ui/ve.ui.CXSectionContextItem.js
  33    71   902 ve-cx/ui/ve.ui.CXLinkAnnotationInspector.js
  16    37   442 ve-cx/ui/ve.ui.CXLinkAnnotationWidget.js
 114   436  3959 ve-cx/ui/ve.ui.CXTranslationToolbar.js
  72   209  1708 ve-cx/ui/actions/ve.ui.CXTranslationAction.js
1542  4653 44517 total

We are talking about 44 KB of uncompressed code. Maybe we could deferred loading some of the files, but I doubt that's more than 20% of the size. In addition that deferral can introduce latencies later when people are actually trying to use the tool.

Let's have look at the big picture:

ext.visualEditor.core799.0 KiB
oojs-ui-core149.8 KiB
oojs-ui-widgets124.4 KiB
oojs-ui.styles.icons-editing-advanced90.3 KiB
ext.visualEditor.mwtransclusion87.0 KiB
moment85.7 KiB
ext.visualEditor.mwcore76.3 KiB
ext.visualEditor.mwmeta70.4 KiB
oojs-ui-core.styles61.2 KiB
unicodejs56.7 KiB
ext.visualEditor.mwimage52.7 KiB
oojs-ui.styles.icons-interactions52.3 KiB
oojs-ui-windows51.5 KiB
ext.visualEditor.diffing45.1 KiB KiB
ext.visualEditor.mwlink40.4 KiB
oojs-ui-toolbars39.8 KiB
ext.visualEditor.mwgallery37.9 KiB
oojs-ui.styles.icons-content37.2 KiB
oojs-ui.styles.icons-moderation36.8 KiB
ext.visualEditor.mwlanguage36.6 KiB
ext.cite.visualEditor36.3 KiB
diffMatchPatch35.9 KiB
jquery.uls.data33.7 KiB
ext.visualEditor.base32.8 KiB
oojs-ui.styles.icons-editing-styling30.6 KiB
easy-deflate.deflate29.6 KiB
ext.cite.visualEditor.core27.1 KiB
mediawiki.widgets.MediaSearch26.1 KiB
mediawiki.widgets.DateInputWidget26.0 KiB
ext.visualEditor.mwimage.core25.8 KiB
papaparse25.7 KiB
ext.visualEditor.desktopArticleTarget.init25.6 KiB
ext.geshi.visualEditor25.5 KiB
oojs-ui.styles.icons-media25.3 KiB

Smaller modules are omitted from the list. I believe there is some low hanging fruit here, like the diffing code that is probably not needed. I don't think it makes sense to optimize 41 KiB when we are loading over 1 MiB in dependencies.

In fact I would argue that we have a different problem: the extension.json is becoming very large and unmanageable because we have too many resource loader modules. It also puts pressure on the resource loader system and the list of all known resource loader modules is shipped with every page view as far as I remember.

I think we should group files together in logical modules to reduce the number of modules that we define and to simplify dependencies.

I think we should group files together in logical modules to reduce the number of modules that we define and to simplify dependencies.

I meant to address only this.

Change 432071 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Refactor the RL module to logical groups

Change 432071 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Refactor the RL module to logical groups

Vvjjkkii renamed this task from Modularize CX2 Resource Loader definition to 7sdaaaaaaa.Jul 1 2018, 1:13 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed santhosh as the assignee of this task.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
ToBeFree renamed this task from 7sdaaaaaaa to Modularize CX2 Resource Loader definition.Jul 1 2018, 11:06 PM
ToBeFree closed this task as Resolved.
ToBeFree assigned this task to santhosh.
ToBeFree updated the task description. (Show Details)
ToBeFree added subscribers: gerritbot, Aklapper.