warn on unmount (#485)

This commit is contained in:
Yoshua Wuyts
2017-04-26 13:52:34 +02:00
committed by GitHub
parent 357d7d14b5
commit 6cf13af5ce
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -57,6 +57,7 @@ function Choo (opts) {
} }
var newTree = router(createLocation()) var newTree = router(createLocation())
tree = nanomorph(tree, newTree) tree = nanomorph(tree, newTree)
assert.notEqual(tree, newTree, 'choo.start: a different node type was returned as the root node on a rerender. Make sure that the root node is always the same type to prevent the application from being unmounted.')
if (hasPerformance && timingEnabled) { if (hasPerformance && timingEnabled) {
window.performance.mark('choo:renderEnd') window.performance.mark('choo:renderEnd')
window.performance.measure('choo:render', 'choo:renderStart', 'choo:renderEnd') window.performance.measure('choo:render', 'choo:renderStart', 'choo:renderEnd')
+1 -1
View File
@@ -8,7 +8,7 @@
"deps": "dependency-check --entry ./html.js . && dependency-check . --extra --no-dev --entry ./html.js", "deps": "dependency-check --entry ./html.js . && dependency-check . --extra --no-dev --entry ./html.js",
"inspect": "browserify --full-paths index -g unassertify -g uglifyify | discify --open", "inspect": "browserify --full-paths index -g unassertify -g uglifyify | discify --open",
"prepublish": "npm run build", "prepublish": "npm run build",
"start": "bankai start example --optimize", "start": "bankai start example",
"test": "standard && npm run deps && node test.js" "test": "standard && npm run deps && node test.js"
}, },
"repository": "yoshuawuyts/choo", "repository": "yoshuawuyts/choo",