Skip to content

Conversation

pkozlowski-opensource
Copy link
Member

@pkozlowski-opensource pkozlowski-opensource commented Jan 21, 2019

Before this commit we were creating a "fake" TNode for each and every
projectable node passed during dynamic component creation. This approach
had several problems:

  • the existing TView structure had to be mutated to accomodate new TNodes and
    it was very easy to "corrupt" TView / TNode data structures;
  • TNodes are not really needed to fully support projectable nodes so we were
    creating objects and updating existing data structures for nothing.

This commit changes the approach so we don't create "fake" TNodes for projectable
nodes but instead we process projectable nodes directly in the projection instruction.
As a result we've got less code, less object allocation and - as a bonus - we fix few
bugs where TView / TNode data structures were corrupted when using projectable nodes.

NOTE A REVIEWER: there is still one remaining test marked with FW-873 - this is because the root cause is different to the one fixed in this PR (LView / TView corruption by TNodes created for projectable nodes). I've investigated the other root cause and I know what is going on plus I think I know how to fix it. But the fix is not trivial so it will be done in a separate PR.

@petebacondarwin
Copy link
Contributor

The legacy test failure looks legit! We are now adding an ng-star-inserted attribute to the projected node, right?

@pkozlowski-opensource pkozlowski-opensource force-pushed the projectable_nodes_as_native_nodes branch 2 times, most recently from 78b3726 to 037e7e3 Compare January 21, 2019 17:02
@pkozlowski-opensource pkozlowski-opensource requested a review from a team as a code owner January 21, 2019 17:11
Before this commit we were creating a "fake" TNode for each and every
projectable node passed during dynamic component creation. This approach
had several problems:
- the existing TView structure had to be mutated to accomodate new TNodes and
it was very easy to "corrupt" TView / TNode data structures;
- TNodes are not really needed to fully support projectable nodes so we were
creating objects and updating existing data structures for nothing.

This commit changes the approach so we don't create "fake" TNodes for projectable
nodes but instead we process projectable nodes directly in the projection instruction.
As a result we've got less code, less object allocation and - as a bonus - we fix few
bugs where TView / TNode data structures were corrupted when using projectable nodes.
@pkozlowski-opensource pkozlowski-opensource force-pushed the projectable_nodes_as_native_nodes branch from 62971f5 to aa0a135 Compare January 22, 2019 14:57
@pkozlowski-opensource pkozlowski-opensource added target: major This PR is targeted for the next major release PR action: time-zone action: review The PR is still awaiting reviews from at least one requested reviewer and removed state: WIP labels Jan 22, 2019
Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kara
Copy link
Contributor

kara commented Jan 22, 2019

@petebacondarwin I think the test failure you mentioned has been fixed. Can you take another look?

@pkozlowski-opensource
Copy link
Member Author

@kara yep, the error @petebacondarwin mentioned was present only in the WIP version of this PR. So all is good here.

@kara
Copy link
Contributor

kara commented Jan 22, 2019

presubmit

@kara kara removed the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 22, 2019
@kara kara added action: presubmit The PR is in need of a google3 presubmit action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: presubmit The PR is in need of a google3 presubmit labels Jan 22, 2019
@kara
Copy link
Contributor

kara commented Jan 22, 2019

merge-assistance: global approval, since the test failure has been fixed and the only changes in upgrade are to turn on the tests.

vetom pushed a commit to vetom/angular that referenced this pull request Jan 31, 2019
…8275)

Before this commit we were creating a "fake" TNode for each and every
projectable node passed during dynamic component creation. This approach
had several problems:
- the existing TView structure had to be mutated to accomodate new TNodes and
it was very easy to "corrupt" TView / TNode data structures;
- TNodes are not really needed to fully support projectable nodes so we were
creating objects and updating existing data structures for nothing.

This commit changes the approach so we don't create "fake" TNodes for projectable
nodes but instead we process projectable nodes directly in the projection instruction.
As a result we've got less code, less object allocation and - as a bonus - we fix few
bugs where TView / TNode data structures were corrupted when using projectable nodes.

PR Close angular#28275
@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 Sep 14, 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 cla: yes merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants