-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
[Ivy] detach view doesn't work #34816
Labels
area: core
Issues related to the framework runtime
regression
Indicates than the issue relates to something that worked in a previous version
state: has PR
Milestone
Comments
marcj
changed the title
v9 Ivy: detach view doesn't work
[Ivy] detach view doesn't work
Jan 16, 2020
Reproduction with Angular rc9 AOT https://ng-run.com/edit/KOdZml0HwC7nzauj6onq?aot=true&open=app%2Fapp.component.ts |
AndrewKushnir
added
area: core
Issues related to the framework runtime
comp: ivy
labels
Jan 16, 2020
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Jan 18, 2020
Fixes Ivy detecting changes inside child embedded views, even though they're detached. Note that there's on subtlety here: I made the changes inside `refreshDynamicEmbeddedViews` rather than `refreshView`, because we support detecting changes on a detached view (evidenced by a couple of unit tests), but only if it's triggered directly from the view's `ChangeDetectorRef`, however we shouldn't be detecting changes in the detached child view when something happens in the parent. Fixes angular#34816.
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Jan 18, 2020
Fixes Ivy detecting changes inside child embedded views, even though they're detached. Note that there's on subtlety here: I made the changes inside `refreshDynamicEmbeddedViews` rather than `refreshView`, because we support detecting changes on a detached view (evidenced by a couple of unit tests), but only if it's triggered directly from the view's `ChangeDetectorRef`, however we shouldn't be detecting changes in the detached child view when something happens in the parent. Fixes angular#34816.
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Jan 23, 2020
Fixes Ivy detecting changes inside child embedded views, even though they're detached. Note that there's on subtlety here: I made the changes inside `refreshDynamicEmbeddedViews` rather than `refreshView`, because we support detecting changes on a detached view (evidenced by a couple of unit tests), but only if it's triggered directly from the view's `ChangeDetectorRef`, however we shouldn't be detecting changes in the detached child view when something happens in the parent. Fixes angular#34816.
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Jan 23, 2020
Fixes Ivy detecting changes inside child embedded views, even though they're detached. Note that there's on subtlety here: I made the changes inside `refreshDynamicEmbeddedViews` rather than `refreshView`, because we support detecting changes on a detached view (evidenced by a couple of unit tests), but only if it's triggered directly from the view's `ChangeDetectorRef`, however we shouldn't be detecting changes in the detached child view when something happens in the parent. Fixes angular#34816.
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Jan 23, 2020
Fixes Ivy detecting changes inside child embedded views, even though they're detached. Note that there's on subtlety here: I made the changes inside `refreshDynamicEmbeddedViews` rather than `refreshView`, because we support detecting changes on a detached view (evidenced by a couple of unit tests), but only if it's triggered directly from the view's `ChangeDetectorRef`, however we shouldn't be detecting changes in the detached child view when something happens in the parent. Fixes angular#34816.
AndrewKushnir
pushed a commit
that referenced
this issue
Jan 24, 2020
Fixes Ivy detecting changes inside child embedded views, even though they're detached. Note that there's on subtlety here: I made the changes inside `refreshDynamicEmbeddedViews` rather than `refreshView`, because we support detecting changes on a detached view (evidenced by a couple of unit tests), but only if it's triggered directly from the view's `ChangeDetectorRef`, however we shouldn't be detecting changes in the detached child view when something happens in the parent. Fixes #34816. PR Close #34846
kara
added
regression
Indicates than the issue relates to something that worked in a previous version
and removed
severity5: ivy-compat
labels
Feb 11, 2020
sonukapoor
pushed a commit
to sonukapoor/angular
that referenced
this issue
Feb 13, 2020
…lar#34846) Fixes Ivy detecting changes inside child embedded views, even though they're detached. Note that there's on subtlety here: I made the changes inside `refreshDynamicEmbeddedViews` rather than `refreshView`, because we support detecting changes on a detached view (evidenced by a couple of unit tests), but only if it's triggered directly from the view's `ChangeDetectorRef`, however we shouldn't be detecting changes in the detached child view when something happens in the parent. Fixes angular#34816. PR Close angular#34846
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: core
Issues related to the framework runtime
regression
Indicates than the issue relates to something that worked in a previous version
state: has PR
🐞 bug report
Is this a regression?
Yes, worked perfectly fine in latest v8 without Ivy. Works also without Ivy in v9.
Description
I have a directive that renders a template and detaches it from the CD until some criteria is true. Once true I reattach it again. However in Ivy the whole detach doesn't work. After calling
view.detach()
the view is still checked in change detector runs and thus uses resources. In non-Ivy that works correctly: The view is never used in change detector runs when detach was called.🔬 Minimal Reproduction
https://stackblitz.com/edit/angular-issue-repro2-xd8kbu
This Stackblitz uses Angular 9.0.0rc9, however the issue is not reproducible directly in Stackblitz (only god knows why). In Stackblitz you see the correct behavior:
But if you download that Stackblitz and run
npm install && ./node_modules/.bin/ng serve
then you see the actual issue:The second line behind the
:
is detached and should never display anything.Code of that wrapper:
Versions
9.0.0: I tested rc7, rc8, rc9. None worked correctly. When I opt out of Ivy using
"enableIvy": false
it works correctly (only tested with with rc9).🌍 Your Environment
Angular Version:
Anything else relevant?
It's interesting that in Stackblitz it works as intended, but when using Chrome and
ng serve
locally it doesn't work. I assume that Stackblitz uses some v8 components or not the Ivy renderer, but that's just a guess as I have no knowledge about how Stackblitz actually starts the angular dev server and whether they overwrite some settings.The text was updated successfully, but these errors were encountered: