@lightningjs/blits 1.23.0 → 1.23.1
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
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.23.1
|
|
4
|
+
|
|
5
|
+
_17 mar 2025_
|
|
6
|
+
|
|
7
|
+
- Fixed issue in vite plugin that ensures reacitivity setup in computed props when code block has a comment
|
|
8
|
+
- Fixed warnings for non-declared variables in template when they refer to plugins (i.e. `$$apState.foo`)
|
|
9
|
+
|
|
3
10
|
## v1.23.0
|
|
4
11
|
|
|
5
12
|
_13 mar 2025_
|
package/package.json
CHANGED
|
@@ -80,7 +80,7 @@ export default function (templateObject = { children: [] }, devMode = false) {
|
|
|
80
80
|
|
|
81
81
|
// This is used to get only variable from expression
|
|
82
82
|
const extractVariables = function (value) {
|
|
83
|
-
const regEx =
|
|
83
|
+
const regEx = /\$\$?\w+(\.\w+)?/g
|
|
84
84
|
const matches = value.match(regEx)
|
|
85
85
|
if (matches !== null) {
|
|
86
86
|
const shaderRegex = /\$shader/
|
|
@@ -45,7 +45,7 @@ export const removeGlobalEffects = (effectsToRemove) => {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export const track = (target, key, global = false) => {
|
|
48
|
-
if (currentEffect) {
|
|
48
|
+
if (currentEffect !== null) {
|
|
49
49
|
if (paused) {
|
|
50
50
|
return
|
|
51
51
|
}
|
|
@@ -55,12 +55,12 @@ export const track = (target, key, global = false) => {
|
|
|
55
55
|
} else if (currentKey !== null && key !== currentKey) return
|
|
56
56
|
|
|
57
57
|
let effectsMap = objectMap.get(target)
|
|
58
|
-
if (
|
|
58
|
+
if (effectsMap === undefined) {
|
|
59
59
|
effectsMap = new Map()
|
|
60
60
|
objectMap.set(target, effectsMap)
|
|
61
61
|
}
|
|
62
62
|
let effects = effectsMap.get(key)
|
|
63
|
-
if (
|
|
63
|
+
if (effects === undefined) {
|
|
64
64
|
effects = new Set()
|
|
65
65
|
effectsMap.set(key, effects)
|
|
66
66
|
}
|
|
@@ -73,11 +73,11 @@ export const track = (target, key, global = false) => {
|
|
|
73
73
|
export const trigger = (target, key, force = false) => {
|
|
74
74
|
if (paused === true) return
|
|
75
75
|
const effectsMap = objectMap.get(target)
|
|
76
|
-
if (
|
|
76
|
+
if (effectsMap === undefined) {
|
|
77
77
|
return
|
|
78
78
|
}
|
|
79
79
|
const effects = effectsMap.get(key)
|
|
80
|
-
if (effects) {
|
|
80
|
+
if (effects !== undefined) {
|
|
81
81
|
for (let effect of effects) {
|
|
82
82
|
effect(force)
|
|
83
83
|
}
|
|
@@ -133,12 +133,23 @@ export default (code) => {
|
|
|
133
133
|
const openBraceIndex = prop.fullText.indexOf('{')
|
|
134
134
|
|
|
135
135
|
if (openBraceIndex !== -1) {
|
|
136
|
+
// Extract indentation from the original function body
|
|
137
|
+
const indentMatch = prop.body.match(/^(\s+)/)
|
|
138
|
+
const indent = indentMatch ? indentMatch[1] + ' ' : ' ' // Default to 4 spaces if no indent found
|
|
139
|
+
|
|
136
140
|
const modifiedPropText =
|
|
137
141
|
prop.fullText.substring(0, openBraceIndex + 1) +
|
|
142
|
+
'\n' +
|
|
143
|
+
indent +
|
|
138
144
|
commentText +
|
|
145
|
+
'\n' +
|
|
146
|
+
indent +
|
|
139
147
|
refCode +
|
|
140
|
-
'
|
|
148
|
+
'\n' +
|
|
149
|
+
indent +
|
|
141
150
|
prop.body +
|
|
151
|
+
'\n' +
|
|
152
|
+
prop.fullText.substring(0, openBraceIndex).match(/^(\s*)/)[0] +
|
|
142
153
|
'}'
|
|
143
154
|
|
|
144
155
|
// Replace this property in the computed object text
|