Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordizzy <diosmosis@users.noreply.github.com>2022-03-04 19:35:44 +0300
committerGitHub <noreply@github.com>2022-03-04 19:35:44 +0300
commitb774954679f99ef190b9ef71043529563f764946 (patch)
treeacf7041e5865c57841fc09e61369a5c9c8c52385 /plugins/Proxy
parentda4fa4175f7cef7cd93d600487fadad34330468a (diff)
[Vue] Chunk UMD JavaScript into a set of asynchronously loaded files (#18761)
* proof of concept for chunking UMD JavaScript into a set of files that are loaded asynchronously * take into account alternative plugin directories * make chunk count and load umds individually configurable (undocumented config) and get to work * fix a bug and add chunk JS sizes to output of development:compute-js-asset-size * document * fill out TODO documentation * make sure cache buster is added to chunk script srcs * add some checks in case a chunk does not exist on disk (happens during some tests) * use realpath on test PIWIK_INCLUDE_PATH so search/replace on paths for relative path will work * add integration test and get to pass * fix for when disable_merged_assets=1 * fix condition * fix ui test failure * update screenshot Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'plugins/Proxy')
-rw-r--r--plugins/Proxy/Controller.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/Proxy/Controller.php b/plugins/Proxy/Controller.php
index b343b9e83f..a552b38d98 100644
--- a/plugins/Proxy/Controller.php
+++ b/plugins/Proxy/Controller.php
@@ -67,6 +67,19 @@ class Controller extends \Piwik\Plugin\Controller
}
/**
+ * Output a UMD merged chunk JavaScript file.
+ * This method is called when the asset manager is enabled.
+ *
+ * @see core/AssetManager.php
+ */
+ public function getUmdJs()
+ {
+ $chunk = Common::getRequestVar('chunk');
+ $chunkFile = AssetManager::getInstance()->getMergedJavaScriptChunk($chunk);
+ $this->serveJsFile($chunkFile);
+ }
+
+ /**
* @param UIAsset $uiAsset
*/
private function serveJsFile($uiAsset)