-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
ability to add logging info when binding to non-existent properties #30
Comments
related to #23 |
maybe it would also be useful to log when dirty-checking is used in a browser with O.o support. |
this came up in the gitter again today: https://gitter.im/Aurelia/Discuss?at=55140f63c25916c13d35183d |
I tried to look into this but got stuck at adding logging to I changed the code there to inject the logger (similar to how it's done in other places)
and updated
why is that? Am I missing anything, or it's really necessary to update the main |
Hey- thanks for looking a this, you're on the right track. What you're running into is aurelia/binding doesn't have a dependency on aurelia/logging yet. You'd need to `jspm install aurelia-logging' (which would add the entries in config.js). config.js is typically maintained by jspm, usually you don't need to hand edit it. The logging code might go higher up, in the |
Thanks for the explanations! Didn't realize I'm quite new to all this so will need some more guidance. Can you look at my commit https://github.com/andreister/binding/commit/f616ec88494f22bf82e9a6b42b1e7fffc6a26f28 and see if it's close? I'm not sure about your "...should be configurable...", what kind of configuration do you mean? I see |
Adding property existence checks in AccessScope, AccessMember, CallScope, CallMember could be bad news for performance, especially with AccessScope's ability to find props on the ancestor scopes. |
Is there some way that we could have a debug mode...where when it is turned on the AST parsing substitutes different debug mode AST instances perhaps? Just thinking out loud here... |
Sounds like a good idea to me. Will need to make sure the test coverage is beefed up in those areas. I think we could modify some of the existing AST tests to enable reuse between AccessScope and "DebugAccessScope" if that's the way we go about implementing this feature. |
Sounds good. It would be nice to have something like this. We'll have to consider how it should be configured for debug mode. We may need to put a setting on the BindingEngine and then somehow surface that through the Aurelia FrameworkConfiguration object. |
The configuration piece will be important to nail down for #205 as well |
Good point. |
@jdanyow @EisenbergEffect Can we simplify it down to this line When we try to do everything in // Instead of
// return new SetterObserver(this.taskQueue, obj, propertyName);
// We do
this.logger
.warn(`Attempted to observe non existing property [${propertyName}] on instance of [${obj.constructor.name}]. Fallback to SetterObserver`);
return new SetterObserver(this.taskQueue, obj, propertyName); |
My only concern would be whether or not this causes a perf regression. |
we can add |
@EisenbergEffect mentioned this one in vNext cases |
the idea is that sometimes we bind to a none existent property, and the logger should tell us that this property does not exist.
but one of the great things about Aurelia is that sometimes you want to bind to dynamic properties, so making this an optional flag in logging verbosity level or something would make it better.
The text was updated successfully, but these errors were encountered: