[REL] v2.3.0

# v2.3.0

 - [IMP] compiler: add support for the .translate suffix
This commit is contained in:
Romeo Fragomeli
2024-07-25 15:13:54 +02:00
parent 0cde4b8737
commit f8bb86820e
4 changed files with 13 additions and 7 deletions
+10 -4
View File
@@ -4594,7 +4594,12 @@ class CodeGenerator {
* "onClick.bind" "onClick" "onClick: bind(ctx, ctx['onClick'])" * "onClick.bind" "onClick" "onClick: bind(ctx, ctx['onClick'])"
*/ */
formatProp(name, value) { formatProp(name, value) {
value = this.captureExpression(value); if (name.endsWith(".translate")) {
value = toStringExpression(this.translateFn(value));
}
else {
value = this.captureExpression(value);
}
if (name.includes(".")) { if (name.includes(".")) {
let [_name, suffix] = name.split("."); let [_name, suffix] = name.split(".");
name = _name; name = _name;
@@ -4603,6 +4608,7 @@ class CodeGenerator {
value = `(${value}).bind(this)`; value = `(${value}).bind(this)`;
break; break;
case "alike": case "alike":
case "translate":
break; break;
default: default:
throw new OwlError("Invalid prop suffix"); throw new OwlError("Invalid prop suffix");
@@ -5546,7 +5552,7 @@ function compile(template, options = {}) {
} }
// do not modify manually. This file is generated by the release script. // do not modify manually. This file is generated by the release script.
const version = "2.2.11"; const version = "2.3.0";
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Scheduler // Scheduler
@@ -5975,6 +5981,6 @@ TemplateSet.prototype._compileTemplate = function _compileTemplate(name, templat
export { App, Component, EventBus, OwlError, __info__, batched, 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 }; export { App, Component, EventBus, OwlError, __info__, batched, 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 = '2024-06-17T13:31:12.099Z'; __info__.date = '2024-07-25T13:13:44.371Z';
__info__.hash = 'e7f405c'; __info__.hash = '0cde4b8';
__info__.url = 'https://github.com/odoo/owl'; __info__.url = 'https://github.com/odoo/owl';
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@odoo/owl", "name": "@odoo/owl",
"version": "2.2.11", "version": "2.3.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@odoo/owl", "name": "@odoo/owl",
"version": "2.2.11", "version": "2.3.0",
"description": "Odoo Web Library (OWL)", "description": "Odoo Web Library (OWL)",
"main": "dist/owl.cjs.js", "main": "dist/owl.cjs.js",
"module": "dist/owl.es.js", "module": "dist/owl.es.js",
+1 -1
View File
@@ -1,2 +1,2 @@
// do not modify manually. This file is generated by the release script. // do not modify manually. This file is generated by the release script.
export const version = "2.2.11"; export const version = "2.3.0";