-
Notifications
You must be signed in to change notification settings - Fork 6
2 Render
Alex Kit edited this page Mar 29, 2015
·
1 revision
To completely understand how components work, it is very importent to understand the render flow, at least the basics. And they are extemely simple.
Mask or Html templates are parsed to Mask AST. Essential nodes and their properties are:
-
NodetagName: Stringattr: Objectnodes: Arrayparent: Node
-
TextNodecontent: String|Functionparent: Node
-
StatementNodetagName: Stringattr: Objectexpression: Stringnodes: Arrayparent: Node
Each render iteration is visiting a node and running appropriate Builder on it. Builder excepts model, context, element and current controller.
📍 If
renderfunction is not overriden, then builder creates a component in 2 stages:
-
renderStart: here the component can redefine its model object, its nodes, etc - Builder creates all the subnodes
-
renderEnd: here the component is already rendered and gets its elements
This note is especially interesting for the NodeJS rendering: while
startis called on the backend, and theendoccures on the frontend.

🏁