Skip to content

Commit

Permalink
[REL] v2.2.1
Browse files Browse the repository at this point in the history
# v2.2.1

 - [FIX] compiler: allow t-out on component tag
  • Loading branch information
ged-odoo committed Jul 19, 2023
1 parent 2e07799 commit 875ebdc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 23 deletions.
39 changes: 19 additions & 20 deletions docs/owl.js
Original file line number Diff line number Diff line change
Expand Up @@ -4839,10 +4839,10 @@ function parseNode(node, ctx) {
parseTCall(node, ctx) ||
parseTCallBlock(node) ||
parseTEscNode(node, ctx) ||
parseTOutNode(node, ctx) ||
parseTKey(node, ctx) ||
parseTTranslation(node, ctx) ||
parseTSlot(node, ctx) ||
parseTOutNode(node, ctx) ||
parseComponent(node, ctx) ||
parseDOMNode(node, ctx) ||
parseTSetNode(node, ctx) ||
Expand Down Expand Up @@ -5032,9 +5032,6 @@ function parseTEscNode(node, ctx) {
content: [tesc],
};
}
if (ast.type === 11 /* TComponent */) {
throw new OwlError("t-esc is not supported on Component nodes");
}
return tesc;
}
// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -5476,19 +5473,21 @@ function normalizeTIf(el) {
*
* @param el the element containing the tree that should be normalized
*/
function normalizeTEsc(el) {
const elements = [...el.querySelectorAll("[t-esc]")].filter((el) => el.tagName[0] === el.tagName[0].toUpperCase() || el.hasAttribute("t-component"));
for (const el of elements) {
if (el.childNodes.length) {
throw new OwlError("Cannot have t-esc on a component that already has content");
}
const value = el.getAttribute("t-esc");
el.removeAttribute("t-esc");
const t = el.ownerDocument.createElement("t");
if (value != null) {
t.setAttribute("t-esc", value);
function normalizeTEscTOut(el) {
for (const d of ["t-esc", "t-out"]) {
const elements = [...el.querySelectorAll(`[${d}]`)].filter((el) => el.tagName[0] === el.tagName[0].toUpperCase() || el.hasAttribute("t-component"));
for (const el of elements) {
if (el.childNodes.length) {
throw new OwlError(`Cannot have ${d} on a component that already has content`);
}
const value = el.getAttribute(d);
el.removeAttribute(d);
const t = el.ownerDocument.createElement("t");
if (value != null) {
t.setAttribute(d, value);
}
el.appendChild(t);
}
el.appendChild(t);
}
}
/**
Expand All @@ -5499,7 +5498,7 @@ function normalizeTEsc(el) {
*/
function normalizeXML(el) {
normalizeTIf(el);
normalizeTEsc(el);
normalizeTEscTOut(el);
}
/**
* Parses an XML string into an XML document, throwing errors on parser errors
Expand Down Expand Up @@ -5552,7 +5551,7 @@ function compile(template, options = {}) {
}

// do not modify manually. This file is generated by the release script.
const version = "2.1.4";
const version = "2.2";

// -----------------------------------------------------------------------------
// Scheduler
Expand Down Expand Up @@ -5985,6 +5984,6 @@ TemplateSet.prototype._compileTemplate = function _compileTemplate(name, templat
export { App, Component, EventBus, OwlError, __info__, blockDom, loadFile, markRaw, markup, mount, onError, onMounted, onPatched, onRendered, onWillDestroy, onWillPatch, onWillRender, onWillStart, onWillUnmount, onWillUpdateProps, reactive, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, validate, validateType, whenReady, xml };


__info__.date = '2023-07-18T14:07:26.565Z';
__info__.hash = '836e12b';
__info__.date = '2023-07-19T13:22:24.480Z';
__info__.hash = '2e07799';
__info__.url = 'https://github.com/odoo/owl';
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@odoo/owl",
"version": "2.2",
"version": "2.2.1",
"description": "Odoo Web Library (OWL)",
"main": "dist/owl.cjs.js",
"module": "dist/owl.es.js",
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// do not modify manually. This file is generated by the release script.
export const version = "2.2";
export const version = "2.2.1";

0 comments on commit 875ebdc

Please sign in to comment.