Code review comment for lp:~bcsaller/juju-gui/framework-docs

Revision history for this message
Benjamin Saller (bcsaller) wrote :

https://codereview.appspot.com/6858085/diff/1/docs/d3-component-framework.rst
File docs/d3-component-framework.rst (right):

https://codereview.appspot.com/6858085/diff/1/docs/d3-component-framework.rst#newcode67
docs/d3-component-framework.rst:67: section on events below).
On 2012/11/28 14:10:29, gary.poster wrote:
> In terms of the framework itself, I wonder if the first render should
not call
> the normal render behavior. In other words, it should renderOnce and
then update
> and then stop.

> In fact, if update is supposed to be about incremental updates, and
renderOnce
> is about preparing for an update, then the render method seems
superfluous. The
> pattern that seems to be falling out to me is this: when you call
render on a
> component, it calls render on a module, and then it calls update on a
module.
> You never have to call render on the module again. Effectively,
renderOnce
> become render, and the current render disappears. This seems is
simpler and
> sufficient. If it is not sufficient, then my understanding is
insufficient, and
> we might need some more explanation here of some sort.

These are good ideas. There are some special cases where render might be
called more than once (detach/re-attach to DOM for example) which I've
added to the doc. Its also nice for modules to be assured that things
like the svg element will be present on the container (via its
renderOnce) so that when each modules render is called they can draw
reliably without lots of extra checks. I've expanded this section to
indicate this (I hope clearly).

https://codereview.appspot.com/6858085/

« Back to merge proposal