-
-
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
call order for didInsertElement
for siblings reversed
#13972
Comments
Hmm. I don't think the order of @krisselden - You likely know this area the best, what do you think? Should we consider this a bug and try to fix it, or is the Glimmer@2 behavior intentional? |
didInsertElement
reverseddidInsertElement
for siblings reversed
I think we did it to pass tests: 1581583#diff-c8938eb5cb17b733982744e1621cb8e4R168 If the actual goal is to have the children called before the parent, I think the would be pretty simple; instead of queuing the hooks in Are the rules the same for update hooks? I don't know if there is an equivalent place for it now, but we can make |
@chancancode - The parent/child ordering is correct. This issue is about siblings. |
Yeah. Basically we did pre-order queueing (Parent - Child 1 - Child 2 - Child 3) and then the test failed, so we just reversed the order to make it pass (C3 C2 C1 P). If we actually want post-order queuing (C1 C2 C3 P), I think we can actually do it. Might have some implications for exception cases though, since if it errored when appending one of your children, your hook will not be queued/called, but that whole area needs a lot more love anyway. |
I don't think it is strictly a bug, but it feels bad. |
Closes #13972 Requires corresponding Glimmer change
Closes #13972 Requires corresponding Glimmer change
Closes emberjs#13972 Requires corresponding Glimmer change
Example:
order of didInsertElement hooks:
A B C D
in
2.9.0-alpha+8ba7f68f
the order is now:D C B A
Ember-Twiddle: https://ember-twiddle.com/#/847f6adf7c7dc53f65f449062c3c5549 (output in console)
I have some code that depends on the order of
didInsertElement
.willInsertElement
is still in the right order.The text was updated successfully, but these errors were encountered: