-
Notifications
You must be signed in to change notification settings - Fork 26.2k
refactor(core): Ensure that previousOrParentTNode
always belongs to current TView
.
#38707
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
refactor(core): Ensure that previousOrParentTNode
always belongs to current TView
.
#38707
Conversation
eb1a876
to
db86a69
Compare
previousOrParentTNode
always belongs to current TView
.
99845c9
to
790e05e
Compare
27a5be6
to
c2663e7
Compare
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.
Great refactoring and simplification, thanks Misko! 👍
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.
In general this looks like an improvement to the current situation - I think. That being said I find the instruction state rather confusing since it is difficult to track when it gets updated.
It does seem concerning though, that a non-urgent refactoring brings in two new FIXME comments. There are quite of few of these in the code base now, and I suspect that they are unlikely to attract much attention after this PR lands.
If there is a concern then I feel it would be better to address it earlier rather than later. (I.e. as part of this PR).
… current `TView`. (angular#38707) `previousOrParentTNode` stores current `TNode`. Due to inconsistent implementation the value stored would sometimes belong to the current `TView` and sometimes to the parent. We have extra logic which accounts for it. A better solution is to just ensure that `previousOrParentTNode` always belongs to current `TNode`. This simplifies the mental model and cleans up some code. PR Close angular#38707
…38707) Host `TNode` was passed into `getOrCreateTNode` just so that we can compute weather or not we are a root node. This was needed because `previousOrParentTNode` could have `TNode` from `TView` other then current `TView`. This is confusing mental model. Previous change ensured that `previousOrParentTNode` must always be part of `TView`, which enabled this change to remove the unneeded argument. PR Close angular#38707
…ar#38707) Extended the `LViewDebug` to display node-injector information for each node. PR Close angular#38707
`TNodeType.View` was created to support inline views. That feature did not materialize and we have since removed the instructions for it, leave an unneeded `TNodeType.View` which was still used in a very inconsistent way. This change no longer created `TNodeType.View` (and there will be a follow up chang to completely remove it.) Also simplified the mental model so that `LView[HOST]`/`LView[T_HOST]` always point to the insertion location of the `LView`. PR Close angular#38707
…38707) Previous commit change the logic to not rely on the `TViewNode` this change removes it entirely. PR Close angular#38707
) The value stored in `TView.node` is really the declaration `TNode`, therefore renaming to make it more explicit. PR Close angular#38707
…ll` (angular#38707) This change makes `getPreviousOrParentTNode` return `TNode|null` (rather than just `TNode`) which is more reflective of the reality. The `getPreviousOrParentTNode` can be `null` upon entering the `LView`. PR Close angular#38707
…#38707) The previous name of `previousOrParent` was confusing. Changed the terminology to `currentTNode`. PR Close angular#38707
…es NodeInjector (angular#38707) `NodeInjector` is store in expando as a list of values in an array. The offset constant into the array have been brought together into a single `NodeInjectorOffset` enum with better documentation explaining their usage. PR Close angular#38707
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
previousOrParentTNode
stores currentTNode
. Due to inconsistentimplementation the value stored would sometimes belong to the current
TView
and sometimes to the parent. We have extra logic which accountsfor it. A better solution is to just ensure that
previousOrParentTNode
always belongs to current
TNode
. This simplifies the mental modeland cleans up some code.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information