structured-fw 1.2.1 → 1.2.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.
@@ -102,10 +102,15 @@ export class ClientComponent extends EventEmitter {
102
102
  }
103
103
  const initializer = this.app.getInitializer(this.name);
104
104
  if (initializer !== null) {
105
- await initializer.apply(this, [{
106
- net: this.net,
107
- isRedraw
108
- }]);
105
+ try {
106
+ await initializer.apply(this, [{
107
+ net: this.net,
108
+ isRedraw
109
+ }]);
110
+ }
111
+ catch (e) {
112
+ this.error(`Initializer error: ${e.stack}`);
113
+ }
109
114
  this.updateConditionals(false);
110
115
  }
111
116
  await this.emitterReady();
@@ -7,6 +7,7 @@ import { DocumentHead } from './DocumentHead.js';
7
7
  import { Component } from './Component.js';
8
8
  export declare class Document extends Component<{
9
9
  'componentCreated': Component;
10
+ 'beforeRender': void;
10
11
  }> {
11
12
  head: DocumentHead;
12
13
  language: string;
@@ -60,6 +60,7 @@ export class Document extends Component {
60
60
  this.head.add(clientConfString);
61
61
  }
62
62
  toString() {
63
+ this.emit('beforeRender');
63
64
  if (!this.initializersInitialized) {
64
65
  this.initInitializers();
65
66
  this.initClientConfig();
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "license": "MIT",
20
20
  "type": "module",
21
21
  "main": "build/index",
22
- "version": "1.2.1",
22
+ "version": "1.2.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",