ClientPageRenderer

page/renderer/ClientPageRenderer~ ClientPageRenderer

Client-side page renderer. The renderer attempts to reuse the markup sent by server if possible.

Constructor

new ClientPageRenderer(factory, Helper, ReactDOM, settings, window)

Source:
Initializes the client-side page renderer.
Parameters:
Name Type Description
factory PageRendererFactory Factory for receive $Utils to view.
Helper vendor.$Helper The IMA.js helper methods.
ReactDOM vendor.ReactDOM React framework instance to use to render the page on the client side.
settings Object.<string, *> The application setting for the current application environment.
window Window Helper for manipulating the global object (window) regardless of the client/server-side environment.

Members

_firstTime :boolean

Source:
Flag signalling that the page is being rendered for the first time.
Type:
  • boolean

(nullable) _viewContainer :HTMLElement

Source:
The HTML element containing the current application view for the current route.
Type:
  • HTMLElement

_window :Window

Source:
Helper for manipulating the global object (window) regardless of the client/server-side environment.
Type:
  • Window

Methods

_handleError(error)

Source:
Show error to console in $Debug mode and re-throw that error for other error handler.
Parameters:
Name Type Description
error Error
Throws:
Re-throws the handled error.
Type
Error

_patchPromisesToState(controller, patchedPromises)

Source:
Patch promise values to controller state.
Parameters:
Name Type Description
controller ControllerDecorator
patchedPromises Object.<string, Promise.<*>>

_renderToDOM(controller, view, routeOptions)

Source:
Renders the current route to DOM.
Parameters:
Name Type Description
controller ControllerDecorator
view function
routeOptions Object The current route options.

_separatePromisesAndValues(dataMap) → {Object}

Source:
Separate promises and values from provided data map. Values will be use for default page state. Promises will be patched to state after their resolve.
Parameters:
Name Type Description
dataMap Object.<string, *> A map of data.
Returns:
Return separated promises and other values.
Type
Object

_updateMetaAttributes(metaManager)

Source:
Updates the title and the contents of the meta elements used for SEO.
Parameters:
Name Type Description
metaManager MetaManager meta attributes storage providing the new values for page meta elements and title.

_updateMetaLinkAttributes(metaManager)

Source:
Updates the href of the specialized link elements used for SEO.
Parameters:
Name Type Description
metaManager MetaManager meta attributes storage providing the new values for page meta elements and title.

_updateMetaNameAttributes(metaManager)

Source:
Updates the contents of the generic meta elements used for SEO.
Parameters:
Name Type Description
metaManager MetaManager meta attributes storage providing the new values for page meta elements and title.

_updateMetaPropertyAttributes(metaManager)

Source:
Updates the contents of the specialized meta elements used for SEO.
Parameters:
Name Type Description
metaManager MetaManager meta attributes storage providing the new values for page meta elements and title.

mount()

Source:

unmount()

Source:

update()

Source: