@lightningjs/blits 0.5.3 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/boilerplate/package.json +1 -1
- package/package.json +1 -1
- package/src/element.js +1 -1
- package/src/lib/codegenerator/generator.js +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
# v0.5.5
|
|
4
|
+
|
|
5
|
+
_5 dec 2023_
|
|
6
|
+
|
|
7
|
+
- Fixed regression in Slots functionality caused by forloop cleanup fix in 0.5.4
|
|
8
|
+
|
|
9
|
+
# v0.5.4
|
|
10
|
+
|
|
11
|
+
_5 dec 2023_
|
|
12
|
+
|
|
13
|
+
- Fixed issue with Components and Elements not always being cleaned up in forloop
|
|
14
|
+
- Added support for nested children inside a forloop on an Element
|
|
15
|
+
|
|
3
16
|
# v0.5.3
|
|
4
17
|
|
|
5
18
|
_4 dec 2023_
|
package/boilerplate/package.json
CHANGED
package/package.json
CHANGED
package/src/element.js
CHANGED
|
@@ -93,7 +93,7 @@ const generateElementCode = function (
|
|
|
93
93
|
renderCode.push(`
|
|
94
94
|
if(typeof cmp${counter} !== 'undefined') {
|
|
95
95
|
for(key in cmp${counter}.config.props) {
|
|
96
|
-
delete
|
|
96
|
+
delete elementConfig${counter}[cmp${counter}.config.props[key]]
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
`)
|
|
@@ -106,7 +106,7 @@ const generateElementCode = function (
|
|
|
106
106
|
`)
|
|
107
107
|
|
|
108
108
|
if (children) {
|
|
109
|
-
generateCode.call(this, { children },
|
|
109
|
+
generateCode.call(this, { children }, `${elm}`, options)
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -181,8 +181,8 @@ const generateComponentCode = function (
|
|
|
181
181
|
}
|
|
182
182
|
`)
|
|
183
183
|
|
|
184
|
-
counter++
|
|
185
184
|
if (children) {
|
|
185
|
+
counter++
|
|
186
186
|
generateElementCode.call(this, { children }, false, { ...options })
|
|
187
187
|
}
|
|
188
188
|
}
|
|
@@ -217,6 +217,7 @@ const generateForLoopCode = function (templateObject, parent) {
|
|
|
217
217
|
const keys = []
|
|
218
218
|
for(let __index = 0; __index < collection.length; __index++) {
|
|
219
219
|
parent = ${parent}
|
|
220
|
+
if(!component.key) keys.length = 0
|
|
220
221
|
const scope = Object.assign(component, {
|
|
221
222
|
key: Math.random(),
|
|
222
223
|
${index}: __index,
|
|
@@ -264,7 +265,7 @@ const generateForLoopCode = function (templateObject, parent) {
|
|
|
264
265
|
this.effectsCode.push(ctx.renderCode.join('\n'))
|
|
265
266
|
}
|
|
266
267
|
|
|
267
|
-
const generateCode = function (templateObject, parent = false) {
|
|
268
|
+
const generateCode = function (templateObject, parent = false, options = {}) {
|
|
268
269
|
templateObject.children &&
|
|
269
270
|
templateObject.children.forEach((childTemplateObject) => {
|
|
270
271
|
counter++
|
|
@@ -273,9 +274,9 @@ const generateCode = function (templateObject, parent = false) {
|
|
|
273
274
|
generateForLoopCode.call(this, childTemplateObject, parent)
|
|
274
275
|
} else {
|
|
275
276
|
if (childTemplateObject.type === 'Element' || childTemplateObject.type === 'Slot') {
|
|
276
|
-
generateElementCode.call(this, childTemplateObject, parent)
|
|
277
|
+
generateElementCode.call(this, childTemplateObject, parent, options)
|
|
277
278
|
} else {
|
|
278
|
-
generateComponentCode.call(this, childTemplateObject, parent)
|
|
279
|
+
generateComponentCode.call(this, childTemplateObject, parent, options)
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
282
|
})
|