-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Legacy warnings 3.x #5474
Legacy warnings 3.x #5474
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's consider also warning if a user tries to change readOnly
or reflectToAttribute
or notify
.
We should remove the doc line about "consider adding warnings" since we are doing that here.
lib/mixins/property-effects.js
Outdated
@@ -2390,6 +2390,9 @@ export const PropertyEffects = dedupingMixin(superClass => { | |||
* @protected | |||
*/ | |||
static _addTemplatePropertyEffect(templateInfo, prop, effect) { | |||
if (legacyOptimizations && !(prop in templateInfo.dynamicFns)) { | |||
console.warn(`Property '${prop}' used in template but not declared in 'properties'.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.warn(`Property '${prop}' used in template but not declared in 'properties'.`); | |
console.warn(`Property '${prop}' used in template but not declared in 'properties'. Setting an attribute will not set the corresponding property unless the property is declared in 'properties'.`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pending tests passing
Adds warnings for a couple of subtle changes in behavior between 1.x and 2.x:
legacyOptimizations
flag is enabled). Fixes Add warning for undeclared property in template binding #5473Reference Issue
Fixes #5473 and #5468.