walmartlabs/thorax — pull request #113 by eastridge (2013-02-08 23:42:18+00:00)
Title: Remove inline compilation of templates

Remove inline compilation of templates via passing a string `template` attribute to a `Thorax.View` instance. Inline templates would now be declared as:

new Thorax.View({template: Handlebars.compile(...)})

Reasons for this change include:

- consistent behavior between `template`, `itemTemplate`, and `emptyTemplate`. `template` was allowed to be an inline template string while the others would be template names
- consistency of feature availability of the feature between environments
- lack of usage in real world projects (only used in examples and tests, even boilerplate projects do not use)
- smaller code size / fewer logic paths

Additional related changes in this PR:

- template assignment now unified into an `assignTemplate` function
- `CollectionView` now properly enforces presence of `itemTemplate`. Was marked as optional in `CollectionHelperView` when should only be required if `itemView` is not present.
- remove duplicated logic in `renderTemplate`

Tested in asda and phoenix, no impact.