elm-hot
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "elm-hot", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Hot code swapping for Elm", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -16,2 +16,5 @@ [![CircleCI](https://circleci.com/gh/klazuka/elm-hot.svg?style=svg)](https://circleci.com/gh/klazuka/elm-hot) | ||
### 1.0.1 | ||
- bug fixes | ||
### 1.0.0 | ||
@@ -18,0 +21,0 @@ - improved Browser.application support (Browser.Navigation.Key can be stored anywhere in your model now) |
@@ -127,2 +127,8 @@ //////////////////// HMR BEGIN //////////////////// | ||
function isFullscreenApp() { | ||
// Returns true if the Elm app will take over the entire DOM body. | ||
return typeof elm$browser$Browser$application !== 'undefined' | ||
|| typeof elm$browser$Browser$document !== 'undefined'; | ||
} | ||
function wrapDomNode(node) { | ||
@@ -163,3 +169,5 @@ // When embedding an Elm app into a specific DOM node, Elm will replace the provided | ||
// normal case | ||
domNode = args['node'] ? wrapDomNode(args['node']) : document.body; | ||
domNode = args['node'] && !isFullscreenApp() | ||
? wrapDomNode(args['node']) | ||
: document.body; | ||
flags = args['flags']; | ||
@@ -323,2 +331,6 @@ } else { | ||
if (typeof item.value !== "object") { | ||
continue; | ||
} | ||
for (var propName in item.value) { | ||
@@ -325,0 +337,0 @@ if (!item.value.hasOwnProperty(propName)) continue; |
@@ -177,2 +177,13 @@ import test from 'ava'; | ||
test('if Browser.Navigation.Key cannot be found, degrade gracefully', async t => { | ||
const testName = "BrowserApplicationMissingNavKeyError"; | ||
// There was a bug (https://github.com/klazuka/elm-hot/issues/15) which caused an infinite loop | ||
// when the root of the model was a union type and the Browser.Navigation.Key could not be found. | ||
const page = t.context.page; | ||
await page.goto(`${t.context.serverUrl}/${testName}.html`); | ||
// If we made it this far, then the page successfully loaded. | ||
t.pass() | ||
}); | ||
// TEST BUILDING BLOCKS | ||
@@ -179,0 +190,0 @@ |
Sorry, the diff of this file is not supported yet
463341
85
840
76