dom-expressions 0.37.0 → 0.37.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.
- package/package.json +3 -3
- package/src/client.js +3 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dom-expressions",
|
|
3
3
|
"description": "A Fine-Grained Runtime for Performant DOM Rendering",
|
|
4
|
-
"version": "0.37.
|
|
4
|
+
"version": "0.37.2",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"seroval": "^0.10.4"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"babel-plugin-jsx-dom-expressions": "^0.37.
|
|
26
|
+
"babel-plugin-jsx-dom-expressions": "^0.37.2",
|
|
27
27
|
"csstype": "^3.1",
|
|
28
28
|
"seroval": "^0.10.4"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "6f5b3cb774365b9ef4334d2d1c2ff5d6ac34f03d"
|
|
31
31
|
}
|
package/src/client.js
CHANGED
|
@@ -61,6 +61,8 @@ export function render(code, element, init, options = {}) {
|
|
|
61
61
|
export function template(html, isCE, isSVG) {
|
|
62
62
|
let node;
|
|
63
63
|
const create = () => {
|
|
64
|
+
if ("_DX_DEV_" && sharedConfig.context)
|
|
65
|
+
throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
|
|
64
66
|
const t = document.createElement("template");
|
|
65
67
|
t.innerHTML = html;
|
|
66
68
|
return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
|
|
@@ -238,9 +240,7 @@ export function getNextElement(template) {
|
|
|
238
240
|
let node, key;
|
|
239
241
|
if (!sharedConfig.context || !(node = sharedConfig.registry.get((key = getHydrationKey())))) {
|
|
240
242
|
if ("_DX_DEV_" && sharedConfig.context)
|
|
241
|
-
|
|
242
|
-
if ("_DX_DEV_" && !template)
|
|
243
|
-
throw new Error("Unrecoverable Hydration Mismatch. No template for key: " + key);
|
|
243
|
+
throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}`);
|
|
244
244
|
return template();
|
|
245
245
|
}
|
|
246
246
|
if (sharedConfig.completed) sharedConfig.completed.add(node);
|