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(ivy): merge directives into LViewData #26316
Conversation
You can preview 802d257 at https://pr26316-802d257.ngbuilds.io/. |
You can preview 3f26161 at https://pr26316-3f26161.ngbuilds.io/. |
@jasonaden AIO local test keeps flaking, so I can't get this green Update: green now |
It was removed in angular#26316
It was removed in angular#26316 PR Close angular#26364
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. |
This PR flattens the
LViewData[DIRECTIVES]
array intoLViewData
and theTView.directives
array intoTView.data
. This reduces memory pressure by avoiding the creation of unnecessary nested arrays. It also implements the host binding algorithm outlined inVIEW_DATA.md
.Notes:
loadDirective()
was being used inhostBinding
andcontentQueries
functions as a special instruction to read from thedirectives
array. Now that there isn't adirectives
array, we can simply use the existingload()
instruction in these cases, so theloadDirective()
instruction has been removed.loadDirective()
in a number of places as a testing utility. This can't really be replaced withload()
because now that directives are flat, it's harder to predict where the directive will live inviewData
(e.g. there might be other directives with injectors and host bindings ahead of it), so I've created a new testing utility to replace it calledgetDirectiveOnNode()
. This takes the node index and an optional directive offset.ElementRef
. This is unnecessary given that they are created using factories, so injecting these tokens no longer triggers the creation of an injector on its own.For more information about this change, see
VIEW_DATA.md
.