From 940d1a7a0ed3b5967f750e4dbcd36747ea8fef14 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Wed, 20 Feb 2019 01:22:24 -0800 Subject: [PATCH] Add comments on warning limitations. --- lib/mixins/element-mixin.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/mixins/element-mixin.js b/lib/mixins/element-mixin.js index 976f18c755..7aeca81e92 100644 --- a/lib/mixins/element-mixin.js +++ b/lib/mixins/element-mixin.js @@ -778,8 +778,18 @@ export const ElementMixin = dedupingMixin(base => { // we don't want to spam existing users who might have adopted the // shorthand when attribute deserialization is not important. if (legacyOptimizations && !(prop in this._properties) && + // Methods used in templates with no dependencies (or only literal + // dependencies) become accessors with template effects; ignore these !(effect.info.part.signature && effect.info.part.signature.static) && - !effect.info.part.hostProp && !templateInfo.nestedTemplate) { + // Bindings added from a host to the template element may also include + // "instance props" introduced into the template scope and not + // actually provided by the host; since we can't disambiguate these, + // ignore them all + !effect.info.part.hostProp && + // Template effects added on TemplateInstance classes can't determine + // whether the property may have been a "static" method, so ignore + // all nested template bindings + !templateInfo.nestedTemplate) { console.warn(`Property '${prop}' used in template but not declared in 'properties'; ` + `attribute will not be observed.`); }