virtual-dom
Advanced tools
Comparing version 0.0.23 to 0.0.24
{ | ||
"name": "virtual-dom", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "A batched diff-based DOM rendering strategy", | ||
@@ -24,3 +24,3 @@ "keywords": [], | ||
"global": "^4.3.0", | ||
"is-object": "0.1.2", | ||
"is-object": "^1.0.1", | ||
"next-tick": "^0.2.2", | ||
@@ -31,3 +31,3 @@ "x-is-array": "0.1.0", | ||
"devDependencies": { | ||
"global": "^4.2.1", | ||
"istanbul": "^0.3.4", | ||
"min-document": "^2.6.1", | ||
@@ -37,4 +37,4 @@ "opn": "^1.0.0", | ||
"tap-dot": "^0.2.1", | ||
"tap-spec": "^0.2.0", | ||
"tape": "^2.13.4", | ||
"tap-spec": "^2.1.1", | ||
"tape": "^3.0.3", | ||
"zuul": "^1.10.0" | ||
@@ -57,3 +57,7 @@ }, | ||
"dist": "browserify --standalone virtual-dom index.js > dist/virtual-dom.js", | ||
"travis-test": "npm run phantom && npm run cover && istanbul report lcov && ((cat coverage/lcov.info | coveralls) || exit 0)" | ||
"travis-test": "npm run phantom && npm run cover && istanbul report lcov && ((cat coverage/lcov.info | coveralls) || exit 0)", | ||
"release": "npm run release-patch", | ||
"release-patch": "git checkout master && npm version patch && git push origin master --tags && npm publish", | ||
"release-minor": "git checkout master && npm version minor && git push origin master --tags && npm publish", | ||
"release-major": "git checkout master && npm version major && git push origin master --tags && npm publish" | ||
}, | ||
@@ -60,0 +64,0 @@ "testling": { |
@@ -243,4 +243,2 @@ var test = require("tape") | ||
Hook.prototype.hook = function hook() { | ||
console.log("HOOKING") | ||
var key = this.value | ||
@@ -247,0 +245,0 @@ if (key in hookCounts) { |
@@ -622,2 +622,32 @@ var test = require("tape") | ||
test("Can replace stateful widget with vnode", function (assert) { | ||
var statefulWidget = { | ||
init: function () { | ||
return render(h("div.widget")) | ||
}, | ||
update: function () {}, | ||
destroy: function () {}, | ||
type: "Widget" | ||
} | ||
var leftNode = h("div", statefulWidget) | ||
var rightNode = h("div", h("div.vnode")) | ||
var rootNode = render(leftNode) | ||
assert.equal(rootNode.childNodes.length, 1) | ||
assert.equal(rootNode.childNodes[0].className, 'widget') | ||
var patches = diff(leftNode, rightNode) | ||
var newRoot = patch(rootNode, patches) | ||
assert.equal(newRoot, rootNode) | ||
assert.equal(newRoot.childNodes.length, 1) | ||
assert.equal(newRoot.childNodes[0].className, 'vnode') | ||
assert.end() | ||
}) | ||
test("Ensure children are not rendered more than once", function (assert) { | ||
@@ -624,0 +654,0 @@ var initCount = 0 |
var h = require("./index.js") | ||
var BLACKLISTED_KEYS = { | ||
"style": true, | ||
"namespace": true, | ||
"key": true | ||
// http://www.w3.org/TR/SVGTiny12/attributeTable.html | ||
var svgAttributes = { | ||
"about": true, | ||
"accent-height": true, | ||
"accumulate": true, | ||
"additive": true, | ||
"alphabetic": true, | ||
"arabic-form": true, | ||
"ascent": true, | ||
"attributeName": true, | ||
"attributeType": true, | ||
"bandwidth": true, | ||
"baseProfile": true, | ||
"bbox": true, | ||
"begin": true, | ||
"by": true, | ||
"calcMode": true, | ||
"cap-height": true, | ||
"class": true, | ||
"content": true, | ||
"contentScriptType": true, | ||
"cx": true, | ||
"cy": true, | ||
"d": true, | ||
"datatype": true, | ||
"defaultAction": true, | ||
"descent": true, | ||
"dur": true, | ||
"editable": true, | ||
"end": true, | ||
"ev:event": true, | ||
"event": true, | ||
"externalResourcesRequired": true, | ||
"fill": true, | ||
"focusHighlight": true, | ||
"focusable": true, | ||
"font-family": true, | ||
"font-stretch": true, | ||
"font-style": true, | ||
"font-variant": true, | ||
"font-weight": true, | ||
"from": true, | ||
"g1": true, | ||
"g2": true, | ||
"glyph-name": true, | ||
"gradientUnits": true, | ||
"handler": true, | ||
"hanging": true, | ||
"height": true, | ||
"horiz-adv-x": true, | ||
"horiz-origin-x": true, | ||
"id": true, | ||
"ideographic": true, | ||
"initialVisibility": true, | ||
"k": true, | ||
"keyPoints": true, | ||
"keySplines": true, | ||
"keyTimes": true, | ||
"lang": true, | ||
"mathematical": true, | ||
"max": true, | ||
"mediaCharacterEncoding": true, | ||
"mediaContentEncodings": true, | ||
"mediaSize": true, | ||
"mediaTime": true, | ||
"min": true, | ||
"nav-down": true, | ||
"nav-down-left": true, | ||
"nav-down-right": true, | ||
"nav-left": true, | ||
"nav-next": true, | ||
"nav-prev": true, | ||
"nav-right": true, | ||
"nav-up": true, | ||
"nav-up-left": true, | ||
"nav-up-right": true, | ||
"observer": true, | ||
"offset": true, | ||
"origin": true, | ||
"overlay": true, | ||
"overline-position": true, | ||
"overline-thickness": true, | ||
"panose-1": true, | ||
"path": true, | ||
"pathLength": true, | ||
"phase": true, | ||
"playbackOrder": true, | ||
"points": true, | ||
"preserveAspectRatio": true, | ||
"propagate": true, | ||
"property": true, | ||
"r": true, | ||
"rel": true, | ||
"repeatCount": true, | ||
"repeatDur": true, | ||
"requiredExtensions": true, | ||
"requiredFeatures": true, | ||
"requiredFonts": true, | ||
"requiredFormats": true, | ||
"resource": true, | ||
"restart": true, | ||
"rev": true, | ||
"role": true, | ||
"rotate": true, | ||
"rx": true, | ||
"ry": true, | ||
"slope": true, | ||
"snapshotTime": true, | ||
"stemh": true, | ||
"stemv": true, | ||
"strikethrough-position": true, | ||
"strikethrough-thickness": true, | ||
"syncBehavior": true, | ||
"syncBehaviorDefault": true, | ||
"syncMaster": true, | ||
"syncTolerance": true, | ||
"syncToleranceDefault": true, | ||
"systemLanguage": true, | ||
"target": true, | ||
"timelineBegin": true, | ||
"to": true, | ||
"transform": true, | ||
"transformBehavior": true, | ||
"type": true, | ||
"typeof": true, | ||
"u1": true, | ||
"u2": true, | ||
"underline-position": true, | ||
"underline-thickness": true, | ||
"unicode": true, | ||
"unicode-range": true, | ||
"units-per-em": true, | ||
"values": true, | ||
"version": true, | ||
"viewBox": true, | ||
"width": true, | ||
"widths": true, | ||
"x": true, | ||
"x-height": true, | ||
"x1": true, | ||
"x2": true, | ||
"xlink:actuate": true, | ||
"xlink:arcrole": true, | ||
"xlink:href": true, | ||
"xlink:role": true, | ||
"xlink:show": true, | ||
"xlink:title": true, | ||
"xlink:type": true, | ||
"xml:base": true, | ||
"xml:id": true, | ||
"xml:lang": true, | ||
"xml:space": true, | ||
"y": true, | ||
"y1": true, | ||
"y2": true, | ||
"zoomAndPan": true | ||
} | ||
var SVG_NAMESPACE = "http://www.w3.org/2000/svg" | ||
@@ -25,4 +178,2 @@ | ||
// for each key, if attribute & string, bool or number then | ||
// convert it into a setAttribute hook | ||
for (var key in properties) { | ||
@@ -33,3 +184,3 @@ if (!properties.hasOwnProperty(key)) { | ||
if (BLACKLISTED_KEYS[key]) { | ||
if (svgAttributes[key] !== true) { | ||
continue | ||
@@ -36,0 +187,0 @@ } |
@@ -26,2 +26,3 @@ var isArray = require("x-is-array") | ||
var apply = patch[index] | ||
var applyClear = false | ||
@@ -53,16 +54,12 @@ if (isThunk(a) || isThunk(b)) { | ||
} else { | ||
clearState(a, patch, index) | ||
apply = patch[index] | ||
apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b)) | ||
applyClear = true | ||
} | ||
} else { | ||
clearState(a, patch, index) | ||
apply = patch[index] | ||
apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b)) | ||
applyClear = true | ||
} | ||
} else if (isVText(b)) { | ||
if (!isVText(a)) { | ||
clearState(a, patch, index) | ||
apply = patch[index] | ||
apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b)) | ||
applyClear = true | ||
} else if (a.text !== b.text) { | ||
@@ -73,4 +70,3 @@ apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b)) | ||
if (!isWidget(a)) { | ||
clearState(a, patch, index) | ||
apply = patch[index] | ||
applyClear = true; | ||
} | ||
@@ -84,2 +80,6 @@ | ||
} | ||
if (applyClear) { | ||
clearState(a, patch, index) | ||
} | ||
} | ||
@@ -86,0 +86,0 @@ |
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
135369
62
3549
+ Addedis-object@1.0.2(transitive)
- Removedis-object@0.1.2(transitive)
Updatedis-object@^1.0.1