These are chat archives for ractivejs/ractive

Aug 2017
Aug 02 2017 17:14

Doing some research on diff-style vdom frameworks, and a common approach to re-rendering is to actually destroy nodes when it doesn't match the new tree. I assume Ractive doesn't do this.

For instance, when a new child is inserted before an existing child, frameworks would replace the existing child with the new child, and recreate what used to be the existing child after it (or at least that's how I understand the process). How does Ractive do this? Does it tell the existing element to just scoot over? The template would look like:

<div>{{#if foo }}<i>Hello</i>{{/if}}<i>World</i></div>
Chris Reeves
Aug 02 2017 17:24
Yep, when the section renders, it asks its parent for an anchor to insert before. If none is available, it appends.
Aug 02 2017 17:28