Re: [whatwg/dom] Declarative Shadow DOM (#831)

> @mfreed7 Have you given any thought as to how streaming can work with declarative shadow DOM? I've used different techniques like in your [proposal repo](https://github.com/mfreed7/declarative-shadow-dom) and the problem I always ran into is that if a big chunk of HTML is inside of templates then the user will not see them until the ending template tag. When using the common technique of having a single root component for your entire app, that means not painting until all HTML is parsed. That's unfortunate. That doesn't mean this doesn't still work well for smaller DOM trees.
> 
> Would it be possible to start inserting into the shadow root sooner than the closing template tag?
> 
> edit: Looks like you do discuss streaming implications here: https://github.com/mfreed7/declarative-shadow-dom#timing-attach-the-shadow-on-opening-or-closing-template-tag

Thanks for the comment! Yes, as you mention, I did discuss this in the explainer, and I agree with you that streaming is not well supported by the current proposal. However, the reasons I settled on this side of the line are:
 - implementation complexity is significantly higher with streaming supported. This (complexity) was  was the prior **blocker** to declarative Shadow DOM moving forward.
 - a streaming version of declarative Shadow DOM could always be added later, e.g. `<template shadowroot=open streaming>`, if desired. Given the complexity pushback before, I'd prefer to make this a "phase 2" feature, if possible.

What do you think?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/831#issuecomment-634225656

Received on Tuesday, 26 May 2020 19:20:12 UTC