Skip to content

Commit 827cc09

Browse files
committed
update to version 0.15.12
1 parent b32f9f3 commit 827cc09

5 files changed

Lines changed: 16 additions & 11 deletions

File tree

dist/react-lite.common.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ function applyUpdate(data) {
102102
}
103103
var vnode = data.vnode;
104104
var newNode = data.node;
105+
106+
// update
105107
if (!data.shouldIgnore) {
106108
if (!vnode.vtype) {
107109
newNode.replaceData(0, newNode.length, data.newVnode);
@@ -114,6 +116,8 @@ function applyUpdate(data) {
114116
newNode = updateVcomponent(vnode, data.newVnode, newNode, data.parentContext);
115117
}
116118
}
119+
120+
// re-order
117121
var currentNode = newNode.parentNode.childNodes[data.index];
118122
if (currentNode !== newNode) {
119123
newNode.parentNode.insertBefore(newNode, currentNode);
@@ -245,9 +249,7 @@ function diffVchildren(patches, vnode, newVnode, node, parentContext) {
245249
if (_vnode === _newVnode) {
246250
var shouldIgnore = true;
247251
if (parentContext) {
248-
if (_vnode.vtype === VELEMENT) {
249-
shouldIgnore = false;
250-
} else if (_vnode.vtype === VCOMPONENT || _vnode.vtype === VSTATELESS) {
252+
if (_vnode.vtype === VCOMPONENT || _vnode.vtype === VSTATELESS) {
251253
if (_vnode.type.contextTypes) {
252254
shouldIgnore = false;
253255
}

dist/react-lite.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@
106106
}
107107
var vnode = data.vnode;
108108
var newNode = data.node;
109+
110+
// update
109111
if (!data.shouldIgnore) {
110112
if (!vnode.vtype) {
111113
newNode.replaceData(0, newNode.length, data.newVnode);
@@ -118,6 +120,8 @@
118120
newNode = updateVcomponent(vnode, data.newVnode, newNode, data.parentContext);
119121
}
120122
}
123+
124+
// re-order
121125
var currentNode = newNode.parentNode.childNodes[data.index];
122126
if (currentNode !== newNode) {
123127
newNode.parentNode.insertBefore(newNode, currentNode);
@@ -249,9 +253,7 @@
249253
if (_vnode === _newVnode) {
250254
var shouldIgnore = true;
251255
if (parentContext) {
252-
if (_vnode.vtype === VELEMENT) {
253-
shouldIgnore = false;
254-
} else if (_vnode.vtype === VCOMPONENT || _vnode.vtype === VSTATELESS) {
256+
if (_vnode.vtype === VCOMPONENT || _vnode.vtype === VSTATELESS) {
255257
if (_vnode.type.contextTypes) {
256258
shouldIgnore = false;
257259
}

dist/react-lite.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-lite.min.js.gz

-5 Bytes
Binary file not shown.

src/virtual-dom.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ function applyUpdate(data) {
9292
}
9393
let vnode = data.vnode
9494
let newNode = data.node
95+
96+
// update
9597
if (!data.shouldIgnore) {
9698
if (!vnode.vtype) {
9799
newNode.replaceData(0, newNode.length, data.newVnode)
@@ -104,6 +106,8 @@ function applyUpdate(data) {
104106
newNode = updateVcomponent(vnode, data.newVnode, newNode, data.parentContext)
105107
}
106108
}
109+
110+
// re-order
107111
let currentNode = newNode.parentNode.childNodes[data.index]
108112
if (currentNode !== newNode) {
109113
newNode.parentNode.insertBefore(newNode, currentNode)
@@ -229,9 +233,7 @@ function diffVchildren(patches, vnode, newVnode, node, parentContext) {
229233
if (vnode === newVnode) {
230234
let shouldIgnore = true
231235
if (parentContext) {
232-
if (vnode.vtype === VELEMENT) {
233-
shouldIgnore = false
234-
} else if (vnode.vtype === VCOMPONENT || vnode.vtype === VSTATELESS) {
236+
if (vnode.vtype === VCOMPONENT || vnode.vtype === VSTATELESS) {
235237
if (vnode.type.contextTypes) {
236238
shouldIgnore = false
237239
}
@@ -306,7 +308,6 @@ function diffVchildren(patches, vnode, newVnode, node, parentContext) {
306308
diffVchildren(patches, item.vnode, item.newVnode, item.node, item.parentContext)
307309
}
308310
}
309-
310311

311312
if (removes) {
312313
patches.removes.push(removes)

0 commit comments

Comments
 (0)