tildeio/htmlbars — pull request #66 by mixonic (2014-07-05 03:19:24+00:00)
Title: Morphs are now always created via a dom helper. Add node based create

I took a stab at updating metal-views:

https://github.com/mixonic/ember.js/compare/emberjs:metal-views...mixonic:metal-views-update-to-master

Felt some serious pain from the fact that although htmlbars only uses offset based morph creation, the metal code uses the raw elements. Thus we introduce two ways to create a morph:

```JavaScript
var morphViaElement = dom.createMorph(parent, startEl, endEl /*, contextualElement */);
var morphViaOffset = dom.createMorphAt(parent, startIndex, endIndex /*, contextualElement */);
```

The `contextualElement` is optional. `parent` is used as context if one is not provided explicitly. Just be sure you aren't providing a `parent` that is not an element (such as a fragment) without providing a contextual element.

These chages should mean most code consuming the morph package no longer needs to access the `Morph` class directly. They will only access `DOMHelper`.

/cc @krisselden @mmun