Rendering LifeCycle
1. The
init
event is fired by the component service that constructs the components to signal that initialization has completed.
2. For each component in the tree, the base implementation of
render()
or your custom renderer is called to start component rendering.
3. Once your components are rendered to the DOM,
afterRender()
is called to signal that rendering is completed for each of these component definitions.
4. To indicate that the client is done waiting for a response to the server request XHR, the
aura:doneWaiting
event is fired.
5. The framework fires a
render
event, enabling you to interact with the DOM tree after the framework’s rendering service has inserted DOM elements. Handling the render event is preferred to creating a custom renderer and overriding
afterRender()
.
6. Finally, the
aura:doneRendering
event is fired at the end of the rendering lifecycle.
Salesforce doesn't recommend using the legacy aura:waiting, aura:doneWaiting, and aura:doneRendering application events except as a last resort. The aura:waiting and aura:doneWaiting application events are fired for every batched server request, even for requests from other components in your app.
References:
https://developer.salesforce.com/blogs/developer-relations/2015/06/understanding-system-events-lightning-components-part-1.html
https://developer.salesforce.com/blogs/developer-relations/2015/06/understanding-system-events-lightning-components-part-2.html