Re:The broken promise of Web Components
by acdha on Thursday March 16, 2017 @07:32AM
(#13884154)
Try beating a loop where e.g. every time you get a change you do something like getElementById() + .textContent = newValue. There's no way for React to be faster than that because it has to eventually do the same work but there are many ways for it to be less code, more correct (e.g. by not forgetting to call the update in some cases), or otherwise easier to get to the point where your app can ship.
[ Parent
| on HN ]
Someone has tried beating the loop. And more than a loop, but rather a more real-life-like test rendering multiple components and component trees, sets attributes etc. etc. and you can run it on your own computer in the browser
You can check it out yourself: https://localvoid.github.io/uibench/
I highly recommend the author's article about it: https://medium.com/@localvoid/how-to-win-in-web-framework-be...
Re:The broken promise of Web Components
by localvoid on Thursday March 16, 2017 @09:09PM
(#13890536)
Also, it seems that many people are defending WCs with an argument about interoperability. But in reality, if we start adding components that are using different frameworks, there will be problems with layout thrashing, etc, because there is no standard scheduling APIs, and each framework implements its own scheduler to batch reads and writes https://github.com/ampproject/amphtml/blob/8a76ee942f329179d...