angular/packages/core/test
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
..
acceptance refactor(core): flatten and resolve ng-module bootstrap info in local compilation mode (#51767) 2023-09-18 16:59:55 +02:00
animation build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
bundling refactor(router): Remove internal state tracking for browserUrlTree (#48065) 2023-09-19 16:50:56 +02:00
change_detection refactor(core): Cleanup for Iterable differs test. (#49598) 2023-04-04 15:13:01 -07:00
compiler build: ensure bootstrap transitive runfiles are made available (#48521) 2022-12-19 19:50:41 +00:00
debug build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
di refactor(core): remove unnecessary import for custom expect. (#51216) 2023-08-07 09:22:17 -07:00
dom refactor(core): cleanup type any (#48623) 2023-01-04 12:15:16 -08:00
hydration refactor(core): adding hydration for content projection (#49454) 2023-03-21 17:42:53 +01:00
i18n build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
linker refactor(core): decouple effects from change detection (#51049) 2023-09-12 08:12:56 -07:00
metadata feat(core): support styles and styleUrl as strings (#51715) 2023-09-12 13:57:07 -07:00
reflection refactor(core): remove unused logic from reflection capabilities (#45335) 2022-03-24 11:02:39 -07:00
render3 refactor(core): fix NgModule compilation scope in deps tracker (#51791) 2023-09-18 17:00:31 +02:00
sanitization refactor(core): Better use of Object.keys() (#51153) 2023-07-25 09:17:46 -07:00
signals refactor(core): make sure that destroyed watch nodes dont run again (#51757) 2023-09-15 14:00:32 +02:00
strict_types refactor(core): rename ...WithMeta types to ...Declaration and alias to unknown (#41119) 2021-03-22 08:57:18 -07:00
testability refactor: use queueMicrotask to schedule micro tasks instead of various helpers (#50485) 2023-06-15 16:38:21 +02:00
util feat(core): add ability to transform input values (#50420) 2023-05-30 13:01:13 -07:00
zone refactor: use queueMicrotask to schedule micro tasks instead of various helpers (#50485) 2023-06-15 16:38:21 +02:00
application_config_spec.ts feat(core): add mergeApplicationConfig method (#49253) 2023-03-01 11:20:31 -08:00
application_init_spec.ts refactor(core): throw an error when APP_INITIALIZER token is not an array. (#49860) 2023-04-23 18:31:24 -07:00
application_module_spec.ts test(core): fix a crosstalk issue with locale ids (#45626) 2022-04-18 09:28:42 -07:00
application_ref_integration_spec.ts refactor(platform-browser): update renderer to be able to remove ServerRendererFactory2 and EmulatedEncapsulationServerRenderer2 (#49630) 2023-04-05 11:42:57 -07:00
application_ref_spec.ts refactor(core): handle #24571 todos. (#49221) 2023-06-14 12:33:44 +02:00
BUILD.bazel build: bundle tests for karma web test suites (#48521) 2022-12-19 19:50:42 +00:00
component_fixture_spec.ts refactor(core): Add defer block testing fixture (#51698) 2023-09-13 10:47:04 -07:00
defer_fixture_spec.ts refactor(core): Add defer block testing fixture (#51698) 2023-09-13 10:47:04 -07:00
dev_mode_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
directive_lifecycle_integration_spec.ts refactor(core): cleanup type any (#48623) 2023-01-04 12:15:16 -08:00
error_handler_spec.ts refactor(core): remove unused error handler logic (#46216) 2022-06-02 13:40:16 -07:00
event_emitter_spec.ts refactor(core): cleanup type any (#48623) 2023-01-04 12:15:16 -08:00
fake_async_spec.ts refactor(core): remove unnecessary import for custom expect. (#51216) 2023-08-07 09:22:17 -07:00
forward_ref_integration_spec.ts refactor(core): handle #24571 todos. (#49221) 2023-06-14 12:33:44 +02:00
runtime_error_spec.ts refactor(core): improve error message when dom node is not found (#49977) 2023-04-25 09:29:47 -07:00
test_bed_effect_spec.ts refactor(core): decouple effects from change detection (#51049) 2023-09-12 08:12:56 -07:00
test_bed_spec.ts refactor(core): Add defer block testing fixture (#51698) 2023-09-13 10:47:04 -07:00
transfer_state_spec.ts refactor(core): simplify state transfer escaping (#50201) 2023-05-10 11:31:34 -07:00
util_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00