Page MenuHomePhabricator

Explore ResourceLoader package files feature as way to reduce number of modules
Open, MediumPublic

Description

As follow-up to T203695: Drastically reduce the number of ResourceLoader modules that CX creates, we could invest using the new "package files" feature of the resource loader to reduce the number of modules further.

Ideally, we would only have a handful of modules:

  • a couple of main ones: one for dashboard, one for translation view, one for stats
  • small modules for entry points
  • some modules for big reusable components shared between the different main modules

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 27 2019, 1:54 PM
Pginer-WMF triaged this task as Medium priority.Aug 30 2019, 11:12 AM
Pginer-WMF moved this task from Needs Triage to Enhancements on the ContentTranslation board.

Documentation for this is a bit hard to find (T232566: $wgResourceModules documentation is incomplete), but there are examples to copy too.

Krinkle renamed this task from Explore resource loader package files feature as way to reduce number of resource loader modules to Explore ResourceLoader package files feature as way to reduce number of modules.Sep 11 2019, 12:40 PM
Krinkle moved this task from Limbo to Perf recommendation on the Performance-Team (Radar) board.

Some concerns have been raised that reducing the number of modules goes against making reusable code.

I don't have the CX module dependency map right now, but I guess there aren't that many modules that are actually shared across different contexts (entrypoints, stats view, dashboard, translation view).

Also, I believe it would be possible to share some simple modules just by having their scripts included in the packageFiles of multiple modules, though I have not tested this. It does make things complicated though if they have dependencies of their own, or config and styles, which would need to be duplicated.

I wrote a code to analyze RL dependency graph and find things that can be merged, CX modules stood out a lot. Given that dropping each CX module saves 30 GB/day, I put them here and I hope you find them useful. The analysis of course can have false positives (like lazy loading, etc.) but looking at this might help you:






Thanks! A bunch of those involve CX1 which we would prefer not to touch at all until it is removed completely.

Thanks! A bunch of those involve CX1 which we would prefer not to touch at all until it is removed completely.

Hello, your annoying reminder is here :D, I think the 420 days you mentioned in T203695#5158942 has passed now, shall we drop them?

Change 607921 had a related patch set uploaded (by Santhosh; owner: DannyS712):
[mediawiki/extensions/ContentTranslation@master] Combine single-use resource loader modules into ext.cx.tools

https://gerrit.wikimedia.org/r/607921

Change 607921 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Combine single-use resource loader modules into ext.cx.tools

https://gerrit.wikimedia.org/r/607921