5. HTML DOM
● Document Object Model
● Constructed by browser when page is loaded
● JavaScript gets all the power to create dynamic HTML
5
6. HTML DOM
● Document Object Model
● Constructed by browser when page is loaded
● JavaScript gets all the power to create dynamic HTML
6
http://www.w3schools.com/js/js_htmldom.asp
7. Virtual DOM
● Pure JavaScript (JavaScript Object)
● render() to create real DOM
● Modify real DOM when something changes
7
17. When we were “children”
17
With Version Control
What we’ve done
--- with a project named “BreakOut”
BreakOutVer1
BreakOutVer2
BreakOutVer3
BreakOutFinal
BreakOutFinal2
18. DIFF ALGORITHM
Generate a list of DOM mutation
O(n)
http://facebook.github.io/react/docs/reconciliation.html
18
19. Re-rendering process
1. Build new virtual DOM subtree
2. Diff with the old one
3. Compute the minimal set of DOM mutations
4. Batch execute all update
19