Skip to content
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

fix(core): use setTimeout when coalescing tasks in Node.js #50820

Closed
wants to merge 1 commit into from

Conversation

arturovt
Copy link
Contributor

@arturovt arturovt commented Jun 22, 2023

This commit updates the implementation of the getNativeRequestAnimationFrame and checks whether the current code runs in the browser before retrieving requestAnimationFrame. requestAnimationFrame is not available when the code is running in the Node.js environment. We have to fallback to setTimeout for delaying the change detection.

closes: #50801

@arturovt arturovt force-pushed the fix/50801 branch 3 times, most recently from bfb1911 to 4ef1556 Compare June 22, 2023 21:30
This commit updates the implementation of the `getNativeRequestAnimationFrame`
and checks whether the current code runs in the browser before retrieving
`requestAnimationFrame`. `requestAnimationFrame` is not available when the code
is running in the Node.js environment. We have to fallback to `setTimeout` for
delaying the change detection.
@AndrewKushnir
Copy link
Contributor

// cc @JiaLiPassion @alan-agius4

Copy link
Contributor

@JiaLiPassion JiaLiPassion left a comment

Choose a reason for hiding this comment

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

LGTM!

@arturovt arturovt marked this pull request as ready for review June 23, 2023 07:52
@pullapprove pullapprove bot requested a review from jessicajaniuk June 23, 2023 07:52
@AndrewKushnir AndrewKushnir requested review from AndrewKushnir and removed request for jessicajaniuk June 23, 2023 15:23
@AndrewKushnir AndrewKushnir added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release area: zones area: server Issues related to server-side rendering labels Jun 23, 2023
@ngbot ngbot bot added this to the Backlog milestone Jun 23, 2023
@AndrewKushnir AndrewKushnir added action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 23, 2023
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

@arturovt thanks for the fix! 👍

@AndrewKushnir AndrewKushnir added action: global presubmit The PR is in need of a google3 global presubmit and removed action: presubmit The PR is in need of a google3 presubmit labels Jun 23, 2023
@AndrewKushnir
Copy link
Contributor

TGP.

@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: global presubmit The PR is in need of a google3 global presubmit labels Jun 29, 2023
@AndrewKushnir
Copy link
Contributor

Caretaker note: the TGP is "green", this PR is ready for merge.

@angular-robot angular-robot bot closed this in b66a16e Jun 30, 2023
angular-robot bot pushed a commit that referenced this pull request Jun 30, 2023
This commit updates the implementation of the `getNativeRequestAnimationFrame`
and checks whether the current code runs in the browser before retrieving
`requestAnimationFrame`. `requestAnimationFrame` is not available when the code
is running in the Node.js environment. We have to fallback to `setTimeout` for
delaying the change detection.

PR Close #50820
@arturovt arturovt deleted the fix/50801 branch June 30, 2023 18:34
sunilbaba pushed a commit to sunilbaba/angular that referenced this pull request Jul 26, 2023
…#50820)

This commit updates the implementation of the `getNativeRequestAnimationFrame`
and checks whether the current code runs in the browser before retrieving
`requestAnimationFrame`. `requestAnimationFrame` is not available when the code
is running in the Node.js environment. We have to fallback to `setTimeout` for
delaying the change detection.

PR Close angular#50820
@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 Aug 12, 2023
thomasturrell pushed a commit to thomasturrell/angular that referenced this pull request Aug 29, 2023
…#50820)

This commit updates the implementation of the `getNativeRequestAnimationFrame`
and checks whether the current code runs in the browser before retrieving
`requestAnimationFrame`. `requestAnimationFrame` is not available when the code
is running in the Node.js environment. We have to fallback to `setTimeout` for
delaying the change detection.

PR Close angular#50820
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
…#50820)

This commit updates the implementation of the `getNativeRequestAnimationFrame`
and checks whether the current code runs in the browser before retrieving
`requestAnimationFrame`. `requestAnimationFrame` is not available when the code
is running in the Node.js environment. We have to fallback to `setTimeout` for
delaying the change detection.

PR Close angular#50820
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: server Issues related to server-side rendering area: zones merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server-side running code throws an error if the provideZoneChangeDetection is used
4 participants