airbnb/rendr — pull request #282 by rcs (2014-02-02 10:04:22+00:00)
Title: View-tech agnostic views, handlebars or ReactJS or others

This extracts some of base/view's functionality into a ViewAdapter, with a goal of making it feasible to use other View producing technologies with rendr. (React.js in my case.) There's an additional class method that all Rendr-view-making-things have to allow, "attachNewInstance", which is what is called from the top level attach to allow a different instantiation and attachment strategy.

BaseView's getHtml and ViewEngine's getViewHtml change to an async style to allow for view technologies that need it.

The viewAdapter is attached to the app instance, which has the side effect of cleaning up plugin code like in airbnb/rendr-handlebars#13 .

ViewAdapter.attach (previously BaseView.attach) has a functionality change. Instead of finding all [data-view] objects and trying to attach them, it finds the top level [data-view] elements inside the given scope.

The handlebars path does become dependent on airbnb/rendr-handlebars#13

--
Filter viewAdapter attach to only handle "top level" data-views, deferring attachment of nested to their own views/
Defer attachment strategy to view's class

Allow optional callback for BaseView getHtml. Use callback for server getViewHtml to allow different viewAdapters to be async.

Remove backbone view dependency on AppView. Add renderInside to view instances for view-tech agnostic rendering.