Skip to content

fix(core): Ensure application remains unstable during bootstrap #62631

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

atscott
Copy link
Contributor

@atscott atscott commented Jul 14, 2025

This commit ensures the application remains unstable during the entire bootstrap process. This ensures all bootstrap listeners and app initializers observe the application as being unstable until each one has gotten a chance to execute the synchronous block (potentially adding more pending tasks).

Prior to this commit, application initializers or bootstrap listeners may observe the application as being stable, even though other initializers/listeners had not yet executed. This created an ordering issue whereby the hydration bootstrap listener would observe the application as stable prior to the router performing its initial navigation.

fixes #62592

@atscott atscott added target: patch This PR is targeted for the next patch release area: core Issues related to the framework runtime labels Jul 14, 2025
@ngbot ngbot bot added this to the Backlog milestone Jul 14, 2025
@atscott atscott requested a review from thePunderWoman July 14, 2025 17:24
This commit ensures the application remains unstable during the entire
bootstrap process. This ensures all bootstrap listeners and app
initializers observe the application as being unstable until each one
has gotten a chance to execute the synchronous block (potentially adding
more pending tasks).

Prior to this commit, application initializers or bootstrap
listeners may observe the application as being stable, even though other
initializers/listeners had not yet executed. This created an ordering
issue whereby the hydration bootstrap listener would observe the
application as stable prior to the router performing its initial
navigation.

fixes angular#62592
@atscott atscott force-pushed the bootstraphydration branch from cab77d0 to 5794976 Compare July 14, 2025 18:16
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

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

LGTM!

@thePunderWoman thePunderWoman added the action: merge The PR is ready for merge by the caretaker label Jul 15, 2025
@AndrewKushnir
Copy link
Contributor

This PR was merged into the repository by commit 859958d.

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

AndrewKushnir pushed a commit that referenced this pull request Jul 15, 2025
This commit ensures the application remains unstable during the entire
bootstrap process. This ensures all bootstrap listeners and app
initializers observe the application as being unstable until each one
has gotten a chance to execute the synchronous block (potentially adding
more pending tasks).

Prior to this commit, application initializers or bootstrap
listeners may observe the application as being stable, even though other
initializers/listeners had not yet executed. This created an ordering
issue whereby the hydration bootstrap listener would observe the
application as stable prior to the router performing its initial
navigation.

fixes #62592

PR Close #62631
atscott added a commit to atscott/angular that referenced this pull request Jul 16, 2025
Updates the approach from angular#62631 to
use Promise.finally for task removal. This is a bit cleaner and also handles
rejections from the donePromise
kirjs pushed a commit that referenced this pull request Jul 18, 2025
Updates the approach from #62631 to
use Promise.finally for task removal. This is a bit cleaner and also handles
rejections from the donePromise

PR Close #62674
kirjs pushed a commit that referenced this pull request Jul 18, 2025
Updates the approach from #62631 to
use Promise.finally for task removal. This is a bit cleaner and also handles
rejections from the donePromise

PR Close #62674
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

Hydration doesn't work with lazy-loaded components when using zoneless change detection
3 participants