fix(core): support swapping hydrated views in @for loops#53274
fix(core): support swapping hydrated views in @for loops#53274AndrewKushnir wants to merge 1 commit intoangular:mainangular/angular:mainfrom AndrewKushnir:hydration_for_swapsAndrewKushnir/angular:hydration_for_swapsCopy head branch name to clipboard
@for loops#53274Conversation
|
This PR potentially replaces PR #53225. |
183b0e7 to
80be566
Compare
There was a problem hiding this comment.
With this new condition I think that we can now change the implementation of the ViewContainerRef so the insert operations go through the shouldAddViewToDom logic - currently the insert operation has this value hard-coded to true and it means that those 2 operations (create vs. create + insert) have different logic.
There was a problem hiding this comment.
@pkozlowski-opensource thanks for the review!
I believe you refer to this code, where true indicates that the contents of a view should always be inserted:
angular/packages/core/src/linker/view_container_ref.ts
Lines 472 to 474 in 1940280
I think that code is still correct. The createComponent and createEmbeddedView functions go through the insertImpl function and pass that flag based on what shouldAddViewToDom returns. For explicit insert calls, always inserting the content looks like a correct thing to do. Please let me know if I'm missing something.
There was a problem hiding this comment.
FYI, we'll proceed with the merge and I'd be happy to make extra changes in a followup PR once we discuss this more.
There was a problem hiding this comment.
Yep, let's discuss more in the follow-up PR!
This commit fixes an issue where swapping hydrated views was not possible in the new control flow repeater. The problem was caused by the fact that an internal representation of a view had no indication that hydration is completed and further detaching/attaching should work in a regular (non-hydration) mode. This commit adds a logic that resets a pointer to a dehydrated content and we use this as an indication that the view is swtiched to a regular mode. Resolves angular#53163.
80be566 to
bcac1e4
Compare
|
This PR was merged into the repository by commit 82609d4. |
This commit fixes an issue where swapping hydrated views was not possible in the new control flow repeater. The problem was caused by the fact that an internal representation of a view had no indication that hydration is completed and further detaching/attaching should work in a regular (non-hydration) mode. This commit adds a logic that resets a pointer to a dehydrated content and we use this as an indication that the view is swtiched to a regular mode. Resolves #53163. PR Close #53274
|
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. |
…3274) This commit fixes an issue where swapping hydrated views was not possible in the new control flow repeater. The problem was caused by the fact that an internal representation of a view had no indication that hydration is completed and further detaching/attaching should work in a regular (non-hydration) mode. This commit adds a logic that resets a pointer to a dehydrated content and we use this as an indication that the view is swtiched to a regular mode. Resolves angular#53163. PR Close angular#53274
…3274) This commit fixes an issue where swapping hydrated views was not possible in the new control flow repeater. The problem was caused by the fact that an internal representation of a view had no indication that hydration is completed and further detaching/attaching should work in a regular (non-hydration) mode. This commit adds a logic that resets a pointer to a dehydrated content and we use this as an indication that the view is swtiched to a regular mode. Resolves angular#53163. PR Close angular#53274
…3274) This commit fixes an issue where swapping hydrated views was not possible in the new control flow repeater. The problem was caused by the fact that an internal representation of a view had no indication that hydration is completed and further detaching/attaching should work in a regular (non-hydration) mode. This commit adds a logic that resets a pointer to a dehydrated content and we use this as an indication that the view is swtiched to a regular mode. Resolves angular#53163. PR Close angular#53274
This commit fixes an issue where swapping hydrated views was not possible in the new control flow repeater. The problem was caused by the fact that an internal representation of a view had no indication that hydration is completed and further detaching/attaching should work in a regular (non-hydration) mode. This commit adds a logic that resets a pointer to a dehydrated content and we use this as an indication that the view is swtiched to a regular mode.
Resolves #53163.
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?