Architecture Overview
NOTE: For now, this document applies to the refactor on the component-refactor
branch.
-
A
BuildEnv
keeps track of the components involved the Build->Render cycle. The cycle starts with a "root" component, on which aBuild
method is called, passing it aBuildEnv
instance. This method returns the virtual DOM corresponding to this root component in its current state, and methods on BuildEnv are used to track the lifecycle of instances of child components. -
The
Builder
interface has a single methodBuild
which is implemented by a component and returns it's "virtual DOM" (represented byvugu.VGNode
et al) -
A
Renderer
is responsible for synchronizing a virtual DOM with its target output.JSRenderer
performs synchronization with the browser DOM. Where asStaticHTMLRenderer
will output the virtual DOM as a string for use in "server-side rendering", static website output, etc.