2

Just to add a little of background why it is needed: The Chrome Lightning inspector shows performance graphs and component tree. Component names are equal to what "toString()" method returns. If for example component ConcreteCmp extends BaseCmp - lightning inspector will refer it as BaseCmp, or the top-most component in hierarchy. The graph looks like tons of components of the same type. Difficult to distinguish which one took long to render and which ones are OK.

Question: Is there a way to override the value returned by toString() method?

Maybe tere is some special hidden attribute or javascript way to tell component to identify itself with particular string.

2

The Inspector should be showing the component definition descriptor. Overriding toString won't help you.

For the performance tab, both inheritance and consumption should be showing up.

In your example, you should see

[Concrete Cmp           ]
    [ Base Cmp          ]
       [ Work insde Base]

So both should be showing up so you can see the work required for your entire component.

| improve this answer | |
  • You are right. For declarative it works just fine. My case is a bit trickier i use dynamic creation of component with createComponents method. In addition to that i use another facet then {!v.body}, this could be the reason why inspector tool does not recognize the components. – Pavlonator Nov 3 '16 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.