wiki.techinc.nl/includes/resourceloader
Roan Kattouw fbbd65d2df ResourceLoader: Add support for packageFiles
Package files are files that are part of a module, but are not
immediately executed when the module executes. Instead, they are
lazy-excecuted when require() is called on them. Package files can be
scripts (JS) or data (JSON), and can be real files on the file system,
or virtual files generated by a callback.

Using virtual data files, server-side data and config variables can be
bundled with a module. Support for file-based require() allows us to
import npm modules into ResourceLoader more easily.

The require function passed to each script execution context, which was
previously a reference to the global mw.loader.require() function, is
changed to one that is scoped to the module and the file being executed.
This is needed to support relative paths: require( '../foo.js' ) can
mean a different file depending on the path of the calling file.

The results of require()ing each file (i.e. the value of module.exports
after executing it) are stored, and calling require() on the same file a
second time won't execute it again, but will return the stored value.

Miscellaneous changes:
- Add XmlJsCode::encodeObject(), which combines an associative array of
  XmlJsCode objects into one larger XmlJsCode object. This is needed for
  encoding the packageFiles parameter in mw.loader.implement() calls.

Bug: T133462
Change-Id: I78cc86e626de0720397718cd2bed8ed279579112
2019-02-05 22:05:02 +00:00
..
DerivativeResourceLoaderContext.php
ResourceLoader.php ResourceLoader: Add support for packageFiles 2019-02-05 22:05:02 +00:00
ResourceLoaderClientHtml.php resourceloader: Add internal RLPAGEMODULES constant 2018-09-18 01:10:01 +01:00
ResourceLoaderContext.php resourceloader: Add getConfig() method to ResourceLoaderContext 2018-12-09 01:46:38 +00:00
ResourceLoaderFileModule.php ResourceLoader: Add support for packageFiles 2019-02-05 22:05:02 +00:00
ResourceLoaderFilePath.php
ResourceLoaderForeignApiModule.php
ResourceLoaderImage.php resourceloader: Avoid unnecessary xmlns attributes in ResourceLoaderImage 2019-01-16 02:22:45 +00:00
ResourceLoaderImageModule.php
ResourceLoaderJqueryMsgModule.php
ResourceLoaderLanguageDataModule.php Ensure LanguageCode::bcp47() returns a valid BCP 47 language code 2018-10-11 01:53:54 -04:00
ResourceLoaderLanguageNamesModule.php
ResourceLoaderLessVarFileModule.php
ResourceLoaderMediaWikiUtilModule.php
ResourceLoaderModule.php ResourceLoader: Add support for packageFiles 2019-02-05 22:05:02 +00:00
ResourceLoaderOOUIFileModule.php
ResourceLoaderOOUIImageModule.php
ResourceLoaderOOUIModule.php resources: Rename oojs-ui file paths to ooui per general branding 2018-09-10 14:35:45 -07:00
ResourceLoaderSiteModule.php
ResourceLoaderSiteStylesModule.php
ResourceLoaderSkinModule.php build: Updating mediawiki/mediawiki-codesniffer to 22.0.0 2018-09-16 15:51:11 +00:00
ResourceLoaderSpecialCharacterDataModule.php
ResourceLoaderStartUpModule.php resourceloader: ResourceLoaderGetConfigVars is passed skin 2018-10-22 18:55:44 +00:00
ResourceLoaderUploadDialogModule.php
ResourceLoaderUserDefaultsModule.php
ResourceLoaderUserModule.php
ResourceLoaderUserOptionsModule.php
ResourceLoaderUserStylesModule.php
ResourceLoaderUserTokensModule.php
ResourceLoaderWikiModule.php