From 02dab5dc88112fd5f5ee43882ca022529acb4abf Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 29 Mar 2019 11:13:05 +0000 Subject: [PATCH] [IMP] website, *: lazy load most frontend javascript * web, survey This commit takes advantage of the other commits of this PR to enable lazy loading for most frontend javascript: 1) Extract the minimum part of the assets common: - promises library and polyfill - boot.js 2) Create "assets_common_lazy" which is "assets_common" - "minimum" 3) Include the "minimum" assets in frontend layouts using "defer" loading and "assets_common_lazy" using "lazy" loading 4) Create a script to do the actual lazy loading in a "minimum" frontend assets 5) Lazy load the current frontend / website editor assets Part of https://github.com/odoo/odoo/pull/32181 task-1961045 --- addons/survey/views/survey_templates.xml | 2 +- addons/web/static/src/js/public/lazyloader.js | 42 ++++++++++++++++ addons/web/views/webclient_templates.xml | 48 +++++++++++++++---- .../static/src/js/public/tour_manager.js | 21 ++++++++ addons/web_tour/static/src/js/tour_manager.js | 30 ++++++++++-- addons/web_tour/static/src/js/tour_service.js | 30 ++++-------- addons/web_tour/views/tour_templates.xml | 6 +++ .../website/static/src/js/menu/customize.js | 5 +- addons/website/views/website_templates.xml | 2 +- 9 files changed, 148 insertions(+), 38 deletions(-) create mode 100644 addons/web/static/src/js/public/lazyloader.js create mode 100644 addons/web_tour/static/src/js/public/tour_manager.js diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml index 834d148a95f..20426c852ca 100644 --- a/addons/survey/views/survey_templates.xml +++ b/addons/survey/views/survey_templates.xml @@ -134,7 +134,7 @@ + + + + + + + + + -