@lightningjs/blits 0.4.0 → 0.4.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
+ # v0.4.1
4
+
5
+ _13 nov 2023_
6
+
7
+ - Added support for using dynamic import of components in routes
8
+ - Added support for returning components in an async function / Promise in routes
9
+
3
10
  ## v0.4.0
4
11
 
5
12
  _9 nov 2023_
package/README.md CHANGED
@@ -20,8 +20,14 @@ Firstly, it's short, memorable and just has a nice ring to it.
20
20
 
21
21
  Finally it's a nerdy reference to the computer term "Bit Blits" commonly used in graphics processing, for rapidly moving a block of data into memory - quite similar to what Lightning is doing 🙂
22
22
 
23
+ ## Documentation
24
+
23
25
  Check out the [documentation](https://lightning-js.github.io/blits) to learn more.
24
26
 
27
+ ## Examples
28
+
29
+ Check out the open source [Demo/Example app](https://github.com/lightning-js/blits-example-app) to see what Blits and Lightning are capable of and learn how to use Blits by example.
30
+
25
31
  ## Changelog
26
32
 
27
33
  The full Changelog can be found [here](./CHANGELOG.md)
@@ -31,6 +31,6 @@
31
31
  "vite": "^4.0.4"
32
32
  },
33
33
  "dependencies": {
34
- "@lightningjs/blits": "^0.4.0"
34
+ "@lightningjs/blits": "^0.4.1"
35
35
  }
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.cjs",
6
6
  "exports": {
@@ -68,7 +68,17 @@ export const navigate = async function () {
68
68
  holder.populate({})
69
69
  holder.set('w', '100%')
70
70
  holder.set('h', '100%')
71
- view = route.component(this[symbols.props], holder, this)
71
+ view = await route.component(this[symbols.props], holder, this)
72
+ if (view[Symbol.toStringTag] === 'Module') {
73
+ if (view.default && typeof view.default === 'function') {
74
+ view = view.default(this[symbols.props], holder, this)
75
+ } else {
76
+ Log.error("Dynamic import doesn't have a default export or default is not a function")
77
+ }
78
+ }
79
+ if (typeof view === 'function') {
80
+ view = view(this[symbols.props], holder, this)
81
+ }
72
82
  } else {
73
83
  holder = view.wrapper
74
84
  }