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
ProjectBranchLines +/-Subject
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+8 -2
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 499954 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Move registering of custom sources to ServiceWiring

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

Change 499954 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Move registering of custom sources to ServiceWiring

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

Change 501961 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Move registration of Resources.php to ServiceWiring

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

Change 501961 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Move registration of Resources.php to ServiceWiring

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

Change 503132 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Remove needless MW-specific fallback

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

Change 503133 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Deprecate ResourceLoaderContext::getConfig and ::getLogger

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

Change 503132 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Remove needless MW-specific fallback

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

Change 504561 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Move remaining module registrations to ServiceWiring

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

Change 504561 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Move remaining module registrations to ServiceWiring

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

Change 504660 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@wmf/1.34.0-wmf.1] resourceloader: Move remaining module registrations to ServiceWiring

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

Change 504660 merged by jenkins-bot:
[mediawiki/core@wmf/1.34.0-wmf.1] resourceloader: Move remaining module registrations to ServiceWiring

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

Change 516277 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Warn on ResourceLoader::construct without Config

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

Change 516277 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Warn on ResourceLoader::construct without Config

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

Krinkle updated the task description. (Show Details)
Krinkle updated the task description. (Show Details)

Change 503133 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Deprecate ResourceLoaderContext::getConfig and ::getLogger

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

Change 517873 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] resourceloader: Switch Xml::encodeJsCall call in getDeprecationInformation

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

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