Hacker News new | ask | show | jobs
by blattimwind 2887 days ago
An isomorphic virtual DOM is much like an inverted-index homomorphic shadow DOM, but instead of using a shadowed mapping they virtualize the original elements themselves.
4 comments

I'm not sure if you are you are fucking with me or if i'm just ery stupid.... :(
AFAIK he's fucking with you ^^
Yup. Otherwise he's basically talking about a structure-preserving index that maps DOM elements - that are rendered outside the main document DOM tree - to a file.

And that's not really what's going on here.

I think they asked for an ELI5 not an ELIPhD. :P

I don't think many would understand what an inverted-index homomorphic shadow DOM is, though I think I can cobble together a very very vague understanding.

Can someone ELI5 what an inverted-index homomorphic shadow DOM is? TIA
In a regular DOM there's just a tree of elements, this makes many operations tedious, e.g. finding elements with a given set of classes and so on. So with an inverted-index shadow DOM you get another DOM with element shadows and an index of element properties back to the shadow elements (making it an inverted index). Then simple boolean retrieval can be used instead of DOM traversal. Much more efficient. The actual reason why you want to use shadowing instead of direct-mapped nodes/elements is shadowing enabling E2C (element change coalescing) meaning instead of shadow element changes directly transferring over to a change of the actual DOM element you can batch changes on shadow elements together and change a bunch of DOM elements in one go, which avoids unpartitioned (and therefore wasteful) re-renders by the browser engine.
damn, this sounds awesome, specially the part about batching renders, much like 'vsync' but for DOM.

thank you for the info!

(Ok, before anyone goes running off telling their colleagues about this great new tech: I literally made all of this up on the fly except the batching stuff. That's actually one of two reasons why this whole shadow-DOM-stuff exists. The other is encapsulation. I think this whole thread is a most beautiful demonstration of Poe's law in its original form.)
This is brilliant. Your first comment had me laughing; your second had me second-guessing myself.

I think I have some new tech to tell my coworkers about. >;)

I thought Shadow DOM only provides encapsulation??
I think "shadow-DOM-stuff" refers to the concept of virtual DOMs. The shadow DOM isn't really a virtual DOM though, sure. It's just encapsulated parts of the regular old DOM.
This is not ELI5
Trolling 5 year olds is a long established tradition.

http://www.s-anand.net/blog/calvin-and-hobbes-dad-explains-s...

> An isomorphic virtual DOM is much like an inverted-index homomorphic shadow DOM, but instead of using a shadowed mapping they virtualize the original elements themselves.

Not sure if this is ironic, but a 5 year old definitely wouldn't understand this!

Given software/computers are part of curriculum now, i would not be surprised if we have some five year old already understanding this.