@lightningjs/blits 1.38.0 → 1.38.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.38.1
4
+
5
+ _28 Aug 2025_
6
+
7
+ - Added guard around emiting events and selecting elements after Component destroy
8
+ - Fixed issue with `navigatingBack`
9
+
3
10
  ## v1.38.0
4
11
 
5
12
  _26 Aug 2025_
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "1.38.0",
3
+ "version": "1.38.1",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.js",
6
6
  "exports": {
@@ -31,6 +31,8 @@ export default {
31
31
  */
32
32
  $emit: {
33
33
  value: function (event, params, byReference = true) {
34
+ // early exit when component is marked as end of life
35
+ if (this.eol === true) return
34
36
  // returning if all listeners executed
35
37
  return eventListeners.executeListeners(event, params, byReference)
36
38
  },
@@ -153,6 +153,9 @@ export default {
153
153
  * @this {import('../../component').BlitsComponent}
154
154
  */
155
155
  value: function (ref) {
156
+ // early exit when component is marked as end of life
157
+ if (this.eol === true) return
158
+
156
159
  let selected = null
157
160
  this[symbols.children].forEach((child) => {
158
161
  if (Array.isArray(child)) {
@@ -390,7 +390,7 @@ export const navigate = async function () {
390
390
  shouldAnimate = true
391
391
  const oldView = this[symbols.children].splice(1, 1).pop()
392
392
  if (oldView) {
393
- removeView(previousRoute, oldView, route.transition.out)
393
+ removeView(previousRoute, oldView, route.transition.out, navigatingBack)
394
394
  }
395
395
  }
396
396
 
@@ -432,7 +432,7 @@ export const navigate = async function () {
432
432
  * @param {BlitsComponent} view
433
433
  * @param {Object} transition
434
434
  */
435
- const removeView = async (route, view, transition) => {
435
+ const removeView = async (route, view, transition, navigatingBack) => {
436
436
  // apply out transition
437
437
  if (transition) {
438
438
  if (Array.isArray(transition)) {
@@ -479,9 +479,10 @@ const setOrAnimate = (node, transition, shouldAnimate = true) => {
479
479
  existingEndCallback = null
480
480
  resolve()
481
481
  }
482
- node.set(transition.prop, { transition })
482
+ if (node !== undefined) node.set(transition.prop, { transition })
483
+ else resolve()
483
484
  } else {
484
- node.set(transition.prop, transition.value)
485
+ node !== undefined && node.set(transition.prop, transition.value)
485
486
  resolve()
486
487
  }
487
488
  })