- From: Albert Marashi <notifications@github.com>
- Date: Mon, 24 Mar 2025 08:36:35 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/736/2748553916@github.com>
AlbertMarashi left a comment (whatwg/dom#736) > [@FrameMuse](https://github.com/FrameMuse) the summary is here [#736 (comment)](https://github.com/whatwg/dom/issues/736#issuecomment-2481544529) ... we need a `#shadow-root` like node for persistent fragments that: > > * does not affect CSS selectors, so that `nth-child` works ignoring those nodes (differently from SD) > > * does not affect `childNodes` or `children` as it's meant to be transparent (differently from SD) > > * boundaries cannot be queried or removed by libraries > > * libraries can still grab inner nodes and move these elsewhere, TBD what happens once you move again the persistent fragment ... did it lose its content? should it carry it around? > > * does not infer with events bubbling (or capturing) ... (differently from SD) > > > It's going to be a whole new beast that would require a lot of internals hacking to get it right, it's way easier to ignore it's needed by all means and solved by user-land anyway ... so this is the current state, in few words. This is fairly spot on, I'd also note that we'd want something that works with server-side rendering use-cases. We often use fragment nodes for things like conditional rendering logic inside of frameworks, and being able to send these nodes as parseable HTML content (eg: `<#>` and `</#>` to the browser so that they can be later be used for mounting instead of comments. I might push back on the idea that fragment nodes should not appear inside of `childNodes`, since things like comments appear in those. If not, then there would need to be an API that allows us to traverse child nodes, including fragments (otherwise how else would we discover them) -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/736#issuecomment-2748553916 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/dom/issues/736/2748553916@github.com>
Received on Monday, 24 March 2025 15:36:39 UTC