From 6d67d02ece12305d698e742eae5d673d5ecf176d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 4 Oct 2021 13:24:38 +0000 Subject: [PATCH] [IMP] web: update owl from 1.4.4 to 1.4.6 Release notes: https://github.com/odoo/owl/releases/tag/v1.4.6 - fix: crash in component render (in rare cases) - fix: build system now target ES2017 instead of ESNext - fix: remove useless log in prod mode https://github.com/odoo/owl/releases/tag/v1.4.5 - qweb: expose translatable attributes - ci/tests: update jest/rollup - doc: clarify tutorial - doc: update readme, add nice badges closes odoo/odoo#77835 X-original-commit: aa2cfb63932d28821a4a333d5162827392bf3366 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/lib/owl/owl.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/addons/web/static/lib/owl/owl.js b/addons/web/static/lib/owl/owl.js index c4d7c5e2baf..458f8bdebc7 100644 --- a/addons/web/static/lib/owl/owl.js +++ b/addons/web/static/lib/owl/owl.js @@ -384,7 +384,7 @@ if (groupType === "LEFT_BRACE" && isLeftSeparator(prevToken) && isRightSeparator(nextToken)) { - tokens.splice(i + 1, 0, { type: "COLON", value: ":" }, { ...token }); + tokens.splice(i + 1, 0, { type: "COLON", value: ":" }, Object.assign({}, token)); nextToken = tokens[i + 1]; } if (prevToken.type === "OPERATOR" && prevToken.value === ".") { @@ -1614,6 +1614,9 @@ * template, with the name given by the t-name attribute. */ addTemplates(xmlstr) { + if (!xmlstr) { + return; + } const doc = typeof xmlstr === "string" ? parseXML(xmlstr) : xmlstr; const templates = doc.getElementsByTagName("templates")[0]; if (!templates) { @@ -1823,7 +1826,7 @@ return; } if (node.tagName !== "t" && node.hasAttribute("t-call")) { - const tCallNode = document.createElement("t"); + const tCallNode = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "t", null).documentElement; tCallNode.setAttribute("t-call", node.getAttribute("t-call")); node.removeAttribute("t-call"); node.prepend(tCallNode); @@ -1850,7 +1853,7 @@ throw new Error(`Unknown QWeb directive: '${attrName}'`); } if (node.tagName !== "t" && (attrName === "t-esc" || attrName === "t-raw")) { - const tNode = document.createElement("t"); + const tNode = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "t", null).documentElement; tNode.setAttribute(attrName, node.getAttribute(attrName)); for (let child of Array.from(node.childNodes)) { tNode.appendChild(child); @@ -2905,7 +2908,9 @@ }, }); - const config = {}; + const config = { + translatableAttributes: TRANSLATABLE_ATTRS, + }; Object.defineProperty(config, "mode", { get() { return QWeb.dev ? "dev" : "prod"; @@ -2918,9 +2923,6 @@ This is not suitable for production use. See https://github.com/odoo/owl/blob/master/doc/reference/config.md#mode for more information.`); } - else { - console.log(`Owl is now running in 'prod' mode.`); - } }, }); Object.defineProperty(config, "enableTransitions", { @@ -3656,6 +3658,7 @@ See https://github.com/odoo/owl/blob/master/doc/reference/config.md#mode for mor // build patchQueue const patchQueue = []; const doWork = function (f) { + f.component.__owl__.currentFiber = null; patchQueue.push(f); return f.child; }; @@ -3712,10 +3715,6 @@ See https://github.com/odoo/owl/blob/master/doc/reference/config.md#mode for mor component.__owl__.pvnode.elm = component.__owl__.vnode.elm; } } - const compOwl = component.__owl__; - if (fiber === compOwl.currentFiber) { - compOwl.currentFiber = null; - } } // insert into the DOM (mount case) let inDOM = false; @@ -4369,7 +4368,6 @@ See https://github.com/odoo/owl/blob/master/doc/reference/config.md#mode for mor __callMounted() { const __owl__ = this.__owl__; __owl__.status = 3 /* MOUNTED */; - __owl__.currentFiber = null; this.mounted(); if (__owl__.mountedCB) { __owl__.mountedCB(); @@ -5544,9 +5542,9 @@ See https://github.com/odoo/owl/blob/master/doc/reference/config.md#mode for mor exports.utils = utils; - __info__.version = '1.4.4'; - __info__.date = '2021-09-03T08:19:48.452Z'; - __info__.hash = 'b3181f1'; + __info__.version = '1.4.6'; + __info__.date = '2021-10-04T13:18:44.608Z'; + __info__.hash = 'c0f4956'; __info__.url = 'https://github.com/odoo/owl';