From dba8055e9a1eb1ee27d8ca9461af5215868d14fc Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Wed, 11 Oct 2023 23:12:49 +0200 Subject: [PATCH 1/2] [UX Vue] Add lines for components lazy-loading Hi, this PR follows https://github.com/symfony/ux/issues/1177#issuecomment-1757659579. The added lines were removed from the documentation, but I really think we should still document the lazy-loading behavior of Vue controller components (thanks to `'lazy'` parameter). --- symfony/ux-vue/2.9/manifest.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/symfony/ux-vue/2.9/manifest.json b/symfony/ux-vue/2.9/manifest.json index 2682a6221..7527bb68f 100644 --- a/symfony/ux-vue/2.9/manifest.json +++ b/symfony/ux-vue/2.9/manifest.json @@ -29,6 +29,27 @@ "warn_if_missing": true, "requires": "symfony/webpack-encore-bundle" }, + { + "file": "assets/app.js", + "content": "// If you prefer to lazy-load your Vue.js controller components, in order to reduce the JavaScript bundle the smallest as possible,", + "position": "bottom", + "warn_if_missing": true, + "requires": "symfony/webpack-encore-bundle" + }, + { + "file": "assets/app.js", + "content": "// and degrade performances as little as possible, you can use the following line instead:", + "position": "bottom", + "warn_if_missing": true, + "requires": "symfony/webpack-encore-bundle" + }, + { + "file": "assets/app.js", + "content": "registerVueControllerComponents(require.context('./vue/controllers', true, /\\.vue$/, 'lazy'));", + "position": "bottom", + "warn_if_missing": true, + "requires": "symfony/webpack-encore-bundle" + }, { "file": "assets/app.js", "content": "registerVueControllerComponents();", From 7f847ddaf4d08753471611c9bdfd4acc6c9e378c Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Wed, 11 Oct 2023 23:16:06 +0200 Subject: [PATCH 2/2] Update manifest.json --- symfony/ux-vue/2.9/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/symfony/ux-vue/2.9/manifest.json b/symfony/ux-vue/2.9/manifest.json index 7527bb68f..fbbef853c 100644 --- a/symfony/ux-vue/2.9/manifest.json +++ b/symfony/ux-vue/2.9/manifest.json @@ -31,7 +31,7 @@ }, { "file": "assets/app.js", - "content": "// If you prefer to lazy-load your Vue.js controller components, in order to reduce the JavaScript bundle the smallest as possible,", + "content": "// If you prefer to lazy-load your Vue.js controller components, in order to reduce the JavaScript bundle the smallest as possible", "position": "bottom", "warn_if_missing": true, "requires": "symfony/webpack-encore-bundle"