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

[Glimmer 2] Removal of "always dirty" re-rendering #13946

Closed
chancancode opened this issue Jul 29, 2016 · 4 comments
Closed

[Glimmer 2] Removal of "always dirty" re-rendering #13946

chancancode opened this issue Jul 29, 2016 · 4 comments

Comments

@chancancode
Copy link
Member

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 through Ember.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.

@fivetanley
Copy link
Member

@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. You modified (no label) in the screenshot below is one example. The debugging curve here has been pretty hard and making this an assertion would prevent us from upgrading without someone who knows the internals of Ember metal/glimmer fairly well.

screen shot 2016-11-07 at 9 51 46 am

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.

@fivetanley
Copy link
Member

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.

@fivetanley
Copy link
Member

My bad, my comments belonged on #13948 instead.

@kiwiupover
Copy link
Contributor

@fivetanley congrats on landing a job at heroku!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants