Re:Material UI
by colinramsay on Monday November 10, 2014 @06:35AM
(#8583010)
Is this correct? React doesn't use the virtual DOM to create HTML-like elements, it uses JSX for that, and JSX is optional. As far as I know the virtual DOM is used to avoid updating the "real" DOM in the browser when you don't have to.
Re:Material UI
by marknutter on Monday November 10, 2014 @08:20AM
(#8583319)
React does use a virtual DOM, namely so that it can efficiently track changes to the DOM. That's different than the shadow DOM that web components use, though, where they have their own sandboxed DOM that's completely isolated from the parent DOM.
Indeed. That's what i try to say. I think the knowledge regarding the shadow-dom and true standards-based web-components is not widely spread yet among devvers.
Re:Material UI
by colinramsay on Monday November 10, 2014 @11:08AM
(#8584312)
Your first sentence is pretty much just a shorter version of what I said in my comment! The shadow DOM and React's virtual DOM are completely unconnected.
Can't vote this comment down (not enough karma?), but I would.
React is great library, it is not very constructive to call it a hack just because webcomponents are there.
I'm not saying React is a hack. I'm saying that all libraries that try to provide true "web components" that hide their implementation details for the user, are only achievable trough a "shadow dom" implementation in the browser.
Thats just a fact, based on how browser work. With the shadow-dom, customer elements, and templating you can achieve true componenets, like in uix toolkits such as Android, iOS and Java Swing.
React is using "virtual dom" which is kind of a hack to support web-components kind-of technology. Since the technology is currently here, i would recommend using it, and not using React.
However a consideration is also browser support. I'm not sure if polymer is production ready.