What are the main benefits of Facebook React in terms of upcoming web components and vice versa (or maybe Apple Polymer would compare apples to apples)?
According to this discussion in the EU and the React homepage, the main benefits of the Reagent are:
- Decoupling and reinforcing traction using a component model.
- Abstraction, composition and expressiveness
- Virtual DOM and Synthetic events (which basically means that they completely redid the DOM and the event system)
- Includes modern HTML5 event events in IE 8
- Server side hole
- Testability
- Bindings to SVG, VML, and
<canvas>
Almost everything mentioned integrates into browsers via web components, with the exception of this virtual DOM concept (obviously). I can see how virtual DOMs and synthetic events can be useful today to support older browsers, but they donβt throw out a huge chunk of the browserβs native code, such as how to shoot yourself in the foot in the long run? As for modern browsers, isn't there so much extra overhead / rethinking the wheel?
Here are some things that I think are missing. Correct me if I am wrong.
- Support for native browser (reading "guaranteed faster")
- Write JavaScript in vanilla JavaScript, write CSS in CSS, write HTML in HTML.
- Style Encapsulation Using Shadow DOM
- React instead has one that requires writing CSS in JavaScript. Not pretty.
- Two-way snapping
javascript html reactjs polymer web-component
CletusW Jan 24 '14 at 20:51 2014-01-24 20:51
source share