Comparing version 0.8.3 to 0.8.4
@@ -118,2 +118,3 @@ 'use strict'; | ||
this.el.appendChild(this.loop.target); | ||
this.initialized = true; | ||
@@ -124,4 +125,2 @@ if (Object.keys(this.getConfig('routes')).length) { | ||
} | ||
this.initialized = true; | ||
} | ||
@@ -165,2 +164,9 @@ }, { | ||
}, { | ||
key: 'logError', | ||
value: function logError() { | ||
var _console; | ||
(_console = console).error.apply(_console, arguments); | ||
} | ||
}, { | ||
key: 'navigate', | ||
@@ -188,2 +194,11 @@ value: function navigate() { | ||
}, { | ||
key: 'toString', | ||
value: function toString() { | ||
try { | ||
return this.tagName + '#' + this.panelID; | ||
} catch (e) { | ||
return 'UNKNOWN COMPONENT'; | ||
} | ||
} | ||
}, { | ||
key: 'update', | ||
@@ -243,6 +258,10 @@ value: function update() { | ||
if (this.shouldUpdate(state)) { | ||
this._rendered = this.getConfig('template')(Object.assign({}, state, { | ||
$component: this, | ||
$helpers: this.getConfig('helpers') | ||
})); | ||
try { | ||
this._rendered = this.getConfig('template')(Object.assign({}, state, { | ||
$component: this, | ||
$helpers: this.getConfig('helpers') | ||
})); | ||
} catch (e) { | ||
this.logError('Error while rendering ' + this.toString(), this, e); | ||
} | ||
} | ||
@@ -249,0 +268,0 @@ return this._rendered || EMPTY_DIV; |
@@ -75,2 +75,3 @@ import MainLoop from 'main-loop'; | ||
this.el.appendChild(this.loop.target); | ||
this.initialized = true; | ||
@@ -81,4 +82,2 @@ if (Object.keys(this.getConfig('routes')).length) { | ||
} | ||
this.initialized = true; | ||
} | ||
@@ -115,2 +114,6 @@ | ||
logError() { | ||
console.error(...arguments); | ||
} | ||
navigate() { | ||
@@ -131,2 +134,10 @@ this.$panelRoot.router.navigate(...arguments); | ||
toString() { | ||
try { | ||
return `${this.tagName}#${this.panelID}`; | ||
} catch(e) { | ||
return 'UNKNOWN COMPONENT'; | ||
} | ||
} | ||
update(stateUpdate={}) { | ||
@@ -160,6 +171,10 @@ if (!this.initialized) { | ||
if (this.shouldUpdate(state)) { | ||
this._rendered = this.getConfig('template')(Object.assign({}, state, { | ||
$component: this, | ||
$helpers: this.getConfig('helpers'), | ||
})); | ||
try { | ||
this._rendered = this.getConfig('template')(Object.assign({}, state, { | ||
$component: this, | ||
$helpers: this.getConfig('helpers'), | ||
})); | ||
} catch(e) { | ||
this.logError(`Error while rendering ${this.toString()}`, this, e); | ||
} | ||
} | ||
@@ -166,0 +181,0 @@ return this._rendered || EMPTY_DIV; |
{ | ||
"name": "panel", | ||
"version": "0.8.3", | ||
"version": "0.8.4", | ||
"description": "Web Components with Virtual DOM: lightweight composable web apps", | ||
@@ -11,4 +11,4 @@ "main": "build/index.js", | ||
"test": "npm run build-test && npm run test-local", | ||
"test-local": "wct --plugin local", | ||
"test-sauce": "wct --plugin sauce" | ||
"test-local": "wct --plugin local test/index.html", | ||
"test-sauce": "wct --plugin sauce test/index.html" | ||
}, | ||
@@ -42,6 +42,2 @@ "repository": { | ||
"babel-preset-es2015": "^6.6.0", | ||
"expect.js": "^0.3.1", | ||
"min-document": "^2.18.0", | ||
"mocha": "^2.4.5", | ||
"raf": "^3.2.0", | ||
"web-component-tester": "4.2.2", | ||
@@ -48,0 +44,0 @@ "webcomponents.js": "0.7.22", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59564
7
1035