You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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 reada.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?
The text was updated successfully, but these errors were encountered: