4 ms·
It’s advertised as having a Virtual DOM.
by yuchi 12y ago
It’s advertised as having a Virtual DOM.
- deleted 12y ago[deleted]
- otikik 12y agoYou are right, I will have to investigate more. I don't know how much of react's virtual dom diff can you cram in 2.5kb though :)
- tipiirai 12y agoNot much. The point is that such heavy diffing can be avoided if loops and conditionals are enough and if you don't need random HTML changes.
- deleted 12y ago[deleted]
- masklinn 12y agoOnce you have loops, conditionals and recursion, don't you have "random HTML changes"?
- tipiirai 12y agoExactly. Loops and conditionals should give you enough power. But in React you can arbitrarily change HTML because the render method returns a string to be compared to the earlier situation. A tag name can change for example (which you rarely need).
- masklinn 12y ago> But in React you can arbitrarily change HTML because the render method returns a string to be compared to the earlier situation. I'm pretty sure the render method returns a vdom node (which the library can then diff and merge into the actual DOM)
- masklinn 12y agoAs a point of reference, virtual-dom is 17k when minified with the same settings and 5.8k when gzipped. That's starting from the 42k 1.2.0 distfile.