Skip to content
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): simplify property binding metadata #32457

Conversation

pkozlowski-opensource
Copy link
Member

@pkozlowski-opensource pkozlowski-opensource commented Sep 3, 2019

Since property binding metadata storage is guarded with the ngDevMode now
and several instructions were merged together, we can simplify the way we
store and read property binding metadata.

The the most important change in this PR is that now we can store binding metadata in one field in the TView.data (previously meta-data for an interpolated bound property would be spread over multiple TView.data entries). This greatly simplifies property binding metadata retrieval (we just need to look it up at one index) and lets us to remove chunks of code / logic (getFirstBindingIndex can go away). Also regular and host binding properties gets unified (collectHostPropertyBindings can be removed).

To know where property bindings are located for a given TNode we can remove 2 fields from TNode (propertyMetadataStartIndex / propertyMetadataEndIndex ) and replace it with just one (propertyBindings) filled in the ngDevMode only.

Finally, property binding metadata are stored for properties only and there is no processing for attribute bindings.

I believe that this refactoring removes code, simplifies logic and opens up possibilities of other refactorings (perf-motivated goal here is to get rid of the bind function).

@pkozlowski-opensource pkozlowski-opensource added comp: ivy target: major This PR is targeted for the next major release labels Sep 3, 2019
@ngbot ngbot bot modified the milestone: needsTriage Sep 3, 2019
@pkozlowski-opensource pkozlowski-opensource force-pushed the binding_metadata_simplify branch 3 times, most recently from 51379ba to ae750b4 Compare September 4, 2019 10:27
Since property binding metadata storage is guarded with the ngDevMode now
and several instructions were merged together, we can simplify the way we
store and read property binding metadata.
@pkozlowski-opensource pkozlowski-opensource added the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 4, 2019
@pkozlowski-opensource pkozlowski-opensource marked this pull request as ready for review September 4, 2019 13:32
@pkozlowski-opensource pkozlowski-opensource requested a review from a team as a code owner September 4, 2019 13:32
@mhevery mhevery added the action: merge The PR is ready for merge by the caretaker label Sep 4, 2019
@mhevery
Copy link
Contributor

mhevery commented Sep 4, 2019

presubmit
presubmit ivy

@mhevery mhevery closed this in a383a5a Sep 4, 2019
sabeersulaiman pushed a commit to sabeersulaiman/angular that referenced this pull request Sep 6, 2019
)

Since property binding metadata storage is guarded with the ngDevMode now
and several instructions were merged together, we can simplify the way we
store and read property binding metadata.

PR Close angular#32457
arnehoek pushed a commit to arnehoek/angular that referenced this pull request Sep 26, 2019
)

Since property binding metadata storage is guarded with the ngDevMode now
and several instructions were merged together, we can simplify the way we
store and read property binding metadata.

PR Close angular#32457
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker action: review The PR is still awaiting reviews from at least one requested reviewer cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants