CKAnalyticsListener Protocol Reference

Conforms to NSObject
Declared in CKAnalyticsListener.h

Overview

This protocol is being used by the infrastructure to collect data about the component tree life cycle.

– willBuildComponentTreeWithScopeRoot:buildTrigger:stateUpdates: required method

Called before the component tree creation.

- (void)willBuildComponentTreeWithScopeRoot:(CKComponentScopeRoot *)scopeRoot buildTrigger:(CKBuildTrigger)buildTrigger stateUpdates:(const CKComponentStateUpdateMap &)stateUpdates

Parameters

scopeRoot

Scope root for component tree. Use that to identify tree between will/didBuild.

buildTrigger

The build trigger (state update or props updates) for this component tree creation.

stateUpdates

The state updates map for the component tree creation.

Declared In

CKAnalyticsListener.h

– didBuildComponentTreeWithScopeRoot:buildTrigger:stateUpdates:component:boundsAnimation: required method

Called after the component tree creation.

- (void)didBuildComponentTreeWithScopeRoot:(CKComponentScopeRoot *)scopeRoot buildTrigger:(CKBuildTrigger)buildTrigger stateUpdates:(const CKComponentStateUpdateMap &)stateUpdates component:(CKComponent *)component boundsAnimation:(const CKComponentBoundsAnimation &)boundsAnimation

Parameters

scopeRoot

Scope root for component tree. Use that to identify tree between will/didBuild

buildTrigger

The build trigger (state update or props updates) for this component tree creation.

stateUpdates

The state updates map for the component tree creation.

component

Root component for created tree

Declared In

CKAnalyticsListener.h

– willLayoutComponentTreeWithRootComponent:buildTrigger: required method

Called before component tree layout.

- (void)willLayoutComponentTreeWithRootComponent:(id<CKMountable>)component buildTrigger:(CK : : Optional<CKBuildTrigger>)buildTrigger

Parameters

component

The root component that was laid out.

buildTrigger

The build trigger that caused the layout computation Can be CK::none, in case that the layout was computed due to a re-layout measurment.

Discussion

Please not that this callback can be called on the same component from different threads in undefined order, for instance: ThreadA, willLayout Component1 ThreadB, willLayout Component1 ThreadA, didLayout Component1 ThreadB, didLayout Component1 To identify matching will/didLayout events between callbacks, please use Thread id and Component id

Declared In

CKAnalyticsListener.h

– didLayoutComponentTreeWithRootComponent: required method

Called after component tree layout.

- (void)didLayoutComponentTreeWithRootComponent:(id<CKMountable>)component

Parameters

component

The root component that was laid out.

Discussion

Please not that this callback can be called on the same component from different threads in undefined order, for instance: ThreadA, willLayout Component1 ThreadB, willLayout Component1 ThreadA, didLayout Component1 ThreadB, didLayout Component1 To identify matching will/didLayout events between callbacks, please use Thread id and Component id

Declared In

CKAnalyticsListener.h

– willMountComponentTreeWithRootComponent: required method

Called before/after mounting a component tree

- (void)willMountComponentTreeWithRootComponent:(id<CKMountable>)component

Parameters

component

Root component for mounted tree

Declared In

CKAnalyticsListener.h

– shouldCollectMountInformationForRootComponent: required method

Called before mounting a component tree.

- (BOOL)shouldCollectMountInformationForRootComponent:(id<CKMountable>)component

Discussion

If returns YES, an extra information will be collected during the mount process. The extra information will be provided back in didMountComponentTreeWithRootComponent callback.

Declared In

CKAnalyticsListener.h

– willCollectAnimationsFromComponentTreeWithRootComponent: required method

Called before/after collecting animations from a component tree.

- (void)willCollectAnimationsFromComponentTreeWithRootComponent:(id<CKMountable>)component

Parameters

component

Root component for the tree that is about to be mounted.

Declared In

CKAnalyticsListener.h

– didReuseNode:inScopeRoot:fromPreviousScopeRoot: required method

Called after a component tree’s node has been reused

- (void)didReuseNode:(id<CKTreeNodeProtocol>)node inScopeRoot:(CKComponentScopeRoot *)scopeRoot fromPreviousScopeRoot:(CKComponentScopeRoot *)previousScopeRoot

Parameters

node

The tree node that has been reused.

scopeRoot

Scope root for component tree.

previousScopeRoot

The previous scope root of the component tree

Discussion

Warning: A node is only reused if conforming to the render protocol.

Declared In

CKAnalyticsListener.h

– systraceListener required method

Provides a systrace listener. Can be nil if systrace is not enabled.

- (id<CKSystraceListener>)systraceListener

Declared In

CKAnalyticsListener.h

– shouldCollectTreeNodeCreationInformation: required method

If returns true, didBuildTreeNodeForPrecomputedChild will be called for non-render component during the component tree creation.

- (BOOL)shouldCollectTreeNodeCreationInformation:(CKComponentScopeRoot *)scopeRoot

Declared In

CKAnalyticsListener.h

– didBuildTreeNodeForPrecomputedChild:node:parent:params:parentHasStateUpdate: required method

Will be called for every component with pre-computed child (CKCompositeComponent for example) during the component tree creation.

- (void)didBuildTreeNodeForPrecomputedChild:(id<CKTreeNodeComponentProtocol>)component node:(id<CKTreeNodeProtocol>)node parent:(id<CKTreeNodeWithChildrenProtocol>)parent params:(const CKBuildComponentTreeParams &)params parentHasStateUpdate:(BOOL)parentHasStateUpdate

Declared In

CKAnalyticsListener.h