@lightningjs/blits 2.4.1 → 2.5.0

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,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.5.0
4
+
5
+ _11 jun 2026_
6
+
7
+ - Improved performance of Sprites
8
+ - Fixed correct typing of computed props
9
+ - Bumped renderer to 3.0.6
10
+ - Added re-export of platforms from renderer
11
+
3
12
  ## v2.4.1
4
13
 
5
14
  _02 jun 2026_
package/index.d.ts CHANGED
@@ -623,24 +623,36 @@ declare module '@lightningjs/blits' {
623
623
  [K in keyof T]: InferProp<T[K]>
624
624
  }
625
625
 
626
+ type Computed<T extends Record<string, () => any>> = {
627
+ [K in keyof T]: Readonly<ReturnType<T[K]>>
628
+ }
629
+
626
630
  export type ComponentContext<
627
631
  P extends Record<string, any>,
628
632
  S,
629
633
  M,
630
- C
631
- > = ThisType<Readonly<InferProps<P>> & S & M & Readonly<C> & ChildComponentBase>
634
+ C extends Record<string, () => any>,
635
+ > = ThisType<
636
+ Readonly<InferProps<P>> & S & M & Computed<C> & ChildComponentBase
637
+ >
632
638
 
633
639
  export type ApplicationContext<
634
640
  P extends Record<string, any>,
635
641
  S,
636
642
  M,
637
- C
638
- > = ThisType<Readonly<InferProps<P>> & S & M & Readonly<C> & ApplicationBase>
643
+ C,
644
+ > = ThisType<Readonly<InferProps<P>> & S & M & Computed<C> & ApplicationBase>
639
645
 
640
- export interface ComponentConfig<P extends Props = {}, S, M, C, W> {
646
+ export interface ComponentConfig<
647
+ P extends Props = {},
648
+ S,
649
+ M,
650
+ C extends Record<string, () => any>,
651
+ W,
652
+ > {
641
653
  components?: {
642
- [key: string]: ComponentFactory,
643
- },
654
+ [key: string]: ComponentFactory
655
+ }
644
656
  /**
645
657
  * XML-based template string of the Component
646
658
  *
@@ -1340,7 +1352,7 @@ declare module '@lightningjs/blits' {
1340
1352
  }
1341
1353
 
1342
1354
  interface Computed {
1343
- [key: string]: any
1355
+ [key: string]: () => any
1344
1356
  }
1345
1357
 
1346
1358
 
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "2.4.1",
3
+ "version": "2.5.0",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.js",
6
6
  "exports": {
7
7
  ".": "./index.js",
8
+ "./platforms": {
9
+ "types": "./src/platforms.d.ts",
10
+ "default": "./src/platforms.js"
11
+ },
8
12
  "./vite": "./vite/index.js",
9
13
  "./transitions": "./src/router/transitions/index.js",
10
14
  "./precompiler": "./src/lib/precompiler/precompiler.js",
@@ -75,7 +79,7 @@
75
79
  "tape": "^5.5.0"
76
80
  },
77
81
  "dependencies": {
78
- "@lightningjs/renderer": "^3.0.3",
82
+ "@lightningjs/renderer": "^3.0.6",
79
83
  "magic-string": "^0.30.21"
80
84
  },
81
85
  "repository": {
package/src/component.js CHANGED
@@ -92,10 +92,14 @@ export const componentMap = new WeakMap()
92
92
  * @typedef {Object} BlitsElement
93
93
  * @property {BlitsComponent} component - Reference to the owning Blits component.
94
94
  * @property {BlitsElementConfig} config - Configuration object for the element.
95
+ * @property {boolean} eol - Indicates when the element is end-of-life (destroyed).
95
96
  * @property {number} counter - Unique counter used for shader workarounds. FIXME?
96
97
  * @property {string[]} effectNames - Names of active shader effects.
97
98
  * @property {any} node - The underlying renderer node (e.g., WebGL node or text node).
98
99
  * @property {BlitsElementProps} props - Proxy-like object containing transformed props.
100
+ * @property {Object<string, any>} scheduledTransitions - Tracks transitions by property name.
101
+ * @property {Object<string, ReturnType<typeof setTimeout>>} debounceTimeouts - Pending animation debounce timers.
102
+ * @property {any} [_spriteState] - Native Sprite texture cache (L3 only).
99
103
  * @property {any[]} children - WVB I cant see this populated? Filtered list of children owned by this element. FIXME?
100
104
  * @property {any} parent - WVB Shortcut to the parent CoreNode?
101
105
  * @property {number} nodeId - ID of the CoreNode, if available.
@@ -105,6 +109,9 @@ export const componentMap = new WeakMap()
105
109
  * @property {function(string, any, Object):void} animate - Animates a property with transition options.
106
110
  * @property {function():void} destroy - Destroys the underlying node and cancels transitions.
107
111
  * @property {function(any): any} triggerLayout - Triggers a layout update for the element.
112
+ * @property {function(Object):void} setInspectorMetadata - Merges inspector metadata onto the node.
113
+ * @property {function():void} _scheduleNativeSpriteSync - Queues a coalesced native Sprite texture sync.
114
+ * @property {function():void} _syncNativeSprite - Resolves and applies the native Sprite texture.
108
115
  *
109
116
  * @typedef {Object} BlitsLifecycle
110
117
  * @property {BlitsComponent} component - The Blits comonent instance this lifecycle belongs to.
@@ -35,6 +35,9 @@ export default () =>
35
35
  'color',
36
36
  'src',
37
37
  'texture',
38
+ 'image',
39
+ 'map',
40
+ 'frame',
38
41
  'fit',
39
42
  'rtt',
40
43
  'mount',