Navigation Menu

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

Help detect a missing @observable #20643

Closed
sigmundch opened this issue Aug 21, 2014 · 1 comment
Closed

Help detect a missing @observable #20643

sigmundch opened this issue Aug 21, 2014 · 1 comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.

Comments

@sigmundch
Copy link
Member

Here is a situation I run into today:
 - I have property defined in a custom element
 - I use the property in a template
 - the property is initialized in the body of created, but otherwise never changes

My app was working fine in Chrome, but not in Firefox.

The issue is that the template was being expanded after the value has been set in Chrome, but before in Firefox (the polyfill didn't guarantee the same timing)

This can be fixed in two ways:
 - move the initialization to a getter that caches the result
 - mark the field @­observable

We could add to our linter a check, to ensure that all properties used in the template are marked @­observable or are final. The challenge is that there are a lot of cases we'd have false positives. For example:
 - we can't figure out the target of a name in the template (where is c if we read a.b.c)
 - the user purposely doesn't want it to be @­observable

maybe this is something we can turn on as a diagnostics helper, but not have it on by default?

@sigmundch sigmundch added Type-Defect area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. labels Aug 21, 2014
@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/polymer-dart#465.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.
Projects
None yet
Development

No branches or pull requests

3 participants