Re: [whatwg/dom] Proposal: a DocumentFragment whose nodes do not get removed once inserted (#736)

FrameMuse left a comment (whatwg/dom#736)

After struggling several months spent brainstorming how I could implement this without patching DOM, something which seemed to be impossible turned out to be pretty easy.

Not everything, but essential parts like "remote attaching" of nodes and "repeated appending of group, moves nodes" was achieved purely in conventional VanillaJS.

I'm not sure if anyone did this before me, so anyway I'm sharing what I did and how did it:
https://github.com/framemuse/node-group

It implements `Group` in the way I'm personally using it, other use-cases could be implemented in future, now I'm into them, so I left them unimplemented. Currently, it's pretty stable and as it's based on DOM patching - I'm using this production environment, so far good enough.

Here's the tests & playground:
https://stackblitz.com/edit/vitejs-vite-cqcbae5t?file=src%2Fmain.ts

---

Despite this (imho pretty successful) implementation, I still want to see something like this being a Web Standard and this is yet another step to prove this is needed. 

It's different from what @WebReflection has implemented, it's not using comments, it uses the aspects I came up with [in this comment](https://github.com/whatwg/dom/issues/736#issuecomment-2804689564).

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

Message ID: <whatwg/dom/issues/736/2989009243@github.com>

Received on Thursday, 19 June 2025 19:45:23 UTC