Skip to content

Commit

Permalink
refactor(router): Update recognize to use Observable instead of `…
Browse files Browse the repository at this point in the history
…Promise` (#46021)

The `Observable` chain is currenlty the most straightforward way to
handle navigation cancellations where we ensure that the cancelled
navigation does not continue to be processed. Until we design and
implement an alternative way to accomplish equivalent functionality,
we need to maintain the `Observable` chain wherever we might execute
user code. One reason for this isthat user code may contain redirects so we do not
want to execute those redirects if the navigation was already cancelled.

PR Close #46021
  • Loading branch information
atscott authored and jessicajaniuk committed Jun 13, 2022
1 parent de058bb commit 72e6a94
Show file tree
Hide file tree
Showing 6 changed files with 241 additions and 160 deletions.
10 changes: 6 additions & 4 deletions goldens/circular-deps/packages.json
Expand Up @@ -305,6 +305,12 @@
"packages/forms/src/validators.ts",
"packages/forms/src/model/abstract_model.ts"
],
[
"packages/router/src/apply_redirects.ts",
"packages/router/src/operators/check_guards.ts",
"packages/router/src/router.ts",
"packages/router/src/operators/apply_redirects.ts"
],
[
"packages/router/src/directives/router_outlet.ts",
"packages/router/src/router_outlet_context.ts"
Expand All @@ -326,10 +332,6 @@
"packages/router/src/operators/apply_redirects.ts",
"packages/router/src/router.ts"
],
[
"packages/router/src/operators/check_guards.ts",
"packages/router/src/router.ts"
],
[
"packages/router/src/operators/recognize.ts",
"packages/router/src/router.ts"
Expand Down
2 changes: 1 addition & 1 deletion goldens/size-tracking/integration-payloads.json
Expand Up @@ -33,7 +33,7 @@
"cli-hello-world-lazy": {
"uncompressed": {
"runtime": 2835,
"main": 237084,
"main": 238471,
"polyfills": 33842,
"src_app_lazy_lazy_module_ts": 780
}
Expand Down
20 changes: 16 additions & 4 deletions packages/core/test/bundling/router/bundle.golden_symbols.json
Expand Up @@ -494,6 +494,9 @@
{
"name": "ROUTES2"
},
{
"name": "Recognizer"
},
{
"name": "RefCountOperator"
},
Expand Down Expand Up @@ -674,6 +677,9 @@
{
"name": "TakeSubscriber"
},
{
"name": "TakeWhileSubscriber"
},
{
"name": "TapSubscriber"
},
Expand Down Expand Up @@ -1520,6 +1526,9 @@
{
"name": "joinWithSlash"
},
{
"name": "last"
},
{
"name": "last2"
},
Expand Down Expand Up @@ -1562,6 +1571,9 @@
{
"name": "matchSegments"
},
{
"name": "matchWithChecks"
},
{
"name": "materializeViewResults"
},
Expand Down Expand Up @@ -1604,9 +1616,6 @@
{
"name": "navigationCancelingError"
},
{
"name": "newObservableError"
},
{
"name": "nextBindingIndex"
},
Expand Down Expand Up @@ -1667,6 +1676,9 @@
{
"name": "pathCompareMap"
},
{
"name": "pipeFromArray"
},
{
"name": "platformBrowser"
},
Expand Down Expand Up @@ -1695,7 +1707,7 @@
"name": "readPatchedLView"
},
{
"name": "recognize2"
"name": "redirectIfUrlTree"
},
{
"name": "refCount"
Expand Down

0 comments on commit 72e6a94

Please sign in to comment.