64 ms·
I'm not an expert on either, but my understanding was that Vue's advantage over React was that since it had no virtual DOM you were free to manipulate the DOM m
by disease 10y ago
I'm not an expert on either, but my understanding was that Vue's advantage over React was that since it had no virtual DOM you were free to manipulate the DOM more freely without running into trouble. Now that Vue has its own virtual DOM it is harder for me to see the difference from React. Many of the positives listed both here and on the Vue site could also be said about Knockout, which I still am currently using at the moment (though I'm likely moving to React soon).
- redrummr 10y agoOh, it has proper Virtual DOM now? I'll have to check it out. We've been using React for a Web app that needs to render and completely re-render (new columns etc.) lots of data - no hot updates - Vue was frustratingly slow (5-10 seconds), to the point where we initially had to use an isolated vdom solution (Snabbdom) that became messy fast. React is amazing, so not sure if we'll end up going back to Vue for anything data-driven (tabular).
- EvanYou 10y agoVue 2.0's vdom is actually forked from snabbdom ;) In particular if you don't need hot updates, adding Object.freeze() to your data will make the rendering 2x faster than React.
- EvanYou 10y agoKnockout's perf on large re-renders is below average: http://mathieuancelin.github.io/js-repaint-perfs/knockout/ http://mathieuancelin.github.io/js-repaint-perfs/knockout/ It also doesn't allow you to use programmatic render functions, nor does it have server-side rendering. Vue 2.0's vdom implementation is mutation resistant - as long as you don't replace the element directly controlled by Vue (same as 1.0), the rendering will not run into problems. If you are really concerned you can always create a custom component that returns an empty element so that you can do arbitrary manipulations inside.
- nightski 10y agoThat's exactly why I am switching away from Knockout. I loved every minute of it, but there are features I simply can't deliver on because the perf is too low. There are all sorts of hacks I could do to get around it but that is really going to slow me down. TBH It's not really the rendering that is slow in my experience. It's the fact that every binding attaches an event handler to the DOM. This can take up to 10s for a reasonably sized grid in IE.