emberjs/ember.js — pull request #836 by trek (2012-05-18 20:52:12+00:00)
Title: Refactors View rendering into Ember.States

Some points of discussion:

* As with ember-data and states there is a single state chart for Ember.View and one for Ember.ContainerView.

* Each instance of View gets its own instance of a StateManager with the `view` property set to the View instance.

* The state managers for View/ContainerView override `send` and `sendRecursively` so the various method arguments for views can remain communicative . The rendering managers don't fit well into the current general state manager paradigm – they're more message forwarding than dealing with context. Two options moving forward are to a) stash all the arguments for State methods into a "context" (although "context" won't be the right term anymore) or change the general state manager behavior to support arbitrary argument forwarding. My preference is to allow for a message-forwarding style send.

* In view destroying I'm calling `goToState` from outside a state object. There should probably be an action, but my inclination was to call it `destroy` and I don't know how that will interact with the Ember object lifecycle.

* All the various state classes are marked private.