10000 fix(core): execute timer trigger outside zone by thePunderWoman · Pull Request #60392 · angular/angular · GitHub
[go: up one dir, main page]

Skip to content

fix(core): execute timer trigger outside zone #60392

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

Closed
wants to merge 1 commit into from

Conversation

thePunderWoman
Copy link
Contributor
@thePunderWoman thePunderWoman commented Mar 14, 2025

This should prevent defer timers from impacting app stability by executing them outside of the zone, similar to other defer triggers. This should also affect minimum and after time values in placeholder and loading templates for defer blocks, as they use the same TimerScheduler.

Does this PR introduce a breaking change?

  • Yes
  • No

@thePunderWoman thePunderWoman added action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release labels Mar 14, 2025
@ngbot ngbot bot modified the milestone: Backlog Mar 14, 2025
This should prevent defer timers from impacting app stability by executing them outside of the zone, similar to other defer triggers.

fixes: angular#60373
@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer action: merge The PR is ready for merge by the caretaker labels Mar 14, 2025
@pkozlowski-opensource
Copy link
Member

This PR was merged into the repository by commit b8daf47.

The changes were merged into the following branches: main, 19.2.x

pkozlowski-opensource pushed a commit that referenced this pull request Mar 14, 2025
This should prevent defer timers from impacting app stability by executing them outside of the zone, similar to other defer triggers.

fixes: #60373

PR Close #60392
@@ -60,10 +62,10 @@ export class TimerScheduler {
// as the shape of the `current` list.
deferred: Array<number | VoidFunction> = [];

add(delay: number, callback: VoidFunction) {
add(delay: number, callback: VoidFunction, ngZone: NgZone) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since TimerScheduler is an injectable class, we could avoid passing ngZone as an argument, but instead just inject it in the class directly (using the inject function).

@angular-automatic-lock-bot
Copy link

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 Apr 14, 2025
@thePunderWoman thePunderWoman deleted the timer-zone branch May 23, 2025 13:48
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: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0