-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Glimmer 2] Removal of "always dirty" re-rendering #13946
Comments
@chancancode We are having a pretty hard time trying to fix the deprecations for this in our app. A lot of these deprecations point at ember/glimmer internals and make it difficult to decipher where exactly the deprecation is being triggered from. While we agree that this is the correct behavior going forward, we would like to help at least try to make the messaging better if you have time to provide some guidance. |
These messages also happen during the rerender queue, meaning they get scheduled far away from when the property was actually changed. This often removes the ability to follow the stack to figure out which thing changed, causing the rerender. |
My bad, my comments belonged on #13948 instead. |
@fivetanley congrats on landing a job at heroku! |
Previously, calling
this.rerender()
on a component would force everything in its template subtree to recompute, including helpers like{{unbound}}
and other custom helper. This is done by walking all the "render nodes" with a "always-dirty visitor".In Glimmer 2, the entire system is built to avoid doing unnecessary work. There is no equivalent concept to "render nodes". In many of cases, the system can tell that nothing in a sub-tree has changed without traversing it at all. Sometimes the system can even tell that certain things (like
{{unbound}}
and constant values in the templates) are not going to change and optimize out the work ahead-of-time.Therefore, there isn't necessarily an equivalent strategy we can use without defeating these optimizations.
To our knowledge, the previous behavior is not guaranteed in official documentation. It is usually used to work around issues that are fixed in the new system. For example,
{{#each-in}}
now tracks all the changes to the object automatically (as long as they are added throughEmber.set
), and does not require manual re-render.If you believe you have usage patterns that are affected by this, please provide as much details about your scenario as possible below. It is very possible there are alternatives and/or targeted solutions we can use that do not require a wholesale change to the engine's optimization strategies. Therefore, it would be helpful for you to provide more background information and context about your usage instead of just showing us small code snippets from your codebase.
The text was updated successfully, but these errors were encountered: