-
Notifications
You must be signed in to change notification settings - Fork 27k
Update Router's recognize step to use async/await #62994
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
Conversation
33addc6 to
006cab6
Compare
006cab6 to
ae4e101
Compare
3a9a217 to
d52fcfa
Compare
|
caretaker note: this will need patch cl/800152294 to temporarily disable the change in g3 |
d52fcfa to
26b84bb
Compare
This is effectively a revert of angular@72e6a94. Debugging the recognize stage is considerably easier with async/await stacks compared to rxjs. This also improves maintainability and is a better 1:1 with server-side logic that has been implemented to match and can be more easily kept in sync. This also ensures that the recognize step is always async, whereas it can sometimes be synchronous with rxjs. BREAKING CHANGE: Router navigations may take several additional microtasks to complete. Tests have been found to often be highly dependent on the exact timing of navigation completions with respect to the microtask queue. The most common fix for tests is to ensure all navigations have been completed before making assertions. On rare occasions, this can also affect production applications. This can be caused by multiple subscriptions to router state throughout the application, both of which trigger navigations that happened to not conflict with the previous timing.
26b84bb to
0658b79
Compare
To aid in hitting external breaking change deadlines without pressure of fixing everything in g3 first, add an internal opt out flag. This also adds a privately exported provider to revert to the old rxjs-based behavior, which can be synchronous, until any issues that come up are addressed.
0658b79 to
87ed780
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
#62994) To aid in hitting external breaking change deadlines without pressure of fixing everything in g3 first, add an internal opt out flag. This also adds a privately exported provider to revert to the old rxjs-based behavior, which can be synchronous, until any issues that come up are addressed. PR Close #62994
This fixes a bug introduced in angular#62994 where `toPromise` was used. This doesn't work in all situations here because some observables don't complete. This only affected the redirect path, since the others are already behind other rxjs code which takes the first value from the user guards. Note: This is marked as a refactor rather than fix because the commit above is not in any release yet.
This fixes a bug introduced in angular#62994 where `toPromise` was used. This doesn't work in all situations here because some observables don't complete. This only affected the redirect path, since the others are already behind other rxjs code which takes the first value from the user guards. Note: This is marked as a refactor rather than fix because the commit above is not in any release yet.
This fixes a bug introduced in angular#62994 where `toPromise` was used. This doesn't work in all situations here because some observables don't complete. This only affected the redirect path, since the others are already behind other rxjs code which takes the first value from the user guards. Note: This is marked as a refactor rather than fix because the commit above is not in any release yet.
This fixes a bug introduced in angular#62994 where `toPromise` was used. This doesn't work in all situations here because some observables don't complete. This only affected the redirect path, since the others are already behind other rxjs code which takes the first value from the user guards. Note: This is marked as a refactor rather than fix because the commit above is not in any release yet.
This fixes a bug introduced in #62994 where `toPromise` was used. This doesn't work in all situations here because some observables don't complete. This only affected the redirect path, since the others are already behind other rxjs code which takes the first value from the user guards. Note: This is marked as a refactor rather than fix because the commit above is not in any release yet. PR Close #63485
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This is effectively a revert of 72e6a94.
Debugging the recognize stage is considerably easier with async/await
stacks compared to rxjs. This also improves maintainability and is a
better 1:1 with server-side logic that has been implemented to match
and can be more easily kept in sync.
BREAKING CHANGE: Router navigations may take several additional
microtasks to complete. Tests have been found to often be highly
dependent on the exact timing of navigation completions with respect to
the microtask queue. The most common fix for tests is to ensure all
navigations have been completed before making assertions. On rare
occasions, this can also affect production applications. This can be
caused by multiple subscriptions to router state throughout the application,
both of which trigger navigations that happened to not conflict with the
previous timing.