diff --git a/docs/owl.js b/docs/owl.js index 2115c64d..d3a21161 100644 --- a/docs/owl.js +++ b/docs/owl.js @@ -1850,8 +1850,9 @@ const NO_CALLBACK = () => { }; const objectToString = Object.prototype.toString; const objectHasOwnProperty = Object.prototype.hasOwnProperty; -const SUPPORTED_RAW_TYPES = new Set(["Object", "Array", "Set", "Map", "WeakMap"]); -const COLLECTION_RAWTYPES = new Set(["Set", "Map", "WeakMap"]); +// Use arrays because Array.includes is faster than Set.has for small arrays +const SUPPORTED_RAW_TYPES = ["Object", "Array", "Set", "Map", "WeakMap"]; +const COLLECTION_RAW_TYPES = ["Set", "Map", "WeakMap"]; /** * extract "RawType" from strings like "[object RawType]" => this lets us ignore * many native objects such as Promise (whose toString is [object Promise]) @@ -1874,7 +1875,7 @@ function canBeMadeReactive(value) { if (typeof value !== "object") { return false; } - return SUPPORTED_RAW_TYPES.has(rawType(value)); + return SUPPORTED_RAW_TYPES.includes(rawType(value)); } /** * Creates a reactive from the given object/callback if possible and returns it, @@ -2044,7 +2045,7 @@ function reactive(target, callback = NO_CALLBACK) { const reactivesForTarget = reactiveCache.get(target); if (!reactivesForTarget.has(callback)) { const targetRawType = rawType(target); - const handler = COLLECTION_RAWTYPES.has(targetRawType) + const handler = COLLECTION_RAW_TYPES.includes(targetRawType) ? collectionsProxyHandler(target, callback, targetRawType) : basicProxyHandler(callback); const proxy = new Proxy(target, handler); @@ -5537,7 +5538,7 @@ function compile(template, options = {}) { } // do not modify manually. This file is generated by the release script. -const version = "2.2.8"; +const version = "2.2.9"; // ----------------------------------------------------------------------------- // Scheduler @@ -5966,6 +5967,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 = '2024-01-12T10:02:46.131Z'; -__info__.hash = '7b454da'; +__info__.date = '2024-01-12T14:43:56.804Z'; +__info__.hash = '7b3e39b'; __info__.url = 'https://github.com/odoo/owl'; diff --git a/package-lock.json b/package-lock.json index 67bcf450..86096ef5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@odoo/owl", - "version": "2.2.8", + "version": "2.2.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b3966dc6..31655484 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@odoo/owl", - "version": "2.2.8", + "version": "2.2.9", "description": "Odoo Web Library (OWL)", "main": "dist/owl.cjs.js", "module": "dist/owl.es.js", diff --git a/src/version.ts b/src/version.ts index 7e2ca009..854471b7 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,2 +1,2 @@ // do not modify manually. This file is generated by the release script. -export const version = "2.2.8"; +export const version = "2.2.9";