Ember-inspector: Making Private/Underscore Properties visible

Created on 8 Dec 2020  路  6Comments  路  Source: emberjs/ember-inspector

Is your feature request related to a problem? Please describe.
I understand Ember Inspector is for the development and Debugging phase. And I am of the opinion that, having access to the private (by convention, underscore prefixed) fields/property is a very useful feature when hunting for problems like why a certain computed property based on other field and property have an unexpected value.

Describe the solution you'd like
Having the private properties visible in the Ember inspector would be a great feature when debugging, especially when other computed property depends on multiple

Describe alternatives you've considered
I tend to make all my field, public (so to say) to be able to test and play around with certain values to profile the behavior of certain parts of the application. In some cases where you have similar property names for internal use, this can lead to confusing which property is meant to be used to pass value to a control. Prefixing everything after debugging is more error prone.

Additional context
I understand I could set breakpoints in the source code, but this can in some cases be very time consuming and cumbersome even more so when a component is used in iteration.

question

Most helpful comment

Yeah, that would be my guess, though I agree it's not a good heuristic. I think we can probably change it.

All 6 comments

@izackhub thanks for taking the time to write this up. I'm not sure I fully understand the issue. Adding an _ to a property should not mean it doesn't show up in inspector. Do you have a concrete example you could share please?

Hi @rwwagner90. Thanks for the quick reply.
My concrete example: Assuming I have an email-input component with 2 properties: value & _internalValue, where value is meant to be passed down and _internalValue is a computed property for internal usage.

Viewed in Ember inspector, only value is visible in the Own Properties section.

I had expected to see _internalValue in the properties listing as well.

NOTE: I am using google chrome browser version 87 and Ember Inspector extension version 4.3.4

@izackhub so you are saying if you rename it to internalValue without the _ it shows up? I wouldn't think we would care about the naming for showing it.

@rwwagner90 yes that is exactly what I'm saying. I searched for a while on the web to see if there is a solution or a deactivated option, until i found this post #152, that is why I decided to open this issue. Is there something I am still missing?

@chancancode any thoughts on this? I'm not sure why we would hide private properties, unless we're trying to reduce the amount of potential noise from internal stuff?

Yeah, that would be my guess, though I agree it's not a good heuristic. I think we can probably change it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stevehanson picture stevehanson  路  9Comments

davidchalifoux picture davidchalifoux  路  3Comments

camskene picture camskene  路  6Comments

EWhite613 picture EWhite613  路  7Comments

ansmonjol picture ansmonjol  路  3Comments