Skip to content
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

Add warning for undeclared property in template binding #5473

Closed
kevinpschaaf opened this issue Jan 30, 2019 · 0 comments
Closed

Add warning for undeclared property in template binding #5473

kevinpschaaf opened this issue Jan 30, 2019 · 0 comments

Comments

@kevinpschaaf
Copy link
Member

Description

In Polymer 1.x, any property bound in the template was automatically added to the list of attributes that are deserialized to properties.

In Polymer 2.x this changed, such that only properties declared in properties are added to observedAttributes and deserialized. This is because template parsing is lazy (deferred to first element instance) while observedAttributes must be present at registration time. That said, properties are used in templates still get setters and work as normal in terms of dynamic updates based on property changes; they just do not have corresponding observed attributes.

Since this is a silent difference between Polymer 1.x and 2.x, we propose adding a warning to the legacyOptimizations flag mode (to err on the conservative side, since users may have taken advantage of the terseness of not declaring properties and may not consider it a "bug" per se).

Versions

  • Polymer: v2.x and 3.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant