From a03387e654d69981b391ac5bb5a2f42eec8ff0ca Mon Sep 17 00:00:00 2001 From: Michiel van der Geest Date: Wed, 30 Oct 2024 21:14:40 +0100 Subject: [PATCH 1/2] Added fix for reactive array props. --- src/lib/codegenerator/generator.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/lib/codegenerator/generator.js b/src/lib/codegenerator/generator.js index fa63a37a..c9c5b554 100644 --- a/src/lib/codegenerator/generator.js +++ b/src/lib/codegenerator/generator.js @@ -19,7 +19,12 @@ let counter export default function (templateObject = { children: [] }) { const ctx = { - renderCode: ['const elms = []', 'let componentType', 'const rootComponent = component'], + renderCode: [ + 'const elms = []', + 'let componentType', + 'const rootComponent = component', + 'let propData', + ], effectsCode: [], context: { props: [], components: this.components }, } @@ -213,10 +218,11 @@ const generateComponentCode = function ( options.component )}`) renderCode.push(` - props${counter}['${key.substring(1)}']= ${interpolate( - templateObject[key], - options.component - )}`) + propData = ${interpolate(templateObject[key], options.component)} + if (Array.isArray(propData) === true) { + propData = getRaw(propData).slice(0) + } + props${counter}['${key.substring(1)}'] = propData`) } else { renderCode.push( `props${counter}['${key}'] = ${cast(templateObject[key], key, options.component)}` From da8ca216a0b42d5573c7d2b94832fcde741525f4 Mon Sep 17 00:00:00 2001 From: Michiel van der Geest Date: Wed, 30 Oct 2024 21:17:04 +0100 Subject: [PATCH 2/2] Bumped version to 1.8.2 and updated changelog. --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cefcdf8..015453c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## v1.8.2 + +_30 oct 2024_ + +- Fixed edgecase issue with array based props not triggering reactivity + + ## v1.8.1 _29 oct 2024_ diff --git a/package-lock.json b/package-lock.json index b99a36a7..1cb1310b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lightningjs/blits", - "version": "1.8.1", + "version": "1.8.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@lightningjs/blits", - "version": "1.8.1", + "version": "1.8.2", "license": "Apache-2.0", "dependencies": { "@lightningjs/msdf-generator": "^1.1.0", diff --git a/package.json b/package.json index f90eb40a..c66b041f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lightningjs/blits", - "version": "1.8.1", + "version": "1.8.2", "description": "Blits: The Lightning 3 App Development Framework", "bin": "bin/index.js", "exports": {