@lightningjs/blits 0.3.3 → 0.3.5

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.
@@ -31,6 +31,6 @@
31
31
  "vite": "^4.0.4"
32
32
  },
33
33
  "dependencies": {
34
- "@lightningjs/blits": "^0.3.1"
34
+ "@lightningjs/blits": "^0.3.5"
35
35
  }
36
36
  }
@@ -0,0 +1,3 @@
1
+ // temporary workaround for Vite importChunkUrl plugin
2
+ import FontLoader from '@lightningjs/blits/fontloader'
3
+ export default FontLoader
@@ -1,4 +1,5 @@
1
1
  import Blits from '@lightningjs/blits'
2
+ import fontLoader from './fontloader.js?importChunkUrl'
2
3
 
3
4
  import App from './App.js'
4
5
 
@@ -7,6 +8,7 @@ const settings = {
7
8
  h: 1080,
8
9
  multithreaded: false,
9
10
  debugLevel: 1,
11
+ fontLoader: fontLoader,
10
12
  fonts: [
11
13
  {family: 'lato', type: 'msdf', png: '/fonts/Lato-Regular.msdf.png', json: '/fonts/Lato-Regular.msdf.json'},
12
14
  {family: 'raleway', type: 'msdf', png: '/fonts/Raleway-ExtraBold.msdf.png', json: '/fonts/Raleway-ExtraBold.msdf.json'},
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@lightningjs/blits",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Blits: The Lightning 3 App Development Framework",
5
5
  "bin": "bin/index.cjs",
6
6
  "exports": {
7
7
  ".": "./index.js",
8
- "./vite": "./vite/index.js"
8
+ "./vite": "./vite/index.js",
9
+ "./fontloader": "./src/fontLoader.js"
9
10
  },
10
11
  "scripts": {
11
12
  "test": "tape '{,!(node_modules)/**/}*.test.js' | tap-diff",
package/src/launch.js CHANGED
@@ -20,7 +20,7 @@ import { MainRenderDriver, RendererMain, ThreadXRenderDriver } from '@lightningj
20
20
  import Settings from './settings.js'
21
21
  import { initLog } from './lib/log.js'
22
22
 
23
- import coreExtensionModule from './fontLoader.js?importChunkUrl'
23
+ // import coreExtensionModule from './fontLoader.js?importChunkUrl'
24
24
 
25
25
  export let renderer
26
26
 
@@ -40,7 +40,7 @@ export default (App, target, settings) => {
40
40
  {
41
41
  appWidth: settings.w || 1920,
42
42
  appHeight: settings.h || 1080,
43
- coreExtensionModule: coreExtensionModule,
43
+ coreExtensionModule: settings.fontLoader,
44
44
  },
45
45
  target,
46
46
  driver
@@ -36,7 +36,10 @@ const reactiveProxy = (target) => {
36
36
  }
37
37
  track(target, key)
38
38
 
39
- if (typeof target[key] === 'object') {
39
+ if (
40
+ typeof target[key] === 'object' &&
41
+ Object.getPrototypeOf(target[key]) === Object.prototype
42
+ ) {
40
43
  return reactiveProxy(target[key])
41
44
  }
42
45
 
@@ -68,8 +71,10 @@ const reactiveDefineProperty = (target) => {
68
71
  Object.keys(target).forEach((key) => {
69
72
  let internalValue = target[key]
70
73
 
71
- // can be improved
72
- if (typeof target[key] === 'object') {
74
+ if (
75
+ typeof target[key] === 'object' &&
76
+ Object.getPrototypeOf(target[key]) === Object.prototype
77
+ ) {
73
78
  return reactiveDefineProperty(target[key])
74
79
  }
75
80