feat(core): Remove provideZonelessChangeDetection
requirement when ZoneJS is not present
#62655
+79
−47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change updates the internals to provide zoneless scheduling by default when ZoneJS. Developers may still need to use
provideZonelessChangeDetection
in the providers if the application exists alongside another one that uses ZoneJS (because ZoneJS would then be present and the zone-based change detection scheduler would then be selected). For most applications, this will be sufficient for selecting the correct scheduler without needing the provider.This is one step towards zoneless by default, but does not yet go as far as removing the
provideZoneChangeDetection
from the internals. That would/will be larger breaking change since it will require existing Zone-based applications to manually includeprovideZoneChangeDetection
to the application providers (and for all tests).BREAKING CHANGE: Applications that configure a custom zoneless implementation now and do not want the Angular zoneless scheduler to be enabled will need to include
provideZoneChangeDetection
as well as a provider forNgZone
in the application providers: