Go to file
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
.circleci ci(docs-infra): run the script in the correct folder 2018-09-27 09:04:53 -07:00
.github ci: correct github robot size check configuration (#26057) 2018-09-21 10:21:28 -07:00
aio build: RxJS updated to 6.3 (#26087) 2018-09-26 17:01:15 -07:00
docs docs(bazel): add info on options for nodejs_test rule (#25877) 2018-09-11 07:11:51 -07:00
integration feat(ivy): expose a series of helpful application inspection tools (#25919) 2018-09-25 09:46:12 -07:00
modules build(bazel): update to rules_typescript 0.17.0 & rules_nodejs 0.13.4 (#25920) 2018-09-18 13:05:38 -07:00
packages refactor(router): move routing into a single Observable stream (#25740) 2018-09-27 14:02:57 -07:00
scripts ci(docs-infra): test PR previews on CI (#25671) 2018-09-26 15:26:19 -07:00
tools style: update gulp task to format untracked and diff files separately (#24969) 2018-09-27 12:09:08 -07:00
.bowerrc chore(dgeni): clean up legacy typings bundle creation 2015-10-29 21:19:59 +00:00
.clang-format feat(tooling): Add a .clang-format for automated JavaScript formatting. 2015-04-02 08:44:34 -07:00
.editorconfig chore(.editorconfig): include markdown config 2015-01-27 00:14:48 -08:00
.gitattributes chore: force lf EOL for ts files (#11143) 2016-08-29 12:41:58 -07:00
.gitignore build: update Bazel dependency to 0.11.1 (#23297) 2018-04-10 23:01:30 -07:00
.mailmap build: add a Git .mailmap with my new name (#19550) 2017-10-09 14:35:30 -07:00
.nvmrc build: update .nvmrc file to correct node version (#25992) 2018-09-18 13:11:58 -07:00
.pullapprove.yml ci: remove `vicb` from `pullapprove.yml` (#25702) 2018-08-28 11:15:53 -07:00
.travis.yml build: update to Node 10 (#25822) 2018-09-06 14:58:30 -07:00
BUILD.bazel test(upgrade): run tests against AngularJS v1.7.x as well (#25231) 2018-08-01 14:10:21 -07:00
CHANGELOG.md release: cut the v7.0.0-beta.7 release 2018-09-26 15:07:11 -07:00
CODE_OF_CONDUCT.md docs: fix community tab in GitHub by copying CoC 2018-02-27 19:02:30 -08:00
CONTRIBUTING.md docs: change `aio` scope to `docs-infra` (#24410) 2018-06-12 11:36:14 -07:00
LICENSE docs(common): update copyright years (#21232) 2018-01-04 17:45:36 -05:00
README.md docs: improve the GitHub README.md, update links, etc 2018-05-03 13:26:12 -07:00
WORKSPACE build: RxJS updated to 6.3 (#26087) 2018-09-26 17:01:15 -07:00
bower.json docs: branding fixes (#14132) 2017-01-27 15:03:11 -06:00
browser-providers.conf.js feat(elements): enable Shadow DOM v1 and slots (#24861) 2018-08-30 21:33:14 -07:00
build.sh feat(ivy): implement TestBed (#25369) 2018-08-14 11:58:47 -07:00
gulpfile.js style: update gulp task to format untracked and diff files separately (#24969) 2018-09-27 12:09:08 -07:00
index.bzl style: format .bzl files with buildifier (#23544) 2018-08-08 13:12:07 -07:00
karma-js.conf.js fix(router): take base uri into account in `setUpLocationSync()` (#20244) 2018-08-06 11:11:07 -07:00
package.json style: update gulp task to format untracked and diff files separately (#24969) 2018-09-27 12:09:08 -07:00
protractor-e2e.conf.js refactor: add license header to JS files & format files (#12081) 2016-10-04 20:39:20 -07:00
protractor-examples-e2e.conf.js refactor: format and lint code 2016-12-12 11:30:25 -08:00
protractor-perf.conf.js build(bazel): fix broken travis CI (#24788) 2018-07-24 08:26:16 -07:00
shims_for_IE.js Revert "refactor: add license header to JS files & format files (#12035)" 2016-10-04 14:06:41 -07:00
test-events.js fix(platform-browser): run BLACK_LISTED_EVENTS outside of ngZone (#18993) 2017-09-05 15:33:22 -05:00
test-main.js refactor(core): remove withBody from public testing API (#25171) 2018-07-31 15:09:32 -07:00
test.sh feat: typescript 2.9 support (#24652) 2018-07-03 13:32:06 -07:00
tslint.json style: tslint enforces no debugger statements left behind (#25532) 2018-08-16 16:00:22 -07:00
yarn.lock style: update gulp task to format untracked and diff files separately (#24969) 2018-09-27 12:09:08 -07:00
yarn.lock.readme.md docs: replace npm with yarn in lockfile readme (#25309) 2018-08-06 13:38:13 -07:00

README.md

Build Status CircleCI BrowserStack Status Join the chat at https://gitter.im/angular/angular npm version

Angular

Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages.

Quickstart

Get started in 5 minutes.

Changelog

Learn about the latest improvements.

Want to help?

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.