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(core): Provide scheduler for use and coordination with zone change detection #54952
Conversation
799e7d8
to
4cb5c42
Compare
This is 🚀 Because this opens up the possibility to have zoneless and not zoneless parts of an application. Will this work ? @Directive({
selector: 'zoneless',
standalone: true
})
export class Zoneless {
vcRef = inject(ViewContainerRef);
tplRef = inject(TemplateRef);
ngZone = inject(NgZone);
ngOnInit() {
this.ngZone.runOutsideAngular(() => {
this.vcRef.createEmbeddedView(this.tplRef);
});
}
} and apply it on some router-outlet // main-layout.component.html
<header />
<router-outlet *zoneless />
<footer /> |
Yes and no. ZoneJS still patches edit: You'd probably see things working somewhat as expected for a bit because create mode would create all the handlers outside the zone so all their callbacks would execute outside the zone. But change detection still runs inside edit 2: example |
And that is supposed to change if Angular goes zoneless by default, right? |
Change detection will always run inside |
4cb5c42
to
268dc28
Compare
packages/core/src/change_detection/scheduling/zoneless_scheduling_impl.ts
Outdated
Show resolved
Hide resolved
268dc28
to
a998a5b
Compare
packages/core/src/change_detection/scheduling/zoneless_scheduling_impl.ts
Outdated
Show resolved
Hide resolved
a998a5b
to
191f5a1
Compare
caretaker note: This will require fixing the MfW implementation, as seen in cl/619562101 |
…change detection This commit makes the zoneless scheduler (privately) available to applications that have ZoneJS-based change detection. This would catch any changes of interest (signal updates, `markForCheck` calls, attaching `Dirty` views) that happen outside the Angular Zone. See angular#53844 for additional information about why this is important. More details to come in the a future commit that makes this a public option.
191f5a1
to
af09985
Compare
This PR was merged into the repository by commit 80f96e7. |
…ation This commit fixes a mistake in angular#54952 where the first pending task was falsey because its ID is 0
…change detection (angular#54952) This commit makes the zoneless scheduler (privately) available to applications that have ZoneJS-based change detection. This would catch any changes of interest (signal updates, `markForCheck` calls, attaching `Dirty` views) that happen outside the Angular Zone. See angular#53844 for additional information about why this is important. More details to come in the a future commit that makes this a public option. PR Close angular#54952
…ation (angular#55074) This commit fixes a mistake in angular#54952 where the first pending task was falsey because its ID is 0 PR Close angular#55074
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. |
This commit makes the zoneless scheduler (privately) available to applications that have ZoneJS-based change detection. This would catch any changes of interest (signal updates,
markForCheck
calls, attachingDirty
views) that happen outside the Angular Zone.See #53844 for additional information about why this is important. More details to come in the a future commit that makes this a public option.