- From: Robbie Speed <notifications@github.com>
- Date: Thu, 27 Mar 2025 22:30:34 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/736/2760233764@github.com>
robbiespeed left a comment (whatwg/dom#736) > Okay. In that case, such a proposal is basically indistinguishable from DOM parts. There are some cosmetic differences in terms of API surface but the fundamental capability of both proposals is a Range-like object which allows you to keep inserting or replacing DOM nodes at a specific location in a DOM tree. No it's very different, interface alignment with Node is one of the major benefits of this proposal. Leaving that aside, from what I can tell DOM Parts still doesn't have the same capabilities, there is no mention of being able to move ChildNodeParts as units, it seems they are meant to be static locations on the parent and Nodes are meant to be moved to and from them. That's not useful to rendering dynamic lists that's items may be Nodes or fragments, the fragments need to be able to swap positions with other nodes or fragments in the rendered list, while also having the ability to add/remove more items. You could technically achieve something like that with parts, but it would require not only creating the nodes to render, but also n parts for each item in the array which would likely be a perf concern. What happens when the list needs to shrink also seems [uncertain](https://github.com/WICG/webcomponents/blob/gh-pages/proposals/DOM-Parts-Imperative.md#childnodepart-after-dom-mutations), either a extra concept of part validity needs to be added or you need to add markers. If you use invisible markers is there even a way to remove/destroy a part? Can invalid parts effectively be GCed? > The one you're advocating is "Proposal A", which is similar to DOM parts. As far as I can tell, most people on this issue are advocating for "Proposal B", which introduces a new node type that can be inserted into an actual DOM tree. I get the opposite sense, the proposal as initial laid out in the first comment here aligns with "Proposal A", and there has been a lot of support for it as is clear by the reactions. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/736#issuecomment-2760233764 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/issues/736/2760233764@github.com>
Received on Friday, 28 March 2025 05:30:38 UTC