fix: treat new expression references in template as possibly dynamic #10636
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #10629.
This is an interesting one, but one I think worth considering. When a binding is passed into a template such as
When we check if
foo
is dynamic, unless it comes from state or a prop, it will generally be considered as not dynamic as its just an identifier (member expressions and call expressions are always treated as dynamic). Maybe we can tweak this so that if we see it comes from anew
expression that is gets treated as being possibly dynamic. That's because classes are more likely to have a customtoString
that might be reactive, thus the identifier itself might be dynamic.