-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ember inspector fails to inspect certain components #999
Comments
@AbhinavVishak What version of Ember are you on? |
@rwwagner90 I'm running |
I'm guessing that since the computed property is being set through an 3rd party addon |
@AbhinavVishak would it be possible to share your code or create a small reproduction? |
I tried creating a simple hello-world program for ember-redux, and was able to reproduce it. import Component from '@ember/component';
import { connect } from 'ember-redux';
const stateToComputed = (state) => ({
computedField: 'hardcoded'
});
const Qwerty = Component.extend({
});
export default connect(stateToComputed)(Qwerty); <h2>foo</h2>
<h3>{{computedField}}</h3> |
Object.keys(props).forEach(key => {
defineProperty(this, key, computedReduxProperty(key, () => props))
}); I extracted out the Digging into propertyDesc = desc(obj, keyName, undefined, meta);
Object.defineProperty(obj, keyName, propertyDesc); The inspector searches with |
@AbhinavVishak thanks for the details! @pzuraq @rwjblue do you guys know if anything around this changed recently or is inspector using the wrong thing in general? |
I think the issue here is that I think this is something that |
I was able to trigger this same problem without redux, I think the root cause is import Component from '@ember/component';
import { computed, defineProperty } from '@ember/object';
const MyComp = Component.extend({
init() {
this._super(...arguments);
defineProperty(this, 'computedProp2', computed('dependentProp', function() {
return this.get('computedProp')+1
}));
},
dependentProp: 1,
computedProp: computed('dependentProp', function() {
return this.get('dependentProp')+1
})
});
export default MyComp; |
Yup, so that confirms it. It works with mixins because mixins still have the computed properties themselves, but doesn't work with the final, defined properties. What would probably be a good idea would be to crawl the mixins to get the list of properties to lookup, but then only use |
It looks like when the inspector tries to figure out the computed property's dependent keys, it fails.
I think it might be related to my use of
ember-redux
and connect'sstateToComputed
paradigm.I tried following through the code and it looks like the
descriptorForDecorator
call inember-inspector/ember_debug/utils/type-check.js
Line 33 in aede612
The text was updated successfully, but these errors were encountered: