Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The definitive guide to front-end rendering

The definitive guide to front-end rendering

Actually only a 5 minute guide to front-end rendering. Presented at Web Directions What Do You Know 2015.

Ivan Vanderbyl

September 03, 2015
Tweet

More Decks by Ivan Vanderbyl

Other Decks in Technology

Transcript

  1. // Ivan’s todo list. <ul> <li class="item">Write talk</li> <li class="item">Prepare

    Slides</li> <li class="item">Tech Rehearsal</li> </ul>
  2. // Ivan’s todo list. <ul> <li class="item done">Write talk</li> <li

    class="item">Prepare Slides</li> <li class="item">Tech Rehearsal</li> </ul>
  3. let ul = document.getElementById(“todo-list-ivan”); ul.innerHTML = ` <li class="item">Write Talk</li>

    <li class="item">Prepare Slides</li> <li class="item">Tech Rehearsal</li>`; let ul = document.getElementById(“todo-list-ivan”); ul.innerHTML = ` <li class="item done">Write Talk</li> <li class="item">Prepare Slides</li>`; Update 1: Update 2:
  4. <li class="item">999 Beers on the wall</li> <li class="item">998 Beers on

    the wall</li> <li class="item">997 Beers on the wall</li> <li class="item">996 Beers on the wall</li> <li class="item">995 Beers on the wall</li> <li class="item">994 Beers on the wall</li> <li class="item">993 Beers on the wall</li> <li class="item">992 Beers on the wall</li> <li class="item">991 Beers on the wall</li> <li class="item">990 Beers on the wall</li> <li class="item">989 Beers on the wall</li> <li class="item">988 Beers on the wall</li> <li class="item">987 Beers on the wall</li> <li class="item">986 Beers on the wall</li> <li class="item">985 Bears on the wall</li> <li class="item">984 Beers on the wall</li> <li class="item">983 Beers on the wall</li> <li class="item">982 Beers on the wall</li> This doesn’t scale Got 1000+ items? Have fun with that.
  5. <ul> <li class="item">Write talk</li> <li class="item">Prepare Slides</li> <li class="item">Tech Rehearsal</li>

    </ul> <ul> <li class="item done">Write talk</li> <li class="item">Prepare Slides</li> </ul> Real DOM Virtual DOM
  6. <ul> <li class="item done">Write talk</li> <li class="item">Prepare Slides</li> </ul> <ul>

    <li class="item">Write talk</li> <li class="item">Prepare Slides</li> <li class="item">Tech Rehearsal</li> </ul> let changes = [];
  7. <ul> <li class="item">Write talk</li> <li class="item">Prepare Slides</li> <li class="item">Tech Rehearsal</li>

    </ul> <ul> <li class="item done">Write talk</li> <li class="item">Prepare Slides</li> </ul> let changes = [];
  8. <ul> <li class="item done">Write talk</li> <li class="item">Prepare Slides</li> </ul> <ul>

    <li class="item">Write talk</li> <li class="item">Prepare Slides</li> <li class="item">Tech Rehearsal</li> </ul> let changes = [ {op: “add-class”, value: “done”, location: “ul>li:nth-child(1)”} ];
  9. let changes = [ {op: “add-class”, value: “done”, location: “ul>li:nth-child(1)”},

    {op: “remove-node”, value: null, location: “ul>li:nth-child(3)”} ]; applyChanges(changes) { changes.forEach(({op,value,location}) => { … }); }