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
FW-869: Refactor view container and view manipulations for embedded views and projections #29031
Conversation
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
815233f
to
2e5be9c
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
2e5be9c
to
0a097f6
Compare
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
f080730
to
f06a997
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
7fafe5e
to
f3f6070
Compare
8abede8
to
ff720de
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.
This is a pretty beefy PR, so this is my first attempt. General approach looks good. High level things to start with would probably be:
- Split out addition of
View
interface into a separate PR (can be landed before this) - Split out unrelated docs changes (e.g. in i18n) into a separate PR (can be landed before this)
- Split out new public API methods (e.g.
getViewContainer
) into a separate PR (can be landed after this) - Convert tests with handwritten generated code to TestBed
- Audit uses of
NATIVE
vsHOST
(noticed that they are used interchangeably)
ngDevMode && assertLView(parentLView); | ||
ngDevMode && assertLContainer(lContainerToAdd); | ||
|
||
const anchorElement = lContainerToAdd[HOST]; |
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.
If you want the host node, you'll need to unwrap it to avoid getting a component view or a styling context.
const anchorElement = lContainerToAdd[HOST]; | |
const anchorElement = unwrapRNode(lContainerToAdd); |
Which begs the question - do you want the host node? Or are you looking specifically for a comment? In that case, it should be NATIVE
.
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.
I've switched to NATIVE
, because I'm sure that's what I really wanted... however it does concern me that no tests broke from me using HOST
instead.
cc @mhevery
b65c9c5
to
4c2ca31
Compare
… INTO SEPERATE PRS
4c2ca31
to
468e813
Compare
Just updating comments in query-related things to make it easier for the next person that has to grok this for the first time. Also adds a demo from @mhevery to one of the query specs Related angular#29031
Just updating comments in query-related things to make it easier for the next person that has to grok this for the first time. Also adds a demo from @mhevery to one of the query specs Related angular#29031
Just updating comments in query-related things to make it easier for the next person that has to grok this for the first time. Also adds a demo from @mhevery to one of the query specs Related angular#29031 PR Close angular#29342
Just updating comments in query-related things to make it easier for the next person that has to grok this for the first time. Also adds a demo from @mhevery to one of the query specs Related angular#29031 PR Close angular#29342
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. |
Views were being added to containers in such a way that they were out of sync with the order their corresponding elements existed in the DOM (and in the templates). This caused issues with how query results would come back, specifically that they would be in seemingly arbitrary order based off of the order in which they were retrieved (and therefor set up). Another side effect of this is that change detection was processed in the aforementioned order.
The fix was to refactor the view container and view interaction APIs, and rework the logic where views were being added to the container and linked to one another.
This also switches from an "insert before" strategy to an "insert after" strategy for adding DOM nodes.
Before:
After:
This also uncovered an issue related to i18n that has been marked with
fixmeIvy('FW-1112: ...')
in this PR. (attn @ocombe)Thanks to @pkozlowski-opensource for the rapid assist with the query-related issue, @mhevery's guidance/ideas and @Combe for helping track down what was going on with the i18n test marked for fixing.
Update (2019-03-07) --------------
Everything was rebased as of last night at 8pm PST.
Two remaining known issue:
fixmeIvy('FW-????: ....')
, I plan on replacing that????
with an actual Jira number when this PR is closer to landing.Because this is a large refactor, it's going to take a while to review and refine, so I'd like to get started with reviews prior to the above remaining issues being resolved.