@lightningjs/blits 1.43.0 → 1.43.2

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.43.2
4
+
5
+ _13 Nov 2025_
6
+
7
+ - Fixed issue with endless loop in router when first page in history would fail an async before / beforeEach hook (introduced in v1.43.0)
8
+
9
+ ## v1.43.1
10
+
11
+ _13 Nov 2025_
12
+
13
+ - Added arguments of fpsUpdate and frameTick hooks to type definitions
14
+
3
15
  ## v1.43.0
4
16
 
5
17
  _12 Nov 2025_
package/index.d.ts CHANGED
@@ -169,7 +169,7 @@ declare module '@lightningjs/blits' {
169
169
  *
170
170
  * Note: This hook will fire continuously, multiple times per second!
171
171
  */
172
- frameTick?: () => void;
172
+ frameTick?: (data: {time: number, delta: number}) => void;
173
173
  /**
174
174
  * Fires when the component enters the viewport _margin_ and is attached to the render tree
175
175
  *
@@ -205,7 +205,7 @@ declare module '@lightningjs/blits' {
205
205
  *
206
206
  * Note: This event fire multiple times
207
207
  */
208
- fpsUpdate?: () => void;
208
+ fpsUpdate?: (fps: number) => void;
209
209
  }
210
210
 
211
211
  export interface Input {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "1.43.0",
3
+ "version": "1.43.2",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.js",
6
6
  "exports": {
@@ -267,13 +267,15 @@ export const navigate = async function () {
267
267
  } catch (error) {
268
268
  Log.error('Error or Rejected Promise in "BeforeEach" Hook', error)
269
269
 
270
- preventHashChangeNavigation = true
271
- currentRoute = previousRoute
272
- window.history.back()
270
+ if (history.length > 0) {
271
+ preventHashChangeNavigation = true
272
+ currentRoute = previousRoute
273
+ window.history.back()
273
274
 
274
- navigatingBack = false
275
- state.navigating = false
276
- return
275
+ navigatingBack = false
276
+ state.navigating = false
277
+ return
278
+ }
277
279
  }
278
280
  // If the resolved result is an object, redirect if the path in the object was changed
279
281
  if (isObject(beforeEachResult) === true && beforeEachResult.path !== currentPath) {
@@ -282,7 +284,7 @@ export const navigate = async function () {
282
284
  return
283
285
  }
284
286
  // If the resolved result is false, cancel navigation
285
- if (beforeEachResult === false) {
287
+ if (beforeEachResult === false && history.length > 0) {
286
288
  preventHashChangeNavigation = true
287
289
  currentRoute = previousRoute
288
290
  window.history.back()
@@ -306,13 +308,15 @@ export const navigate = async function () {
306
308
  } catch (error) {
307
309
  Log.error('Error or Rejected Promise in "Before" Hook', error)
308
310
 
309
- preventHashChangeNavigation = true
310
- currentRoute = previousRoute
311
- window.history.back()
311
+ if (history.length > 0) {
312
+ preventHashChangeNavigation = true
313
+ currentRoute = previousRoute
314
+ window.history.back()
312
315
 
313
- navigatingBack = false
314
- state.navigating = false
315
- return
316
+ navigatingBack = false
317
+ state.navigating = false
318
+ return
319
+ }
316
320
  }
317
321
  // If the resolved result is an object, redirect if the path in the object was changed
318
322
  if (isObject(beforeHookOutput) === true && beforeHookOutput.path !== currentPath) {
@@ -321,7 +325,7 @@ export const navigate = async function () {
321
325
  return
322
326
  }
323
327
  // If the resolved result is false, cancel navigation
324
- if (beforeHookOutput === false) {
328
+ if (beforeHookOutput === false && history.length > 0) {
325
329
  preventHashChangeNavigation = true
326
330
  currentRoute = previousRoute
327
331
  window.history.back()