From 07fd47ab0b237e6da332a3d198239c481e2d3bf1 Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Thu, 7 Dec 2023 09:43:40 +0000 Subject: [PATCH] [IMP] web: update owl from 2.2.6 to 2.2.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Release notes: https://github.com/odoo/owl/releases Commits: - [IMP] types: correctly support Function type for props-validation - [IMP] app: allow to instantiate templates lazily - [FIX] compiler: compile named slot in t-component in named slot - [IMP] devtools: update the devtools documentation - [IMP] owl-vision: syntax scripts, single quotes attributes and slot props highlight and switch below command - [IMP] doc: improve documentation of useExternalListener - [FIX] devtools: remove highlights when out of devtools - [IMP] devtools: highlight component on select - [ADD] owl-vision: vscode extension initial commit closes odoo/odoo#145460 Forward-port-of: odoo/odoo#145342 Forward-port-of: odoo/odoo#145236 Signed-off-by: Géry Debongnie Signed-off-by: Samuel Degueldre (sad) --- addons/web/static/lib/owl/owl.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/addons/web/static/lib/owl/owl.js b/addons/web/static/lib/owl/owl.js index 9efcc66f3b6..2b94a9bf142 100644 --- a/addons/web/static/lib/owl/owl.js +++ b/addons/web/static/lib/owl/owl.js @@ -2076,7 +2076,7 @@ set(target, key, value, receiver) { const hadKey = objectHasOwnProperty.call(target, key); const originalValue = Reflect.get(target, key, receiver); - const ret = Reflect.set(target, key, value, receiver); + const ret = Reflect.set(target, key, toRaw(value), receiver); if (!hadKey && objectHasOwnProperty.call(target, key)) { notifyReactives(target, KEYCHANGES); } @@ -3200,7 +3200,14 @@ this.translateFn = config.translateFn; this.translatableAttributes = config.translatableAttributes; if (config.templates) { - this.addTemplates(config.templates); + if (config.templates instanceof Document || typeof config.templates === "string") { + this.addTemplates(config.templates); + } + else { + for (const name in config.templates) { + this.addTemplate(name, config.templates[name]); + } + } } } static registerTemplate(name, fn) { @@ -5282,14 +5289,14 @@ // be ignored) let el = slotNode.parentElement; let isInSubComponent = false; - while (el !== clone) { + while (el && el !== clone) { if (el.hasAttribute("t-component") || el.tagName[0] === el.tagName[0].toUpperCase()) { isInSubComponent = true; break; } el = el.parentElement; } - if (isInSubComponent) { + if (isInSubComponent || !el) { continue; } slotNode.removeAttribute("t-set-slot"); @@ -5558,7 +5565,7 @@ } // do not modify manually. This file is generated by the release script. - const version = "2.2.6"; + const version = "2.2.7"; // ----------------------------------------------------------------------------- // Scheduler @@ -5905,7 +5912,7 @@ See https://github.com/odoo/owl/blob/${hash}/doc/reference/app.md#configuration * * @template T * @param {Effect} effect the effect to run on component mount and/or patch - * @param {()=>T} [computeDependencies=()=>[NaN]] a callback to compute + * @param {()=>[...T]} [computeDependencies=()=>[NaN]] a callback to compute * dependencies that will decide if the effect needs to be cleaned up and * run again. If the dependencies did not change, the effect will not run * again. The default value returns an array containing only NaN because @@ -6023,8 +6030,8 @@ See https://github.com/odoo/owl/blob/${hash}/doc/reference/app.md#configuration Object.defineProperty(exports, '__esModule', { value: true }); - __info__.date = '2023-09-25T11:50:11.419Z'; - __info__.hash = '5dcee25'; + __info__.date = '2023-12-06T13:56:01.636Z'; + __info__.hash = 'e94428a'; __info__.url = 'https://github.com/odoo/owl';