angular-cn/packages/router/test
Jason Aden b7baf632c0 refactor(router): move routing into a single Observable stream (#25740)
This is a major refactor of how the router previously worked. There are a couple major advantages of this refactor, and future work will be built on top of it.

First, we will no longer have multiple navigations running at the same time. Previously, a new navigation wouldn't cause the old navigation to be cancelled and cleaned up. Instead, multiple navigations could be going at once, and we imperatively checked that we were operating on the most current `router.navigationId` as we progressed through the Observable streams. This had some major faults, the biggest of which was async races where an ongoing async action could result in a redirect once the async action completed, but there was no way to guarantee there weren't also other redirects that would be queued up by other async actions. After this refactor, there's a single Observable stream that will get cleaned up each time a new navigation is requested.

Additionally, the individual pieces of routing have been pulled out into their own operators. While this was needed in order to create one continuous stream, it also will allow future improvements to the testing APIs as things such as Guards or Resolvers should now be able to be tested in much more isolation.

* Add the new `router.transitions` observable of the new `NavigationTransition` type to contain the transition information
* Update `router.navigations` to pipe off of `router.transitions`
* Re-write navigation Observable flow to a single configured stream
* Refactor `switchMap` instead of the previous `mergeMap` to ensure new navigations cause a cancellation and cleanup of already running navigations
* Wire in existing error and cancellation logic so cancellation matches previous behavior

PR Close #25740
2018-09-27 14:02:57 -07:00
..
aot_ngsummary_test build(bazel): update to rules_typescript 0.17.0 & rules_nodejs 0.13.4 (#25920) 2018-09-18 13:05:38 -07:00
utils build: add bazel test rules for remainder of packages (#21053) 2017-12-22 13:10:51 -08:00
BUILD.bazel build(bazel): update to rules_typescript 0.17.0 & rules_nodejs 0.13.4 (#25920) 2018-09-18 13:05:38 -07:00
apply_redirects.spec.ts feat(router): add UrlSegment[] to CanLoad interface (#13127) 2018-08-16 16:32:18 -07:00
bootstrap.spec.ts build: upgrade jasmine (and related typings) to latest version (#19904) 2018-07-06 13:48:02 -07:00
config.spec.ts fix(router): fix lazy loading of aux routes (#23459) 2018-06-13 11:20:20 -07:00
create_router_state.spec.ts build: upgrade jasmine (and related typings) to latest version (#19904) 2018-07-06 13:48:02 -07:00
create_url_tree.spec.ts feat(core): upgrade rxjs to 6.0.0-alpha.4 (#22573) 2018-03-19 21:51:51 -07:00
helpers.ts build: add bazel test rules for remainder of packages (#21053) 2017-12-22 13:10:51 -08:00
integration.spec.ts refactor(router): move routing into a single Observable stream (#25740) 2018-09-27 14:02:57 -07:00
recognize.spec.ts fix(router): Fix _lastPathIndex in deeply nested empty paths (#22394) 2018-07-25 11:27:28 -07:00
regression_integration.spec.ts build(bazel): Turning on strictPropertyInitialization for Angular. (#24572) 2018-06-25 07:57:13 -07:00
router.spec.ts build: upgrade jasmine (and related typings) to latest version (#19904) 2018-07-06 13:48:02 -07:00
router_preloader.spec.ts fix(router): don't mutate route configs (#22358) 2018-02-22 13:35:38 -08:00
router_scroller.spec.ts fix(router): default scroll position restoration to disabled (#25586) 2018-08-21 10:48:14 -07:00
router_state.spec.ts build: upgrade jasmine (and related typings) to latest version (#19904) 2018-07-06 13:48:02 -07:00
shared.spec.ts style: typos fixed - https://github.com/vlajos/misspell-fixer (#22975) 2018-03-27 14:51:53 -04:00
spy_ng_module_factory_loader.spec.ts build: upgrade jasmine (and related typings) to latest version (#19904) 2018-07-06 13:48:02 -07:00
url_serializer.spec.ts fix(router): correct the segment parsing so it won't break on ampersand (#23684) 2018-05-10 07:53:53 -07:00
url_tree.spec.ts style: typos fixed - https://github.com/vlajos/misspell-fixer (#22975) 2018-03-27 14:51:53 -04:00