Message from JavaScript talks

July 2017

— How does yours work?

— 

It does no data monitoring. It injects data into a clone of a document fragment, then clones it again into a live element in the DOM

— So 3 clones in total

— When does it clone the document fragment into the real DOM?

— One being the cached blank template fragment, the next being the populated nonlive fragment, the next being the live inserted one

Message permanent page

— You could very well transfer the nodes of the populated fragment directly too, but I decided to make it one way and clone instead

Message permanent page

— As a final step

— So data change => 3 clones, 1 DOM manipulation

— Then it returns an array of live nodes which were inserted

— Correct

— What if I fetch some JSON that modifies 100 document fragments

— And the data change handler is the user code, not in the engine