Skip to content

Conversation

@atscott
Copy link
Contributor

@atscott atscott commented Jun 18, 2024

…s complete

This commit delays makes two changes:

  • Use the read phase for afterNextRender hook. We really want to wait for any write hooks to complete before starting the animation
  • In addition, wait a macrotask before resolve (really, this makes the above change unnecessary but it's still conceptually the right thing). This ensures any follow-up rendering in the microtask queue is flushed before the animation starts.

Important note: This only affects the timing of the animation start, delaying it longer to allow additional rendering/change detections to flush. This promise already resolves in an afterNextRender hook and is only used directly by the browser's view transition machinery.

…s complete

This commit delays makes two changes:

* Use the `read` phase for `afterNextRender` hook. We really want to
   wait for any write hooks to complete before starting the animation
* In addition, wait a macrotask before resolve (really, this makes the
   above change unnecessary but it's still conceptually the right
   thing). This ensures any follow-up rendering in the microtask queue
   is flushed before the animation starts.

Important note: This only affects the timing of the animation start,
delaying it longer to allow additional rendering/change detections to
flush. This promise already resolves in an `afterNextRender` hook and is
only used directly by the browser's view transition machinery.
@atscott atscott added area: router target: patch This PR is targeted for the next patch release labels Jun 18, 2024
@ngbot ngbot bot added this to the Backlog milestone Jun 18, 2024
@atscott atscott requested a review from AndrewKushnir June 18, 2024 16:16
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label Jun 18, 2024
@AndrewKushnir
Copy link
Contributor

This PR was merged into the repository by commit 0d52c6b.

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

AndrewKushnir pushed a commit that referenced this pull request Jun 20, 2024
…s complete (#56494)

This commit delays makes two changes:

* Use the `read` phase for `afterNextRender` hook. We really want to
   wait for any write hooks to complete before starting the animation
* In addition, wait a macrotask before resolve (really, this makes the
   above change unnecessary but it's still conceptually the right
   thing). This ensures any follow-up rendering in the microtask queue
   is flushed before the animation starts.

Important note: This only affects the timing of the animation start,
delaying it longer to allow additional rendering/change detections to
flush. This promise already resolves in an `afterNextRender` hook and is
only used directly by the browser's view transition machinery.

PR Close #56494
@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 Jul 27, 2024
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: router target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants