Skip to content

refactor(core): Update zone and zoneless error to be a warning instead - #63457

Closed
atscott wants to merge 1 commit into
angular:mainfrom
atscott:warnonmultiplecdproviders
Closed

atscott wants to merge 1 commit into
angular:mainfrom
atscott:warnonmultiplecdproviders

Conversation

@atscott

@atscott atscott commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

This updates the error thrown when both provideZoneChangeDetection and provideZonelessChangeDetection are both used in the application providers to be a warning instead. The reasons for this are twofold:

  1. The migration we need for using zoneless by default isn't perfect and may add provideZoneChangeDetection when the zoneless provider exists. This change will prevent that from causing an error
  2. There might be valid situations where a "default" is used in a common provider but that can be overridden by individal applications. In tests, we do allow this type of thing, where initTestEnvironment may have a default but individual tests might want to use a different one. The same logic might apply to applications in some environments.

@atscott atscott added the target: major This PR is targeted for the next major release label Aug 28, 2025
@angular-robot angular-robot Bot added the area: core Issues related to the framework runtime label Aug 28, 2025
@ngbot ngbot Bot added this to the Backlog milestone Aug 28, 2025
Comment thread packages/core/src/platform/bootstrap.ts Outdated
This updates the error thrown when both `provideZoneChangeDetection` and
`provideZonelessChangeDetection` are both used in the application
providers to be a warning instead. The reasons for this are twofold:

1. The migration we need for using zoneless by default isn't perfect and
   may add `provideZoneChangeDetection` when the zoneless provider
   exists. This change will prevent that from causing an error
2. There might be valid situations where a "default" is used in a common
   provider but that can be overridden by individal applications. In
   tests, we do allow this type of thing, where `initTestEnvironment`
   may have a default but individual tests might want to use a different
   one. The same logic might apply to applications in some environments.
@atscott
atscott force-pushed the warnonmultiplecdproviders branch from d043cdf to 2bf9861 Compare August 29, 2025 21:09
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Aug 29, 2025
@mmalerba

mmalerba commented Sep 2, 2025

Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

@mmalerba mmalerba closed this in 541613e Sep 2, 2025
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Oct 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants