Initialization, runtime, type-ahead and rollback are all discussed as part of the
Client-Side Framework lifecycle.
Initialization
- The bootstrap page is loaded and the user-agent features are stored in a cookie.
- The bootstrap loads the start page of the application (using the Bootstrap=done
argument).
- The Client-Side Framework (CSF) initialize itself when the document markup is loaded
(DOMContentLoaded event).
- The CSF instantiate a component for each data-g-id found in the document.
- The CSF listen for application events.
Runtime
- A browser event is caught by a component event listener.
- The browser event is transformed and sent to the engine.
- The engine send an incremental update to the CSF.
- The CSF update the document according the engine response.
Type-ahead and rollback
In order to be efficient over high latency networks, the CSF has a basic knowledge about how to
process locally events intended to the engine. If the local operation fail, the CSF rollbacks the
last actions by calling
dialog.rollback of each involved component in order to get
in sync with the server
state.
this.dialog.rollback = function() {
myRestoreThePreviousValue();
}