Client-Side Framework lifecycle

Initialization, runtime, type-ahead and rollback are all discussed as part of the Client-Side Framework lifecycle.

Initialization

  1. The bootstrap page is loaded and the user-agent features are stored in a cookie.
  2. The bootstrap loads the start page of the application (using the Bootstrap=done argument).
  3. The Client-Side Framework (CSF) initialize itself when the document markup is loaded (DOMContentLoaded event).
  4. The CSF instantiate a component for each data-g-id found in the document.
  5. The CSF listen for application events.

Runtime

  1. A browser event is caught by a component event listener.
  2. The browser event is transformed and sent to the engine.
  3. The engine send an incremental update to the CSF.
  4. 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();
}