@bikeshaving/crank
Advanced tools
Comparing version 0.3.2 to 0.3.3
# Changelog | ||
## [0.3.3] - 2020-08-25 | ||
### Fixed | ||
- Use ducktyping rather than instanceof checks for cross realm use-cases like nw.js (#147). | ||
## [0.3.2] - 2020-08-06 | ||
@@ -3,0 +6,0 @@ ### Changed |
@@ -10,4 +10,4 @@ 'use strict'; | ||
render(children, root, ctx) { | ||
if (!(root instanceof Node)) { | ||
throw new TypeError(`root (${root && root.toString()}) is not a node`); | ||
if (root == null || typeof root.nodeType !== "number") { | ||
throw new TypeError(`Render root is not a node. Received: ${JSON.stringify(root && root.toString())}`); | ||
} | ||
@@ -53,3 +53,3 @@ return super.render(children, root, ctx); | ||
patch(el, node) { | ||
const isSvg = node instanceof SVGElement; | ||
const isSvg = node.namespaceURI === SVG_NAMESPACE; | ||
for (let name in el.props) { | ||
@@ -132,4 +132,5 @@ let forceAttribute = false; | ||
arrange(el, parent, children) { | ||
if (el.tag === crank.Portal && !(parent instanceof Node)) { | ||
throw new TypeError("Portal root is not a node"); | ||
if (el.tag === crank.Portal && | ||
(parent == null || typeof parent.nodeType !== "number")) { | ||
throw new TypeError(`Portal root is not a node. Received: ${JSON.stringify(parent && parent.toString())}`); | ||
} | ||
@@ -136,0 +137,0 @@ if (!("innerHTML" in el.props) && |
11
dom.js
@@ -7,4 +7,4 @@ /// <reference types="./dom.d.ts" /> | ||
render(children, root, ctx) { | ||
if (!(root instanceof Node)) { | ||
throw new TypeError(`root (${root && root.toString()}) is not a node`); | ||
if (root == null || typeof root.nodeType !== "number") { | ||
throw new TypeError(`Render root is not a node. Received: ${JSON.stringify(root && root.toString())}`); | ||
} | ||
@@ -50,3 +50,3 @@ return super.render(children, root, ctx); | ||
patch(el, node) { | ||
const isSvg = node instanceof SVGElement; | ||
const isSvg = node.namespaceURI === SVG_NAMESPACE; | ||
for (let name in el.props) { | ||
@@ -129,4 +129,5 @@ let forceAttribute = false; | ||
arrange(el, parent, children) { | ||
if (el.tag === Portal && !(parent instanceof Node)) { | ||
throw new TypeError("Portal root is not a node"); | ||
if (el.tag === Portal && | ||
(parent == null || typeof parent.nodeType !== "number")) { | ||
throw new TypeError(`Portal root is not a node. Received: ${JSON.stringify(parent && parent.toString())}`); | ||
} | ||
@@ -133,0 +134,0 @@ if (!("innerHTML" in el.props) && |
{ | ||
"name": "@bikeshaving/crank", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Write JSX-driven components with functions, promises and generators.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://crank.js.org", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
297959
7219