-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Track which variables need to be reactive #1952
Comments
Playing around, I extended |
So it turns out I was confusing myself (not hard to do) with a scriptless component. With that cleared up, I think tracking mutation along the template stack will probably work out ok, so I'll keep poking at it to see what shakes out. |
…eltejs#1952 also tracks mutation on child refs of const declarations - sveltejs#1917
First pass at tracking mutation to avoid unnecessary update code - #1952
+1 as for CoffeeScript users (I'm a proud one) transpiled code only uses |
hoist vars and lets that don't change
REPL. We're not taking full advantage of the information available to us. This code...
...should result in this output...
...since there's no way
name
could change.Stretch goal:
let name
should be hoisted out of the instance altogether:This is what happens if it's a
const
instead. In other words, rather than determining a variable's reactivity based onconst
andlet
(which causes other bugs — #1917), it should be based on how the variable is actually used.The text was updated successfully, but these errors were encountered: