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): LView is a proper linked list #28382

Closed
wants to merge 4 commits into from

Conversation

benlesh
Copy link
Contributor

@benlesh benlesh commented Jan 25, 2019

  • TView no longer stores childIndex
  • LView now as CHILD_HEAD and CHILD_TAIL

TView used to store the head of the list, therefor all LViews had to have the same head, which is incorrect.

@benlesh benlesh requested a review from kara January 25, 2019 23:22
@benlesh benlesh requested a review from a team as a code owner January 25, 2019 23:22
@benlesh benlesh added target: major This PR is targeted for the next major release comp: ivy and removed cla: yes labels Jan 25, 2019
@ngbot ngbot bot added this to the needsTriage milestone Jan 25, 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.

Looks good, but needs a test for the new behavior we want to support (e.g. using injector.get to get ViewContainerRef.

Also needs symbol test updates and linting.

packages/core/src/render3/instructions.ts Show resolved Hide resolved
@kara kara added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Jan 25, 2019
@benlesh benlesh force-pushed the move-lcontainer-head-to-lview branch from 9d3e2e3 to c3b5066 Compare January 29, 2019 00:01
Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

Isn't it possible to also remove views? Shouldn't CHILD_HEAD/CHILD_TAIL be updatd in that case?

packages/core/src/render3/node_manipulation.ts Outdated Show resolved Hide resolved
packages/core/src/render3/interfaces/view.ts Outdated Show resolved Hide resolved
@benlesh benlesh force-pushed the move-lcontainer-head-to-lview branch 2 times, most recently from b6e7747 to 213690f Compare February 4, 2019 17:02
@benlesh
Copy link
Contributor Author

benlesh commented Feb 4, 2019

@benlesh benlesh removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Feb 4, 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.

Nice work, like how much more intuitive the data structures are.

packages/core/src/render3/assert.ts Outdated Show resolved Hide resolved
packages/core/src/render3/discovery_utils.ts Outdated Show resolved Hide resolved
packages/core/src/render3/discovery_utils.ts Show resolved Hide resolved
packages/core/src/render3/instructions.ts Outdated Show resolved Hide resolved
packages/core/src/render3/instructions.ts Outdated Show resolved Hide resolved
packages/core/src/render3/node_manipulation.ts Outdated Show resolved Hide resolved
packages/core/src/render3/node_manipulation.ts Outdated Show resolved Hide resolved
packages/core/src/render3/util.ts Outdated Show resolved Hide resolved
packages/core/src/render3/util.ts Outdated Show resolved Hide resolved
@benlesh benlesh force-pushed the move-lcontainer-head-to-lview branch 5 times, most recently from b2c80e7 to f4b407b Compare February 14, 2019 19:12
packages/core/src/render3/discovery_utils.ts Outdated Show resolved Hide resolved
export function addToViewTree<T extends LView|LContainer>(lView: LView, lViewOrLContainer: T): T {
// TODO(benlesh/misko): This implementation is incorrect, because it always adds the LContainer to
// the end of the queue, which means if the developer asks for the LContainers out of order, the
// change detection will run out of order.
Copy link
Contributor

Choose a reason for hiding this comment

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

^ Still needs resolution

packages/core/src/render3/interfaces/view.ts Show resolved Hide resolved
packages/core/src/render3/interfaces/view.ts Outdated Show resolved Hide resolved
@benlesh
Copy link
Contributor Author

benlesh commented Feb 19, 2019

@kara The TODO in addViewToTree is actually addressed in another PR that's in-progress (for FW-869). So that will not be resolved in this PR.

@kara
Copy link
Contributor

kara commented Feb 19, 2019

@benlesh To clarify, the feedback that still needed resolution was that we need a better comment. I don't see why improving the comment needs to wait until the next PR.

Maybe add clarification to comment about what "asks for" means? Do you mean injector.get(ViewContainerRef)? (Also is there a Jira ticket for this?)

@IgorMinar IgorMinar added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Feb 20, 2019
@IgorMinar
Copy link
Contributor

google3 presumit fails... please update and remove the "cleanup" label when ready

@benlesh benlesh removed the action: merge The PR is ready for merge by the caretaker label Feb 20, 2019
@benlesh benlesh requested a review from a team as a code owner February 20, 2019 22:21
@benlesh benlesh force-pushed the move-lcontainer-head-to-lview branch from 9624296 to a43b0bc Compare February 21, 2019 01:15
@benlesh benlesh requested a review from a team as a code owner February 21, 2019 01:15
@benlesh benlesh force-pushed the move-lcontainer-head-to-lview branch from a43b0bc to f6370e1 Compare February 21, 2019 18:13
@benlesh
Copy link
Contributor Author

benlesh commented Feb 21, 2019

new presubmit

@benlesh benlesh removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Feb 21, 2019
@benlesh benlesh force-pushed the move-lcontainer-head-to-lview branch from 7b59f8f to a9a69e7 Compare February 22, 2019 18:34
- Removes CONTAINER_INDEX
- LView[PARENT] now contains LContainer when necessary
- Removes now unused arguments to methods after refactor
- TView no longer stores childIndex
- LView now as CHILD_HEAD and CHILD_TAIL

TView used to store the head of the list, therefor all LViews had to have the same head, which is incorrect.
@benlesh benlesh force-pushed the move-lcontainer-head-to-lview branch from a9a69e7 to 71494ea Compare February 22, 2019 18:46
Google3 detected circular references here, so splitting up this rather hodge-podge list of functions into slightly better organizational units.
@benlesh benlesh force-pushed the move-lcontainer-head-to-lview branch from 71494ea to 3f633a1 Compare February 22, 2019 18:58
@benlesh benlesh added action: merge The PR is ready for merge by the caretaker and removed merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Feb 22, 2019
@IgorMinar
Copy link
Contributor

IgorMinar commented Feb 22, 2019

this pr still fails on g3 presubmit. adding "cleanup" label.

root cause:

failed to load main  Error: Cyclical dependency between files:

/build/work/3b02cb54a0edf0b2b24d9ca8ccb8de16/google3/third_party/javascript/angular2/rc/packages/core/src/render3/util/view_utils.ts -> 
/build/work/3b02cb54a0edf0b2b24d9ca8ccb8de16/google3/third_party/javascript/angular2/rc/packages/core/public_api.ts -> 
/build/work/3b02cb54a0edf0b2b24d9ca8ccb8de16/google3/third_party/javascript/angular2/rc/packages/core/src/core.ts -> 
/build/work/3b02cb54a0edf0b2b24d9ca8ccb8de16/google3/third_party/javascript/angular2/rc/packages/core/src/metadata.ts -> 
/build/work/3b02cb54a0edf0b2b24d9ca8ccb8de16/google3/third_party/javascript/angular2/rc/packages/core/src/metadata/directives.ts -> 
/build/work/3b02cb54a0edf0b2b24d9ca8ccb8de16/google3/third_party/javascript/angular2/rc/packages/core/src/render3/jit/directive.ts -> 
/build/work/3b02cb54a0edf0b2b24d9ca8ccb8de16/google3/third_party/javascript/angular2/rc/packages/core/src/render3/util/misc_utils.ts -> 
/build/work/3b02cb54a0edf0b2b24d9ca8ccb8de16/google3/third_party/javascript/angular2/rc/packages/core/src/render3/util/view_traversal_utils.ts -> 
/build/work/3b02cb54a0edf0b2b24d9ca8ccb8de16/google3/third_party/javascript/angular2/rc/packages/core/src/render3/assert.ts -> 
/build/work/3b02cb54a0edf0b2b24d9ca8ccb8de16/google3/third_party/javascript/angular2/rc/packages/core/src/render3/util/view_utils.ts

@IgorMinar IgorMinar added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Feb 22, 2019
@benlesh benlesh removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Feb 22, 2019
@benlesh
Copy link
Contributor Author

benlesh commented Feb 22, 2019

@benlesh benlesh closed this in ba6aa93 Feb 22, 2019
benlesh added a commit that referenced this pull request Feb 22, 2019
- TView no longer stores childIndex
- LView now as CHILD_HEAD and CHILD_TAIL

TView used to store the head of the list, therefor all LViews had to have the same head, which is incorrect.

PR Close #28382
benlesh added a commit that referenced this pull request Feb 22, 2019
Google3 detected circular references here, so splitting up this rather hodge-podge list of functions into slightly better organizational units.

PR Close #28382
@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 risk: low 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

7 participants