Virtual DOM Diffing Algorithm Demonstration Project


All of these vDOM comparisons are being made in the moment by a simplified recreation of the virtual DOM diffing algorithm (link to source code below).

A virtual DOM Node is a POJO (Plain Old Javascript Object) containing a few pieces of key information:
  1. Type: The type of HTML element being represented
  2. Props: HTML attributes or React data being passed into element
  3. Children: (Key in Props object) An array of vDOM nodes nested in the element
  4. Key: Used to distinguish vDOM nodes in lists (not used by HTML)
  5. Ref: A pointer to the corresponding HTML DOM Node
  6. $$typeof: (Not used in my version) React.js uses this to protect against malicious user input

Original

Todo List

Modified Content

Todo List

Inserted Elements

Todo List

Deleted Elements

Todo List

Combination of Changes

New Todo List