-
-
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
Improve "Backtracking re-render" assertion #14709
Comments
For the Looking at the available context where we currently set We have easy access to:
It's not immediately clear to me how we can get any source template details from this. Some ideas the I'm going to explore:
|
We have a reference when setting Somewhere within the context, we have an opcode which also uses the same reference: This gives us access to Possible next steps:
|
@GavinJoyce another idea: we can potentially use Probably need to add more instrumentation hooks to Glimmer if we want to get more granular than that. |
@chancancode thanks, I've created a quick spike (😷 using a global to track the last rendered component 😷) and it works pretty well in our app: Before: You modified After: Assertion Failed: You rendered Next Steps:
|
Thanks heaps Mr Joyce. @GavinJoyce |
I've a few backtracking re-render issues to solve in my app and I'm interested in improving the assertions to make this easier for me and others. This issue will serve as a place to capture any discussion or progress.
The current assertion message for this example looks like:
Assertion Failed: You modified model.name twice on [object Object] in a single render. This was unreliable and slow in Ember 1.x and is no longer supported...
It would be nice to improve this to include more information on where the property was originally consumed as well as where it was then mutated. Something like this would be nice to aim for:
Assertion Failed. You rendered "model.name" in "templates/example1.hbs" and modified it in "components/component-that-changes-name-on-init" in a single render. This was unreliable and slow in Ember 1.x and is no longer supported...
Here are some thoughts from @chancancode on how we might do this.
https://embercommunity.slack.com/archives/dev-ember/p1481392322000438:
Useful links:
The text was updated successfully, but these errors were encountered: