Re: [w3c/webcomponents] Template/part proposals should explain how and why they improve performance (#901)

> The low-level API could be something like const { clonedTree, clonedReferences } = clone(subtree, { giveMeReferencesToClonesOfTheseNodes: [node1, node2] }).

In addition to the points raised by @justinfagnani, I think this API isn't that ergonomical to use. The caller is required to provide a list of nodes in the `subtree`. This means the caller needs to know the structure of the subtree. UA also needs to checks each node in the subtree against this node list during the clone process. 

Compare this to the proposed API, `const {node, partGroup} subtree.cloneTree(options);`. Once the subtree has been marked with `parts`, the caller can just clone the subtree and get back a list of `parts` that's ready for update.  

-- 
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/901#issuecomment-718276728

Received on Thursday, 29 October 2020 00:04:39 UTC