-
-
Notifications
You must be signed in to change notification settings - Fork 927
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
domFor: always get generation from delayedRemoval instead of parameter #3007
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see tests confirming multiple generations are tracked correctly, for completeness.
Given you do this:
- Render vnode A with
onbeforeremove
and DOM nodes A1 and A2 - Remove vnode A, do not resolve
onbeforeremove
- Render vnode B with
onbeforeremove
and DOM nodes B1 and B2 - Remove vnode B, do not resolve
onbeforeremove
- Render vnode C with
onbeforeremove
and DOM nodes C1 and C2 - Remove vnode C, do not resolve
onbeforeremove
I'd like to see confirmation of this (6 possible removal sequences in total):
m.domFor(A)
returns[A1, A2]
consistently before A'sonbeforeremove
resolves, even if B's and/or C's resolves firstm.domFor(B)
returns[B1, B2]
consistently before B'sonbeforeremove
resolves, even if A's and/or C's resolves firstm.domFor(C)
returns[C1, C2]
consistently before C'sonbeforeremove
resolves, even if B's and/or C's resolves first
@dead-claudia Thanks for your review comments.
I am a little sorry that the test codes are somewhat verbose. |
@kfule Oh, I expected it to be messy. Don't worry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You got these orders:
- BCA
- CAB
- ABC
I also wanted to see the other three:
- ACB
- BAC
- CBA
@dead-claudia |
Description
The
generation
of domFor is no longer passed as a parameter.This allows domFor to work well in onbeforeremove and onremove and reduces the amount of code.
Motivation and Context
#3005 did not properly take into account that domFor is public API.
This PR fixes these problems (#3005 (comment)):
How Has This Been Tested?
npm run test
including new testsTypes of changes
Checklist