Page MenuHomePhabricator

Make ResourceLoader a standalone library
Open, LowPublic

Description

Frontend

mw.loader is naturally quite separate from other MediaWiki JS modules. Mainly, because it has to - it's the first thing that loads.

  • Implement an abstraction for mw.loader (e.g. factory function or class)? Or find another way to inject MW-specific config (e.g. where load.php is mounted).
  • ???

Progress:

Backend

When ResourceLoader was first written, and shortly before this task was filed, it was mostly MW-agnostic.

Having said that, a few things have crept in over the years.

Original task description

Just like the backend, the front-end should be less tied into MediaWiki base as well.

It sounds more complicated than it really is though. All we need to do is move mw.loader into a separate file and create an instance of it in mw.loader.

It's already an object constructor, except that right now it is instantly-instantiating an anonymous object constructor (this.loader = new (function(){ ... }));

Details

Reference
bz30956
SubjectRepoBranchLines +/-
mediawiki/coremaster+60 -20
mediawiki/extensions/Citoidmaster+2 -5
mediawiki/coremaster+21 -27
mediawiki/coremaster+8 -2
mediawiki/coremaster+1 -3
mediawiki/coremaster+2 -12
mediawiki/extensions/AdvancedSearchmaster+1 -2
mediawiki/extensions/Scoremaster+11 -12
mediawiki/corewmf/1.39.0-wmf.19+2 -1
mediawiki/coremaster+2 -1
mediawiki/coremaster+3 -4
mediawiki/coremaster+73 -70
mediawiki/coremaster+2 -5
mediawiki/coremaster+71 -75
mediawiki/coremaster+32 -35
mediawiki/coremaster+1 -1
mediawiki/coremaster+8 -49
mediawiki/extensions/GlobalCssJsmaster+2 -4
mediawiki/coremaster+32 -73
mediawiki/coremaster+4 -6
mediawiki/coremaster+36 -23
mediawiki/coremaster+13 -14
mediawiki/coremaster+27 -38
mediawiki/coremaster+100 -108
mediawiki/coremaster+4 -7
mediawiki/coremaster+11 -2
mediawiki/coremaster+39 -34
mediawiki/corewmf/1.34.0-wmf.1+22 -22
mediawiki/coremaster+22 -22
mediawiki/coremaster+10 -8
mediawiki/coremaster+5 -10
mediawiki/coremaster+10 -14
mediawiki/coremaster+8 -10
mediawiki/coremaster+45 -18
Show related patches Customize query in gerrit

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 517873 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Switch Xml::encodeJsCall call in getDeprecationInformation

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

Change 523371 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Replace some Xml::encodeJs calls with RL's own encodeJson

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

Change 523371 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Replace some Xml::encodeJs calls with RL's own encodeJson

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

Change 535354 had a related patch set uploaded (by Fomafix; owner: Fomafix):
[mediawiki/core@master] resourceloader: Replace Xml::encodeJsCall by encodeJsonForScript

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

Change 535354 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Replace Xml::encodeJsCall by encodeJsonForScript

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

Change 578382 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Export ResourceModuleSkinStyles as extension attribute

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

Change 578383 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Export ResourceModules as extension attribute

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

Change 578382 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Export ResourceModuleSkinStyles as extension attribute

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

Change 578383 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Export ResourceModules as extension attribute

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

Marking T190129 as subtask. While resourceloader will most likely not use language-data directly (it takes lang and dir parameters instead), I'd like to be able to document wikimedia/language-data as a suggested package for any consumer that uses it in multilingual context since we don't want to encourage consumers to maintain their own lang->direction map.

Change 673308 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Require a Config object in ResourceLoader::__construct()

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

Change 673308 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Require a Config object in ResourceLoader::__construct()

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

Change 523967 had a related patch set uploaded (by Fomafix; author: Fomafix):

[mediawiki/core@master] Keep the test language code 'en-rtl' out of resourceloader

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

Change 728728 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] resourceloader: Remove internal debug check in makeLoaderImplementScript()

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

Change 728758 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] resourceloader: Remove obsolete logic for handheld=yes pageviews

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

Change 728758 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Remove obsolete logic for handheld=yes pageviews

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

Change 738047 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] resourceloader: Remove support for $algo param in FileContentsHasher

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

Change 738568 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/GlobalCssJs@master] maintenance: Use 'ResoureLoader' service instead of unstable ctor call

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

Change 738600 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] resourceloader: Improve wgResourceLoaderMaxage docs, minor clean up

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

Change 738568 merged by jenkins-bot:

[mediawiki/extensions/GlobalCssJs@master] maintenance: Use 'ResoureLoader' service instead of unstable ctor call

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

Change 728728 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Remove internal debug check in makeLoaderImplementScript()

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

Change 740206 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] resourceloader: Decouple FileContentsHasher from MW ObjectCache

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

Change 740206 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Decouple FileContentsHasher from MW ObjectCache

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

Change 738047 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Remove support for $algo param in FileContentsHasher

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

Change 738600 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Improve wgResourceLoaderMaxage docs, minor clean up

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

Change 751995 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] resourceloader: Remove Xml::encodeJsCall() from test case

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

Change 751995 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Remove Xml::encodeJsCall() from test case

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

Change 776355 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] [WIP] resourceloader: Decouple some internal constructor args

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

Change 776355 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Decouple some internal constructor args

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

Change 807234 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] ResourceLoader: Let Image throw RuntimeException instead of MWException

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

Change 807234 merged by jenkins-bot:

[mediawiki/core@master] ResourceLoader: Let Image throw RuntimeException instead of MWException

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

Change 811791 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] ResourceLoader: Switch Image.php to injected log channel

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

Change 812108 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@wmf/1.39.0-wmf.19] ResourceLoader: Switch Image.php to injected log channel

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

Change 811791 merged by jenkins-bot:

[mediawiki/core@master] ResourceLoader: Switch Image.php to injected log channel

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

Change 812108 merged by jenkins-bot:

[mediawiki/core@wmf/1.39.0-wmf.19] ResourceLoader: Switch Image.php to injected log channel

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

Change 830865 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/Score@master] ve-score: Switch from Xml::encodeJsCall to RL\Content::encodeJson

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

Change 830865 merged by jenkins-bot:

[mediawiki/extensions/Score@master] ve-score: Switch from Xml::encodeJsCall to RL\Content::encodeJson

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

Change 894232 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/Citoid@master] CitoidDataModule: Avoid use of global ResourceLoader::inDebugMode

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

Change 894233 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/AdvancedSearch@master] SearchnamespaceTokenModule: Avoid global ResourceLoader::inDebugMode

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

Change 894234 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] ResourceLoader: Remove makeMessageSetScript() method

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

Change 894235 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] ResourceLoader: Make internal encodeJsonForScript private

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

Change 894233 merged by jenkins-bot:

[mediawiki/extensions/AdvancedSearch@master] SearchnamespaceTokenModule: Avoid global ResourceLoader::inDebugMode

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

Change 894232 merged by jenkins-bot:

[mediawiki/extensions/Citoid@master] CitoidDataModule: Avoid use of global ResourceLoader::inDebugMode

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

Change 894234 merged by jenkins-bot:

[mediawiki/core@master] ResourceLoader: Remove makeMessageSetScript() method

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

Change 894235 merged by jenkins-bot:

[mediawiki/core@master] ResourceLoader: Make internal encodeJsonForScript private

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

Change 523967 abandoned by Krinkle:

[mediawiki/core@master] Keep the test language code 'en-rtl' out of resourceloader

Reason:

Closing per task, change in direction

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

Change 1009595 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] ResourceLoader: Migrate wfGetDB call to ICP and move to WikiModule

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

Change 1009595 merged by jenkins-bot:

[mediawiki/core@master] ResourceLoader: Migrate wfGetDB call to ICP and move to WikiModule

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

Change #1054521 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/core@master] RL: Pass in installed skins to ResourceLoader Context

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

Change #1054521 merged by jenkins-bot:

[mediawiki/core@master] ResourceLoader: Inject installed skins to ResourceLoader Context

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