Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To clear my understanding of your first statement, you're saying that their "lightweight / low memory" claim is invalidated by components having one unnecessary level of nesting in DOM?


No. They’re saying that it’s creating an entirely separate DOM tree unnecessarily by using shadow DOM where it isn’t needed.

On a related note, I’m curious if anyone has a benchmark comparing performance and memory consumption when attaching a shadow root vs not.


It's more than one unnecessary level of nesting in the DOM, it's that they're creating an entirely separate DOM tree they aren't using. I threw together a test using tachometer to demonstrate the differences: https://github.com/jjcm/shadowTests

The results are here: https://raw.githubusercontent.com/jjcm/shadowTests/master/re...

TL;DR - the withShadow element takes about twice as long to render as the withoutShadow element. Don't use them unnecessarily.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: