Skip to content

Commit 5dcee25

Browse files
committed
[REL] v2.2.6
# v2.2.6 - [IMP] devtools: add svg elements detection - [FIX] reactivity: do not notify for NOOPs on collections - [IMP] app: export apps set as static property - [IMP] runtime: do not check template equality outside dev mode - [FIX] runtime: properly support t-foreach on strings
1 parent 752160f commit 5dcee25

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

docs/owl.js

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,7 @@ function delegateAndNotify(setterName, getterName, target) {
21772177
if (hadKey !== hasKey) {
21782178
notifyReactives(target, KEYCHANGES);
21792179
}
2180-
if (originalValue !== value) {
2180+
if (originalValue !== target[getterName](key)) {
21812181
notifyReactives(target, key);
21822182
}
21832183
return ret;
@@ -2998,15 +2998,13 @@ function prepareList(collection) {
29982998
keys = [...collection.keys()];
29992999
values = [...collection.values()];
30003000
}
3001+
else if (Symbol.iterator in Object(collection)) {
3002+
keys = [...collection];
3003+
values = keys;
3004+
}
30013005
else if (collection && typeof collection === "object") {
3002-
if (Symbol.iterator in collection) {
3003-
keys = [...collection];
3004-
values = keys;
3005-
}
3006-
else {
3007-
values = Object.values(collection);
3008-
keys = Object.keys(collection);
3009-
}
3006+
values = Object.values(collection);
3007+
keys = Object.keys(collection);
30103008
}
30113009
else {
30123010
throw new OwlError(`Invalid loop expression: "${collection}" is not iterable`);
@@ -3207,6 +3205,10 @@ class TemplateSet {
32073205
}
32083206
addTemplate(name, template) {
32093207
if (name in this.rawTemplates) {
3208+
// this check can be expensive, just silently ignore double definitions outside dev mode
3209+
if (!this.dev) {
3210+
return;
3211+
}
32103212
const rawTemplate = this.rawTemplates[name];
32113213
const currentAsString = typeof rawTemplate === "string"
32123214
? rawTemplate
@@ -5553,7 +5555,7 @@ function compile(template, options = {}) {
55535555
}
55545556

55555557
// do not modify manually. This file is generated by the release script.
5556-
const version = "2.2.5";
5558+
const version = "2.2.6";
55575559

55585560
// -----------------------------------------------------------------------------
55595561
// Scheduler
@@ -5642,21 +5644,16 @@ const DEV_MSG = () => {
56425644
This is not suitable for production use.
56435645
See https://github.com/odoo/owl/blob/${hash}/doc/reference/app.md#configuration for more information.`;
56445646
};
5645-
window.__OWL_DEVTOOLS__ || (window.__OWL_DEVTOOLS__ = {
5646-
apps: new Set(),
5647-
Fiber: Fiber,
5648-
RootFiber: RootFiber,
5649-
toRaw: toRaw,
5650-
reactive: reactive,
5651-
});
5647+
const apps = new Set();
5648+
window.__OWL_DEVTOOLS__ || (window.__OWL_DEVTOOLS__ = { apps, Fiber, RootFiber, toRaw, reactive });
56525649
class App extends TemplateSet {
56535650
constructor(Root, config = {}) {
56545651
super(config);
56555652
this.scheduler = new Scheduler();
56565653
this.root = null;
56575654
this.name = config.name || "";
56585655
this.Root = Root;
5659-
window.__OWL_DEVTOOLS__.apps.add(this);
5656+
apps.add(this);
56605657
if (config.test) {
56615658
this.dev = true;
56625659
}
@@ -5713,7 +5710,7 @@ class App extends TemplateSet {
57135710
this.root.destroy();
57145711
this.scheduler.processTasks();
57155712
}
5716-
window.__OWL_DEVTOOLS__.apps.delete(this);
5713+
apps.delete(this);
57175714
}
57185715
createComponent(name, isStatic, hasSlotsProp, hasDynamicPropList, propList) {
57195716
const isDynamic = !isStatic;
@@ -5788,6 +5785,7 @@ class App extends TemplateSet {
57885785
}
57895786
}
57905787
App.validateTarget = validateTarget;
5788+
App.apps = apps;
57915789
App.version = version;
57925790
async function mount(C, target, config = {}) {
57935791
return new App(C, config).mount(target, config);
@@ -5986,6 +5984,6 @@ TemplateSet.prototype._compileTemplate = function _compileTemplate(name, templat
59865984
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 };
59875985

59885986

5989-
__info__.date = '2023-08-07T10:26:30.557Z';
5990-
__info__.hash = 'b25e988';
5987+
__info__.date = '2023-09-25T11:48:01.531Z';
5988+
__info__.hash = '752160f';
59915989
__info__.url = 'https://github.com/odoo/owl';

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@odoo/owl",
3-
"version": "2.2.5",
3+
"version": "2.2.6",
44
"description": "Odoo Web Library (OWL)",
55
"main": "dist/owl.cjs.js",
66
"module": "dist/owl.es.js",

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// do not modify manually. This file is generated by the release script.
2-
export const version = "2.2.5";
2+
export const version = "2.2.6";

0 commit comments

Comments
 (0)