structured-fw 1.3.0 → 1.3.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.
@@ -1,2 +1,4 @@
1
1
  import { ClientApplication } from './ClientApplication.js';
2
- new ClientApplication();
2
+ window.addEventListener('load', () => {
3
+ new ClientApplication();
4
+ });
@@ -79,9 +79,19 @@ export class ClientComponent extends EventEmitter {
79
79
  }
80
80
  this.isReady = true;
81
81
  if (this.isRoot || isRedrawRoot) {
82
- await this.runInitializer(isRedraw);
82
+ this.on('initializerExecuted', async () => {
83
+ this.emit('ready');
84
+ if (isRedraw) {
85
+ await this.emit('afterRedraw');
86
+ }
87
+ });
88
+ requestAnimationFrame(() => {
89
+ this.runInitializer(isRedraw);
90
+ });
91
+ }
92
+ else {
93
+ this.emit('ready');
83
94
  }
84
- this.emit('ready');
85
95
  }
86
96
  reset() {
87
97
  this.data = {};
@@ -236,7 +246,6 @@ export class ClientComponent extends EventEmitter {
236
246
  });
237
247
  }
238
248
  }
239
- await this.emit('afterRedraw');
240
249
  }
241
250
  initConditionals(node) {
242
251
  const isSelf = node === undefined;
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "license": "MIT",
20
20
  "type": "module",
21
21
  "main": "build/index",
22
- "version": "1.3.0",
22
+ "version": "1.3.2",
23
23
  "scripts": {
24
24
  "develop": "tsc --watch",
25
25
  "startDev": "cd build && nodemon --watch '../app/**/*' --watch '../build/**/*' -e js,html,hbs,css index.js",