Re: [w3c/webcomponents] Lazy Custom Element Definitions (#782)

@justinfagnani I don't entirely agree, assuming declarative (and hence pre-rendered) shadow DOM happens it would be useful for a pre-renderer to have an API it can target that can forgo even downloading the component unless it actually changes in a meaningful way to the component that the component would want to respond to.

Obviously a pre-renderer could just dump it's own `MutationObserver` into the page but this would be problematic as in order to observe nested shadow trees it'll need to patch `.attachShadow` to observe changes to elements within shadow trees and I don't think a pre-renderer should really be needing to override builtins to be able to give good performance (not to mention it's extra downloaded bytes including the observer but that should be relatively small/negligible).

Having a primitive like that as part of the platform would be great because it means you only pay download costs when you actually need to modify the element rather than unconditionally loading parts of every single component that need to repeat the same logic in potentially many different files.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/782#issuecomment-484405156

Received on Thursday, 18 April 2019 08:27:31 UTC