angular/packages
Andrew Scott ad61bf6184 refactor(router): Remove internal state tracking for browserUrlTree (#48065)
The browserUrlTree is only used to support the onSameUrlNavigation: 'ignore' logic. We can achieve this functionality without having this state tracked inside the Router. Instead, we can re-examine what ignore means: We don't want to rerun the matching logic, guards, or resolvers when we already know that nothing is changing.
Outside of the "navigated", there are two things that constitute a "change":

1. The browser URL might change. Because of skipLocationChange, the browser URL might not always match the internal state of the Router (we can navigate to a path but skip updating the browser URL). If we're navigating to a place that would change the browser URL, we should process the navigation. Theoretically, all we need to really do is update the browser URL instead of processing the whole navigation w/ guards, redirects, and resolvers. But this doesn't matter that much because the default value for runGuardsAndResolvers will skip all of this anyways.
2. The internal state of the Router might change. That is, we're navigating to a new path and may or may not be updating the updating the browser URL.

If either of the above are true, we process the navigation. If both are false, we aren't changing anything so we can safely ignore the navigation request (as long as onSameUrlNavigation === 'ignore').

Why is this change important?

* Simplification of Router internals. The Router has a lot of special case handling and one-offs to handle a limited set of scenarios. Removing these when possible makes the code easier to follow

PR Close #48065
2023-09-19 16:50:56 +02:00
..
animations build: remove support for Node.js v16 (#51755) 2023-09-13 10:49:06 -07:00
bazel feat(core): drop support for older TypeScript versions (#51792) 2023-09-19 12:04:09 +02:00
benchpress docs: updated the benchpress readme doc (#51110) 2023-07-21 16:43:30 +00:00
common Revert "feat(common): make the warning for lazy-loaded lcp image an error (#51748)" (#51810) 2023-09-18 13:35:55 +02:00
compiler refactor(compiler): add utility to resolve the deferred block trigger element (#51816) 2023-09-19 12:16:00 +02:00
compiler-cli refactor(compiler): update binder to account for new semantics (#51816) 2023-09-19 12:16:00 +02:00
core refactor(router): Remove internal state tracking for browserUrlTree (#48065) 2023-09-19 16:50:56 +02:00
docs/di docs: remove outdated/unsupported webworker doc (#49856) 2023-04-17 14:01:41 +00:00
elements build: remove support for Node.js v16 (#51755) 2023-09-13 10:49:06 -07:00
examples build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
forms build: remove support for Node.js v16 (#51755) 2023-09-13 10:49:06 -07:00
language-service feat(language-service): Enable go to definition of styleUrl (#51746) 2023-09-18 10:37:19 +02:00
localize fix(localize): ng-add schematics for application builder (#51777) 2023-09-15 09:07:51 +02:00
misc/angular-in-memory-web-api docs: update invalid links to the new http guides (#49456) 2023-06-22 17:06:59 -07:00
platform-browser build: remove support for Node.js v16 (#51755) 2023-09-13 10:49:06 -07:00
platform-browser-dynamic build: remove support for Node.js v16 (#51755) 2023-09-13 10:49:06 -07:00
platform-server build: remove support for Node.js v16 (#51755) 2023-09-13 10:49:06 -07:00
private/testing fix(platform-server): bundle @angular/domino in via esbuild (#49229) 2023-02-28 13:34:50 -08:00
router refactor(router): Remove internal state tracking for browserUrlTree (#48065) 2023-09-19 16:50:56 +02:00
service-worker build: remove support for Node.js v16 (#51755) 2023-09-13 10:49:06 -07:00
upgrade build: remove support for Node.js v16 (#51755) 2023-09-13 10:49:06 -07:00
zone.js release: cut the zone.js-0.14.0 release (#51774) 2023-09-18 11:56:17 +02:00
BUILD.bazel build(bazel): list docs entrypoints under packages to simplify docgen 2022-11-22 13:51:16 -07:00
circular-deps-test.conf.js build: ignore type only imports/exports for circular dependency checks (#47017) 2022-08-18 12:06:09 -07:00
empty.ts
goog.d.ts refactor(core): replace references to goog.LOCALE with goog.getLocale() (#43089) 2021-08-10 10:35:26 -07:00
license-banner.txt build: bump license year (#44590) 2022-01-04 12:05:25 -08:00
README.md
system.d.ts
tsconfig-build.json build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
tsconfig-legacy-saucelabs.json refactor(compiler): drop obsolete NgFactory and NgSummary config options (#48268) 2023-02-21 13:03:59 -08:00
tsconfig-test.json build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
tsconfig-tsec-base.json refactor(core): throw an error when hydration marker is missing from DOM (#51170) 2023-08-04 11:31:49 -04:00
tsconfig.json build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
tsec-exemption.json fix(core): hardening attribute and property binding rules for <iframe> elements (#47964) 2022-11-09 00:47:56 -08:00
types.d.ts build: update to jasmine 4.0 (#45558) 2022-04-11 16:25:28 +00:00

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT